public class NamingResourcesImpl extends LifecycleMBeanBase implements Serializable, NamingResources
Lifecycle.SingleUse| Modifier and Type | Field and Description |
|---|---|
protected PropertyChangeSupport |
support
The property change support for this component.
|
mserverAFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT| Constructor and Description |
|---|
NamingResourcesImpl()
Create a new NamingResources instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEjb(ContextEjb ejb)
Add an EJB resource reference for this web application.
|
void |
addEnvironment(ContextEnvironment environment)
Add an environment entry for this web application.
|
void |
addLocalEjb(ContextLocalEjb ejb)
Add a local EJB resource reference for this web application.
|
void |
addMessageDestinationRef(MessageDestinationRef mdr)
Add a message destination reference for this web application.
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a property change listener to this component.
|
void |
addResource(ContextResource resource)
Add a resource reference for this web application.
|
void |
addResourceEnvRef(ContextResourceEnvRef resource)
Add a resource environment reference for this web application.
|
void |
addResourceLink(ContextResourceLink resourceLink)
Add a resource link for this web application.
|
void |
addService(ContextService service)
Add a web service reference for this web application.
|
protected void |
destroyInternal()
Sub-classes wishing to perform additional clean-up should override this
method, ensuring that super.destroyInternal() is the last call in the
overriding method.
|
ContextEjb |
findEjb(String name) |
ContextEjb[] |
findEjbs() |
ContextEnvironment |
findEnvironment(String name) |
ContextEnvironment[] |
findEnvironments() |
ContextLocalEjb |
findLocalEjb(String name) |
ContextLocalEjb[] |
findLocalEjbs() |
MessageDestinationRef |
findMessageDestinationRef(String name) |
MessageDestinationRef[] |
findMessageDestinationRefs() |
ContextResource |
findResource(String name) |
ContextResourceEnvRef |
findResourceEnvRef(String name) |
ContextResourceEnvRef[] |
findResourceEnvRefs() |
ContextResourceLink |
findResourceLink(String name) |
ContextResourceLink[] |
findResourceLinks() |
ContextResource[] |
findResources() |
ContextService |
findService(String name) |
ContextService[] |
findServices() |
Object |
getContainer() |
protected String |
getDomainInternal()
Method implemented by sub-classes to identify the domain in which MBeans
should be registered.
|
protected String |
getObjectNameKeyProperties()
Allow sub-classes to specify the key properties component of the
ObjectName that will be used to register this component. |
ContextTransaction |
getTransaction() |
protected void |
initInternal()
Sub-classes wishing to perform additional initialization should override
this method, ensuring that super.initInternal() is the first call in the
overriding method.
|
void |
removeEjb(String name)
Remove any EJB resource reference with the specified name.
|
void |
removeEnvironment(String name)
Remove any environment entry with the specified name.
|
void |
removeLocalEjb(String name)
Remove any local EJB resource reference with the specified name.
|
void |
removeMessageDestinationRef(String name)
Remove any message destination reference with the specified name.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change listener from this component.
|
void |
removeResource(String name)
Remove any resource reference with the specified name.
|
void |
removeResourceEnvRef(String name)
Remove any resource environment reference with the specified name.
|
void |
removeResourceLink(String name)
Remove any resource link with the specified name.
|
void |
removeService(String name)
Remove any web service reference with the specified name.
|
void |
setContainer(Object container)
Set the container with which the naming resources are associated.
|
void |
setTransaction(ContextTransaction transaction)
Set the transaction object.
|
protected void |
startInternal()
Sub-classes must ensure that the state is changed to
LifecycleState.STARTING during the execution of this method. |
protected void |
stopInternal()
Sub-classes must ensure that the state is changed to
LifecycleState.STOPPING during the execution of this method. |
getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregisteraddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stopprotected final PropertyChangeSupport support
public NamingResourcesImpl()
public Object getContainer()
getContainer in interface NamingResourcespublic void setContainer(Object container)
container - the associated with the resourcespublic void setTransaction(ContextTransaction transaction)
transaction - the transaction descriptorpublic ContextTransaction getTransaction()
public void addEjb(ContextEjb ejb)
ejb - New EJB resource referencepublic void addEnvironment(ContextEnvironment environment)
addEnvironment in interface NamingResourcesenvironment - New environment entrypublic void addLocalEjb(ContextLocalEjb ejb)
ejb - New EJB resource referencepublic void addMessageDestinationRef(MessageDestinationRef mdr)
mdr - New message destination referencepublic void addPropertyChangeListener(PropertyChangeListener listener)
listener - The listener to addpublic void addResource(ContextResource resource)
addResource in interface NamingResourcesresource - New resource referencepublic void addResourceEnvRef(ContextResourceEnvRef resource)
resource - The resourcepublic void addResourceLink(ContextResourceLink resourceLink)
addResourceLink in interface NamingResourcesresourceLink - New resource linkpublic void addService(ContextService service)
service - New web service referencepublic ContextEjb findEjb(String name)
name - Name of the desired EJB resource referencenull.public ContextEjb[] findEjbs()
public ContextEnvironment findEnvironment(String name)
name - Name of the desired environment entrynull.public ContextEnvironment[] findEnvironments()
public ContextLocalEjb findLocalEjb(String name)
name - Name of the desired EJB resource referencenull.public ContextLocalEjb[] findLocalEjbs()
public MessageDestinationRef findMessageDestinationRef(String name)
name - Name of the desired message destination referencenull.public MessageDestinationRef[] findMessageDestinationRefs()
public ContextResource findResource(String name)
name - Name of the desired resource referencenull.public ContextResourceLink findResourceLink(String name)
name - Name of the desired resource linknull.public ContextResourceLink[] findResourceLinks()
public ContextResource[] findResources()
public ContextResourceEnvRef findResourceEnvRef(String name)
name - Name of the desired resource environment referencenull.public ContextResourceEnvRef[] findResourceEnvRefs()
public ContextService findService(String name)
name - Name of the desired web servicenull.public ContextService[] findServices()
public void removeEjb(String name)
name - Name of the EJB resource reference to removepublic void removeEnvironment(String name)
removeEnvironment in interface NamingResourcesname - Name of the environment entry to removepublic void removeLocalEjb(String name)
name - Name of the EJB resource reference to removepublic void removeMessageDestinationRef(String name)
name - Name of the message destination resource reference to removepublic void removePropertyChangeListener(PropertyChangeListener listener)
listener - The listener to removepublic void removeResource(String name)
removeResource in interface NamingResourcesname - Name of the resource reference to removepublic void removeResourceEnvRef(String name)
name - Name of the resource environment reference to removepublic void removeResourceLink(String name)
removeResourceLink in interface NamingResourcesname - Name of the resource link to removepublic void removeService(String name)
name - Name of the web service reference to removeprotected void initInternal()
throws LifecycleException
LifecycleMBeanBaseinitInternal in class LifecycleMBeanBaseLifecycleException - If the initialisation failsprotected void startInternal()
throws LifecycleException
LifecycleBaseLifecycleState.STARTING during the execution of this method.
Changing state will trigger the Lifecycle.START_EVENT event.
If a component fails to start it may either throw a
LifecycleException which will cause it's parent to fail to start
or it can place itself in the error state in which case LifecycleBase.stop()
will be called on the failed component but the parent component will
continue to start normally.startInternal in class LifecycleBaseLifecycleException - Start error occurredprotected void stopInternal()
throws LifecycleException
LifecycleBaseLifecycleState.STOPPING during the execution of this method.
Changing state will trigger the Lifecycle.STOP_EVENT event.stopInternal in class LifecycleBaseLifecycleException - Stop error occurredprotected void destroyInternal()
throws LifecycleException
LifecycleMBeanBasedestroyInternal in class LifecycleMBeanBaseLifecycleException - If the destruction failsprotected String getDomainInternal()
LifecycleMBeanBasegetDomainInternal in class LifecycleMBeanBaseprotected String getObjectNameKeyProperties()
LifecycleMBeanBaseObjectName that will be used to register this component.getObjectNameKeyProperties in class LifecycleMBeanBaseObjectNameCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.