Class NamingResourcesImpl
java.lang.Object
org.apache.catalina.util.LifecycleBase
org.apache.catalina.util.LifecycleMBeanBase
org.apache.catalina.deploy.NamingResourcesImpl
- All Implemented Interfaces:
Serializable, MBeanRegistration, JmxEnabled, Lifecycle, NamingResources
public class NamingResourcesImpl
extends LifecycleMBeanBase
implements Serializable, NamingResources
Holds and manages the naming resources defined in the Jakarta EE Naming Context and their associated JNDI context.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface Lifecycle
Lifecycle.SingleUse -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PropertyChangeSupportThe property change support for this component.Fields inherited from interface Lifecycle
AFTER_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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEjb(ContextEjb ejb) Add an EJB resource reference for this web application.voidaddEnvironment(ContextEnvironment environment) Add an environment entry for this web application.voidAdd a local EJB resource reference for this web application.voidAdd a message destination reference for this web application.voidAdd 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 voidSubclasses implement this method to perform any instance destruction required.Return the EJB resource reference with the specified name.findEjbs()Return the defined EJB resource references for this application.findEnvironment(String name) Return the environment entry with the specified name.Return the array of defined environment entries for this web application.findLocalEjb(String name) Return the local EJB resource reference with the specified name.Return the defined local EJB resource references for this application.Return the message destination reference with the specified name.Return the defined message destination references for this application.findResource(String name) Return the resource reference with the specified name.findResourceEnvRef(String name) Return the resource environment reference type for the specified name.Return the array of resource environment reference names for this web application.findResourceLink(String name) Return the resource link with the specified name.Return the defined resource links for this application.Return the defined resource references for this application.findService(String name) Return the web service reference for the specified name.Return the defined web service references for this application.Returns the container with which the naming resources are associated.protected StringMethod implemented by subclasses to identify the domain in which MBeans should be registered.protected StringAllow subclasses to specify the key properties component of theObjectNamethat will be used to register this component.Return the transaction object.protected voidSubclasses implement this method to perform any instance initialisation required.voidRemove any EJB resource reference with the specified name.voidremoveEnvironment(String name) Remove any environment entry with the specified name.voidremoveLocalEjb(String name) Remove any local EJB resource reference with the specified name.voidRemove any message destination reference with the specified name.voidRemove a property change listener from this component.voidremoveResource(String name) Remove any resource reference with the specified name.voidremoveResourceEnvRef(String name) Remove any resource environment reference with the specified name.voidremoveResourceLink(String name) Remove any resource link with the specified name.voidremoveService(String name) Remove any web service reference with the specified name.voidsetContainer(Object container) Set the container with which the naming resources are associated.voidsetTransaction(ContextTransaction transaction) Set the transaction object.protected voidSubclasses must ensure that the state is changed toLifecycleState.STARTINGduring the execution of this method.protected voidSubclasses must ensure that the state is changed toLifecycleState.STOPPINGduring the execution of this method.Methods inherited from class LifecycleMBeanBase
getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregisterMethods inherited from class LifecycleBase
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
-
Field Details
-
support
The property change support for this component.
-
-
Constructor Details
-
NamingResourcesImpl
public NamingResourcesImpl()Create a new NamingResources instance.
-
-
Method Details
-
getContainer
Description copied from interface:NamingResourcesReturns the container with which the naming resources are associated.- Specified by:
getContainerin interfaceNamingResources- Returns:
- the container with which the naming resources are associated
-
setContainer
Set the container with which the naming resources are associated.- Parameters:
container- the associated with the resources
-
setTransaction
Set the transaction object.- Parameters:
transaction- the transaction descriptor
-
getTransaction
Return the transaction object.- Returns:
- the transaction object
-
addEjb
Add an EJB resource reference for this web application.- Parameters:
ejb- New EJB resource reference
-
addEnvironment
Description copied from interface:NamingResourcesAdd an environment entry for this web application.- Specified by:
addEnvironmentin interfaceNamingResources- Parameters:
environment- New environment entry
-
addLocalEjb
Add a local EJB resource reference for this web application.- Parameters:
ejb- New EJB resource reference
-
addMessageDestinationRef
Add a message destination reference for this web application.- Parameters:
mdr- New message destination reference
-
addPropertyChangeListener
Add a property change listener to this component.- Parameters:
listener- The listener to add
-
addResource
Description copied from interface:NamingResourcesAdd a resource reference for this web application.- Specified by:
addResourcein interfaceNamingResources- Parameters:
resource- New resource reference
-
addResourceEnvRef
Add a resource environment reference for this web application.- Parameters:
resource- The resource
-
addResourceLink
Description copied from interface:NamingResourcesAdd a resource link for this web application.- Specified by:
addResourceLinkin interfaceNamingResources- Parameters:
resourceLink- New resource link
-
addService
Add a web service reference for this web application.- Parameters:
service- New web service reference
-
findEjb
Return the EJB resource reference with the specified name.- Parameters:
name- Name of the desired EJB resource reference- Returns:
- the EJB resource reference, or
nullif not found
-
findEjbs
Return the defined EJB resource references for this application.- Returns:
- the EJB resource references, or a zero-length array if none
-
findEnvironment
Return the environment entry with the specified name.- Parameters:
name- Name of the desired environment entry- Returns:
- the environment entry, or
nullif not found
-
findEnvironments
Return the array of defined environment entries for this web application.- Returns:
- the environment entries, or a zero-length array if none
-
findLocalEjb
Return the local EJB resource reference with the specified name.- Parameters:
name- Name of the desired EJB resource reference- Returns:
- the local EJB resource reference, or
nullif not found
-
findLocalEjbs
Return the defined local EJB resource references for this application.- Returns:
- the local EJB resource references, or a zero-length array if none
-
findMessageDestinationRef
Return the message destination reference with the specified name.- Parameters:
name- Name of the desired message destination reference- Returns:
- the message destination reference, or
nullif not found
-
findMessageDestinationRefs
Return the defined message destination references for this application.- Returns:
- the message destination references, or a zero-length array if none
-
findResource
Return the resource reference with the specified name.- Parameters:
name- Name of the desired resource reference- Returns:
- the resource reference, or
nullif not found
-
findResourceLink
Return the resource link with the specified name.- Parameters:
name- Name of the desired resource link- Returns:
- the resource link, or
nullif not found
-
findResourceLinks
Return the defined resource links for this application.- Returns:
- the resource links, or a zero-length array if none
-
findResources
Return the defined resource references for this application.- Returns:
- the resource references, or a zero-length array if none
-
findResourceEnvRef
Return the resource environment reference type for the specified name.- Parameters:
name- Name of the desired resource environment reference- Returns:
- the resource environment reference, or
nullif not found
-
findResourceEnvRefs
Return the array of resource environment reference names for this web application.- Returns:
- the resource environment references, or a zero-length array if none
-
findService
Return the web service reference for the specified name.- Parameters:
name- Name of the desired web service- Returns:
- the web service reference, or
nullif not found
-
findServices
Return the defined web service references for this application.- Returns:
- the web service references, or a zero-length array if none
-
removeEjb
Remove any EJB resource reference with the specified name.- Parameters:
name- Name of the EJB resource reference to remove
-
removeEnvironment
Description copied from interface:NamingResourcesRemove any environment entry with the specified name.- Specified by:
removeEnvironmentin interfaceNamingResources- Parameters:
name- Name of the environment entry to remove
-
removeLocalEjb
Remove any local EJB resource reference with the specified name.- Parameters:
name- Name of the EJB resource reference to remove
-
removeMessageDestinationRef
Remove any message destination reference with the specified name.- Parameters:
name- Name of the message destination resource reference to remove
-
removePropertyChangeListener
Remove a property change listener from this component.- Parameters:
listener- The listener to remove
-
removeResource
Description copied from interface:NamingResourcesRemove any resource reference with the specified name.- Specified by:
removeResourcein interfaceNamingResources- Parameters:
name- Name of the resource reference to remove
-
removeResourceEnvRef
Remove any resource environment reference with the specified name.- Parameters:
name- Name of the resource environment reference to remove
-
removeResourceLink
Description copied from interface:NamingResourcesRemove any resource link with the specified name.- Specified by:
removeResourceLinkin interfaceNamingResources- Parameters:
name- Name of the resource link to remove
-
removeService
Remove any web service reference with the specified name.- Parameters:
name- Name of the web service reference to remove
-
initInternal
Description copied from class:LifecycleBaseSubclasses implement this method to perform any instance initialisation required.- Overrides:
initInternalin classLifecycleMBeanBase- Throws:
LifecycleException- If the initialisation fails
-
startInternal
Description copied from class:LifecycleBaseSubclasses 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 classLifecycleBase- Throws:
LifecycleException- Start error occurred
-
stopInternal
Description copied from class:LifecycleBaseSubclasses must ensure that the state is changed toLifecycleState.STOPPINGduring the execution of this method. Changing state will trigger theLifecycle.STOP_EVENTevent.- Specified by:
stopInternalin classLifecycleBase- Throws:
LifecycleException- Stop error occurred
-
destroyInternal
Description copied from class:LifecycleBaseSubclasses implement this method to perform any instance destruction required.- Overrides:
destroyInternalin classLifecycleMBeanBase- Throws:
LifecycleException- If the destruction fails
-
getDomainInternal
Description copied from class:LifecycleMBeanBaseMethod implemented by subclasses to identify the domain in which MBeans should be registered.- Specified by:
getDomainInternalin classLifecycleMBeanBase- Returns:
- The name of the domain to use to register MBeans.
-
getObjectNameKeyProperties
Description copied from class:LifecycleMBeanBaseAllow subclasses to specify the key properties component of theObjectNamethat will be used to register this component.- Specified by:
getObjectNameKeyPropertiesin classLifecycleMBeanBase- Returns:
- The string representation of the key properties component of the desired
ObjectName
-