Package org.apache.catalina.deploy
Class NamingResourcesImpl
- java.lang.Object
- 
- org.apache.catalina.util.LifecycleBase
- 
- org.apache.catalina.util.LifecycleMBeanBase
- 
- org.apache.catalina.deploy.NamingResourcesImpl
 
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- javax.management.MBeanRegistration,- JmxEnabled,- Lifecycle,- NamingResources
 
 public class NamingResourcesImpl extends LifecycleMBeanBase implements java.io.Serializable, NamingResources Holds and manages the naming resources defined in the J2EE Enterprise Naming Context and their associated JNDI context.- Author:
- Remy Maucherat
- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.catalina.LifecycleLifecycle.SingleUse
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected java.beans.PropertyChangeSupportsupportThe property change support for this component.- 
Fields inherited from class org.apache.catalina.util.LifecycleMBeanBasemserver
 - 
Fields inherited from interface org.apache.catalina.LifecycleAFTER_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 SummaryConstructors Constructor Description NamingResourcesImpl()Create a new NamingResources instance.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEjb(ContextEjb ejb)Add an EJB resource reference for this web application.voidaddEnvironment(ContextEnvironment environment)Add an environment entry for this web application.voidaddLocalEjb(ContextLocalEjb ejb)Add a local EJB resource reference for this web application.voidaddMessageDestinationRef(MessageDestinationRef mdr)Add a message destination reference for this web application.voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)Add a property change listener to this component.voidaddResource(ContextResource resource)Add a resource reference for this web application.voidaddResourceEnvRef(ContextResourceEnvRef resource)Add a resource environment reference for this web application.voidaddResourceLink(ContextResourceLink resourceLink)Add a resource link for this web application.voidaddService(ContextService service)Add a web service reference for this web application.protected voiddestroyInternal()Sub-classes wishing to perform additional clean-up should override this method, ensuring that super.destroyInternal() is the last call in the overriding method.ContextEjbfindEjb(java.lang.String name)ContextEjb[]findEjbs()ContextEnvironmentfindEnvironment(java.lang.String name)ContextEnvironment[]findEnvironments()ContextLocalEjbfindLocalEjb(java.lang.String name)ContextLocalEjb[]findLocalEjbs()MessageDestinationReffindMessageDestinationRef(java.lang.String name)MessageDestinationRef[]findMessageDestinationRefs()ContextResourcefindResource(java.lang.String name)ContextResourceEnvReffindResourceEnvRef(java.lang.String name)ContextResourceEnvRef[]findResourceEnvRefs()ContextResourceLinkfindResourceLink(java.lang.String name)ContextResourceLink[]findResourceLinks()ContextResource[]findResources()ContextServicefindService(java.lang.String name)ContextService[]findServices()java.lang.ObjectgetContainer()protected java.lang.StringgetDomainInternal()Method implemented by sub-classes to identify the domain in which MBeans should be registered.protected java.lang.StringgetObjectNameKeyProperties()Allow sub-classes to specify the key properties component of theObjectNamethat will be used to register this component.ContextTransactiongetTransaction()protected voidinitInternal()Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.voidremoveEjb(java.lang.String name)Remove any EJB resource reference with the specified name.voidremoveEnvironment(java.lang.String name)Remove any environment entry with the specified name.voidremoveLocalEjb(java.lang.String name)Remove any local EJB resource reference with the specified name.voidremoveMessageDestinationRef(java.lang.String name)Remove any message destination reference with the specified name.voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)Remove a property change listener from this component.voidremoveResource(java.lang.String name)Remove any resource reference with the specified name.voidremoveResourceEnvRef(java.lang.String name)Remove any resource environment reference with the specified name.voidremoveResourceLink(java.lang.String name)Remove any resource link with the specified name.voidremoveService(java.lang.String name)Remove any web service reference with the specified name.voidsetContainer(java.lang.Object container)Set the container with which the naming resources are associated.voidsetTransaction(ContextTransaction transaction)Set the transaction object.protected voidstartInternal()Sub-classes must ensure that the state is changed toLifecycleState.STARTINGduring the execution of this method.protected voidstopInternal()Sub-classes must ensure that the state is changed toLifecycleState.STOPPINGduring the execution of this method.- 
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBasegetDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregister
 - 
Methods inherited from class org.apache.catalina.util.LifecycleBaseaddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
 
- 
 
- 
- 
- 
Method Detail- 
getContainerpublic java.lang.Object getContainer() - Specified by:
- getContainerin interface- NamingResources
- Returns:
- the container with which the naming resources are associated.
 
 - 
setContainerpublic void setContainer(java.lang.Object container) Set the container with which the naming resources are associated.- Parameters:
- container- the associated with the resources
 
 - 
setTransactionpublic void setTransaction(ContextTransaction transaction) Set the transaction object.- Parameters:
- transaction- the transaction descriptor
 
 - 
getTransactionpublic ContextTransaction getTransaction() - Returns:
- the transaction object.
 
 - 
addEjbpublic void addEjb(ContextEjb ejb) Add an EJB resource reference for this web application.- Parameters:
- ejb- New EJB resource reference
 
 - 
addEnvironmentpublic void addEnvironment(ContextEnvironment environment) Add an environment entry for this web application.- Specified by:
- addEnvironmentin interface- NamingResources
- Parameters:
- environment- New environment entry
 
 - 
addLocalEjbpublic void addLocalEjb(ContextLocalEjb ejb) Add a local EJB resource reference for this web application.- Parameters:
- ejb- New EJB resource reference
 
 - 
addMessageDestinationRefpublic void addMessageDestinationRef(MessageDestinationRef mdr) Add a message destination reference for this web application.- Parameters:
- mdr- New message destination reference
 
 - 
addPropertyChangeListenerpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener) Add a property change listener to this component.- Parameters:
- listener- The listener to add
 
 - 
addResourcepublic void addResource(ContextResource resource) Add a resource reference for this web application.- Specified by:
- addResourcein interface- NamingResources
- Parameters:
- resource- New resource reference
 
 - 
addResourceEnvRefpublic void addResourceEnvRef(ContextResourceEnvRef resource) Add a resource environment reference for this web application.- Parameters:
- resource- The resource
 
 - 
addResourceLinkpublic void addResourceLink(ContextResourceLink resourceLink) Add a resource link for this web application.- Specified by:
- addResourceLinkin interface- NamingResources
- Parameters:
- resourceLink- New resource link
 
 - 
addServicepublic void addService(ContextService service) Add a web service reference for this web application.- Parameters:
- service- New web service reference
 
 - 
findEjbpublic ContextEjb findEjb(java.lang.String name) - Parameters:
- name- Name of the desired EJB resource reference
- Returns:
- the EJB resource reference with the specified name, if any; otherwise, return null.
 
 - 
findEjbspublic ContextEjb[] findEjbs() - Returns:
- the defined EJB resource references for this application. If there are none, a zero-length array is returned.
 
 - 
findEnvironmentpublic ContextEnvironment findEnvironment(java.lang.String name) - Parameters:
- name- Name of the desired environment entry
- Returns:
- the environment entry with the specified name, if any; otherwise, return null.
 
 - 
findEnvironmentspublic ContextEnvironment[] findEnvironments() - Returns:
- the set of defined environment entries for this web application. If none have been defined, a zero-length array is returned.
 
 - 
findLocalEjbpublic ContextLocalEjb findLocalEjb(java.lang.String name) - Parameters:
- name- Name of the desired EJB resource reference
- Returns:
- the local EJB resource reference with the specified name, if any; otherwise, return null.
 
 - 
findLocalEjbspublic ContextLocalEjb[] findLocalEjbs() - Returns:
- the defined local EJB resource references for this application. If there are none, a zero-length array is returned.
 
 - 
findMessageDestinationRefpublic MessageDestinationRef findMessageDestinationRef(java.lang.String name) - Parameters:
- name- Name of the desired message destination reference
- Returns:
- the message destination reference with the specified name, if any; otherwise, return null.
 
 - 
findMessageDestinationRefspublic MessageDestinationRef[] findMessageDestinationRefs() - Returns:
- the defined message destination references for this application. If there are none, a zero-length array is returned.
 
 - 
findResourcepublic ContextResource findResource(java.lang.String name) - Parameters:
- name- Name of the desired resource reference
- Returns:
- the resource reference with the specified name, if any; otherwise return null.
 
 - 
findResourceLinkpublic ContextResourceLink findResourceLink(java.lang.String name) - Parameters:
- name- Name of the desired resource link
- Returns:
- the resource link with the specified name, if any; otherwise return null.
 
 - 
findResourceLinkspublic ContextResourceLink[] findResourceLinks() - Returns:
- the defined resource links for this application. If none have been defined, a zero-length array is returned.
 
 - 
findResourcespublic ContextResource[] findResources() - Returns:
- the defined resource references for this application. If none have been defined, a zero-length array is returned.
 
 - 
findResourceEnvRefpublic ContextResourceEnvRef findResourceEnvRef(java.lang.String name) - Parameters:
- name- Name of the desired resource environment reference
- Returns:
- the resource environment reference type for the specified name, if any; otherwise return
             null.
 
 - 
findResourceEnvRefspublic ContextResourceEnvRef[] findResourceEnvRefs() - Returns:
- the set of resource environment reference names for this web application. If none have been specified, a zero-length array is returned.
 
 - 
findServicepublic ContextService findService(java.lang.String name) - Parameters:
- name- Name of the desired web service
- Returns:
- the web service reference for the specified name, if any; otherwise return null.
 
 - 
findServicespublic ContextService[] findServices() - Returns:
- the defined web service references for this application. If none have been defined, a zero-length array is returned.
 
 - 
removeEjbpublic void removeEjb(java.lang.String name) Remove any EJB resource reference with the specified name.- Parameters:
- name- Name of the EJB resource reference to remove
 
 - 
removeEnvironmentpublic void removeEnvironment(java.lang.String name) Remove any environment entry with the specified name.- Specified by:
- removeEnvironmentin interface- NamingResources
- Parameters:
- name- Name of the environment entry to remove
 
 - 
removeLocalEjbpublic void removeLocalEjb(java.lang.String name) Remove any local EJB resource reference with the specified name.- Parameters:
- name- Name of the EJB resource reference to remove
 
 - 
removeMessageDestinationRefpublic void removeMessageDestinationRef(java.lang.String name) Remove any message destination reference with the specified name.- Parameters:
- name- Name of the message destination resource reference to remove
 
 - 
removePropertyChangeListenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener) Remove a property change listener from this component.- Parameters:
- listener- The listener to remove
 
 - 
removeResourcepublic void removeResource(java.lang.String name) Remove any resource reference with the specified name.- Specified by:
- removeResourcein interface- NamingResources
- Parameters:
- name- Name of the resource reference to remove
 
 - 
removeResourceEnvRefpublic void removeResourceEnvRef(java.lang.String name) Remove any resource environment reference with the specified name.- Parameters:
- name- Name of the resource environment reference to remove
 
 - 
removeResourceLinkpublic void removeResourceLink(java.lang.String name) Remove any resource link with the specified name.- Specified by:
- removeResourceLinkin interface- NamingResources
- Parameters:
- name- Name of the resource link to remove
 
 - 
removeServicepublic void removeService(java.lang.String name) Remove any web service reference with the specified name.- Parameters:
- name- Name of the web service reference to remove
 
 - 
initInternalprotected void initInternal() throws LifecycleExceptionDescription copied from class:LifecycleMBeanBaseSub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.- Overrides:
- initInternalin class- LifecycleMBeanBase
- Throws:
- LifecycleException- If the initialisation fails
 
 - 
startInternalprotected void startInternal() throws LifecycleExceptionDescription copied from class:LifecycleBaseSub-classes must ensure that the state is changed toLifecycleState.STARTINGduring the execution of this method. Changing state will trigger theLifecycle.START_EVENTevent. If a component fails to start it may either throw aLifecycleExceptionwhich will cause it's parent to fail to start or it can place itself in the error state in which caseLifecycleBase.stop()will be called on the failed component but the parent component will continue to start normally.- Specified by:
- startInternalin class- LifecycleBase
- Throws:
- LifecycleException- Start error occurred
 
 - 
stopInternalprotected void stopInternal() throws LifecycleExceptionDescription copied from class:LifecycleBaseSub-classes must ensure that the state is changed toLifecycleState.STOPPINGduring the execution of this method. Changing state will trigger theLifecycle.STOP_EVENTevent.- Specified by:
- stopInternalin class- LifecycleBase
- Throws:
- LifecycleException- Stop error occurred
 
 - 
destroyInternalprotected void destroyInternal() throws LifecycleExceptionDescription copied from class:LifecycleMBeanBaseSub-classes wishing to perform additional clean-up should override this method, ensuring that super.destroyInternal() is the last call in the overriding method.- Overrides:
- destroyInternalin class- LifecycleMBeanBase
- Throws:
- LifecycleException- If the destruction fails
 
 - 
getDomainInternalprotected java.lang.String getDomainInternal() Description copied from class:LifecycleMBeanBaseMethod implemented by sub-classes to identify the domain in which MBeans should be registered.- Specified by:
- getDomainInternalin class- LifecycleMBeanBase
- Returns:
- The name of the domain to use to register MBeans.
 
 - 
getObjectNameKeyPropertiesprotected java.lang.String getObjectNameKeyProperties() Description copied from class:LifecycleMBeanBaseAllow sub-classes to specify the key properties component of theObjectNamethat will be used to register this component.- Specified by:
- getObjectNameKeyPropertiesin class- LifecycleMBeanBase
- Returns:
- The string representation of the key properties component of the
          desired ObjectName
 
 
- 
 
-