public class NamingResourcesImpl extends LifecycleMBeanBase implements java.io.Serializable, NamingResources
Lifecycle.SingleUse
Modifier and Type | Field and Description |
---|---|
protected java.beans.PropertyChangeSupport |
support
The property change support for this component.
|
mserver
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 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(java.beans.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(java.lang.String name)
Return the EJB resource reference with the specified name, if any;
otherwise, return
null . |
ContextEjb[] |
findEjbs()
Return the defined EJB resource references for this application.
|
ContextEnvironment |
findEnvironment(java.lang.String name)
Return the environment entry with the specified name, if any;
otherwise, return
null . |
ContextEnvironment[] |
findEnvironments()
Return the set of defined environment entries for this web
application.
|
ContextLocalEjb |
findLocalEjb(java.lang.String name)
Return the local EJB resource reference with the specified name, if any;
otherwise, return
null . |
ContextLocalEjb[] |
findLocalEjbs()
Return the defined local EJB resource references for this application.
|
MessageDestinationRef |
findMessageDestinationRef(java.lang.String name)
Return the message destination reference with the specified name,
if any; otherwise, return
null . |
MessageDestinationRef[] |
findMessageDestinationRefs()
Return the defined message destination references for this application.
|
ContextResource |
findResource(java.lang.String name)
Return the resource reference with the specified name, if any;
otherwise return
null . |
ContextResourceEnvRef |
findResourceEnvRef(java.lang.String name)
Return the resource environment reference type for the specified
name, if any; otherwise return
null . |
ContextResourceEnvRef[] |
findResourceEnvRefs()
Return the set of resource environment reference names for this
web application.
|
ContextResourceLink |
findResourceLink(java.lang.String name)
Return the resource link with the specified name, if any;
otherwise return
null . |
ContextResourceLink[] |
findResourceLinks()
Return the defined resource links for this application.
|
ContextResource[] |
findResources()
Return the defined resource references for this application.
|
ContextService |
findService(java.lang.String name)
Return the web service reference for the specified
name, if any; otherwise return
null . |
ContextService[] |
findServices()
Return the defined web service references for this application.
|
java.lang.Object |
getContainer()
Get the container with which the naming resources are associated.
|
protected java.lang.String |
getDomainInternal()
Method implemented by sub-classes to identify the domain in which MBeans
should be registered.
|
protected java.lang.String |
getObjectNameKeyProperties()
Allow sub-classes to specify the key properties component of the
ObjectName that will be used to register this component. |
ContextTransaction |
getTransaction()
Get the transaction object.
|
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(java.lang.String name)
Remove any EJB resource reference with the specified name.
|
void |
removeEnvironment(java.lang.String name)
Remove any environment entry with the specified name.
|
void |
removeLocalEjb(java.lang.String name)
Remove any local EJB resource reference with the specified name.
|
void |
removeMessageDestinationRef(java.lang.String name)
Remove any message destination reference with the specified name.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this component.
|
void |
removeResource(java.lang.String name)
Remove any resource reference with the specified name.
|
void |
removeResourceEnvRef(java.lang.String name)
Remove any resource environment reference with the specified name.
|
void |
removeResourceLink(java.lang.String name)
Remove any resource link with the specified name.
|
void |
removeService(java.lang.String name)
Remove any web service reference with the specified name.
|
void |
setContainer(java.lang.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, unregister
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, init, removeLifecycleListener, setState, setState, start, stop
protected final java.beans.PropertyChangeSupport support
public NamingResourcesImpl()
public java.lang.Object getContainer()
getContainer
in interface NamingResources
public void setContainer(java.lang.Object container)
public void setTransaction(ContextTransaction transaction)
public ContextTransaction getTransaction()
public void addEjb(ContextEjb ejb)
ejb
- New EJB resource referencepublic void addEnvironment(ContextEnvironment environment)
addEnvironment
in interface NamingResources
environment
- New environment entrypublic void addLocalEjb(ContextLocalEjb ejb)
ejb
- New EJB resource referencepublic void addMessageDestinationRef(MessageDestinationRef mdr)
mdr
- New message destination referencepublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to addpublic void addResource(ContextResource resource)
addResource
in interface NamingResources
resource
- New resource referencepublic void addResourceEnvRef(ContextResourceEnvRef resource)
resource
- The resourcepublic void addResourceLink(ContextResourceLink resourceLink)
addResourceLink
in interface NamingResources
resourceLink
- New resource linkpublic void addService(ContextService service)
service
- New web service referencepublic ContextEjb findEjb(java.lang.String name)
null
.name
- Name of the desired EJB resource referencepublic ContextEjb[] findEjbs()
public ContextEnvironment findEnvironment(java.lang.String name)
null
.name
- Name of the desired environment entrypublic ContextEnvironment[] findEnvironments()
public ContextLocalEjb findLocalEjb(java.lang.String name)
null
.name
- Name of the desired EJB resource referencepublic ContextLocalEjb[] findLocalEjbs()
public MessageDestinationRef findMessageDestinationRef(java.lang.String name)
null
.name
- Name of the desired message destination referencepublic MessageDestinationRef[] findMessageDestinationRefs()
public ContextResource findResource(java.lang.String name)
null
.name
- Name of the desired resource referencepublic ContextResourceLink findResourceLink(java.lang.String name)
null
.name
- Name of the desired resource linkpublic ContextResourceLink[] findResourceLinks()
public ContextResource[] findResources()
public ContextResourceEnvRef findResourceEnvRef(java.lang.String name)
null
.name
- Name of the desired resource environment referencepublic ContextResourceEnvRef[] findResourceEnvRefs()
public ContextService findService(java.lang.String name)
null
.name
- Name of the desired web servicepublic ContextService[] findServices()
public void removeEjb(java.lang.String name)
name
- Name of the EJB resource reference to removepublic void removeEnvironment(java.lang.String name)
removeEnvironment
in interface NamingResources
name
- Name of the environment entry to removepublic void removeLocalEjb(java.lang.String name)
name
- Name of the EJB resource reference to removepublic void removeMessageDestinationRef(java.lang.String name)
name
- Name of the message destination resource reference to removepublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to removepublic void removeResource(java.lang.String name)
removeResource
in interface NamingResources
name
- Name of the resource reference to removepublic void removeResourceEnvRef(java.lang.String name)
name
- Name of the resource environment reference to removepublic void removeResourceLink(java.lang.String name)
removeResourceLink
in interface NamingResources
name
- Name of the resource link to removepublic void removeService(java.lang.String name)
name
- Name of the web service reference to removeprotected void initInternal() throws LifecycleException
LifecycleMBeanBase
initInternal
in class LifecycleMBeanBase
LifecycleException
protected void startInternal() throws LifecycleException
LifecycleBase
LifecycleState.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 LifecycleBase
LifecycleException
protected void stopInternal() throws LifecycleException
LifecycleBase
LifecycleState.STOPPING
during the execution of this method.
Changing state will trigger the Lifecycle.STOP_EVENT
event.stopInternal
in class LifecycleBase
LifecycleException
protected void destroyInternal() throws LifecycleException
LifecycleMBeanBase
destroyInternal
in class LifecycleMBeanBase
LifecycleException
protected java.lang.String getDomainInternal()
LifecycleMBeanBase
getDomainInternal
in class LifecycleMBeanBase
protected java.lang.String getObjectNameKeyProperties()
LifecycleMBeanBase
ObjectName
that will be used to register this component.getObjectNameKeyProperties
in class LifecycleMBeanBase
ObjectName
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.