public class NamingContextListener extends java.lang.Object implements LifecycleListener, ContainerListener, java.beans.PropertyChangeListener
Modifier and Type | Field and Description |
---|---|
protected javax.naming.Context |
compCtx
Comp context.
|
protected java.lang.Object |
container
Associated container.
|
protected javax.naming.Context |
envCtx
Env context.
|
protected boolean |
initialized
Initialized flag.
|
protected java.lang.String |
name
Name of the associated naming context.
|
protected NamingContext |
namingContext
Associated JNDI context.
|
protected NamingResourcesImpl |
namingResources
Associated naming resources.
|
protected java.util.HashMap<java.lang.String,javax.management.ObjectName> |
objectNames
Objectnames hashtable.
|
protected static StringManager |
sm
The string manager for this package.
|
Constructor and Description |
---|
NamingContextListener() |
Modifier and Type | Method and Description |
---|---|
void |
addEjb(ContextEjb ejb)
Set the specified EJBs in the naming context.
|
void |
addEnvironment(ContextEnvironment env)
Set the specified environment entries in the naming context.
|
void |
addLocalEjb(ContextLocalEjb localEjb)
Set the specified local EJBs in the naming context.
|
void |
addMessageDestinationRef(MessageDestinationRef mdr)
Set the specified message destination refs in the naming context.
|
void |
addResource(ContextResource resource)
Set the specified resources in the naming context.
|
void |
addResourceEnvRef(ContextResourceEnvRef resourceEnvRef)
Set the specified resources in the naming context.
|
void |
addResourceLink(ContextResourceLink resourceLink)
Set the specified resource link in the naming context.
|
void |
addService(ContextService service)
Set the specified web service in the naming context.
|
void |
containerEvent(ContainerEvent event)
Deprecated.
The
ContainerListener interface and implementing
methods will be removed from this class for Tomcat 10
onwards. |
protected javax.management.ObjectName |
createObjectName(ContextResource resource)
Create an
ObjectName for this
ContextResource object. |
javax.naming.Context |
getEnvContext() |
boolean |
getExceptionOnFailedWrite() |
java.lang.String |
getName() |
void |
lifecycleEvent(LifecycleEvent event)
Acknowledge the occurrence of the specified event.
|
void |
propertyChange(java.beans.PropertyChangeEvent event)
Process property change events.
|
void |
removeEjb(java.lang.String name)
Remove the specified EJB from the naming context.
|
void |
removeEnvironment(java.lang.String name)
Remove the specified environment entry from the naming context.
|
void |
removeLocalEjb(java.lang.String name)
Remove the specified local EJB from the naming context.
|
void |
removeMessageDestinationRef(java.lang.String name)
Remove the specified message destination ref from the naming context.
|
void |
removeResource(java.lang.String name)
Remove the specified resource from the naming context.
|
void |
removeResourceEnvRef(java.lang.String name)
Remove the specified resource environment reference from the naming
context.
|
void |
removeResourceLink(java.lang.String name)
Remove the specified resource link from the naming context.
|
void |
removeService(java.lang.String name)
Remove the specified web service from the naming context.
|
void |
setExceptionOnFailedWrite(boolean exceptionOnFailedWrite)
Controls whether or not an attempt to modify the JNDI context will
trigger an exception or if the request will be ignored.
|
void |
setName(java.lang.String name)
Set the "name" property.
|
protected java.lang.String name
protected java.lang.Object container
protected boolean initialized
protected NamingResourcesImpl namingResources
protected NamingContext namingContext
protected javax.naming.Context compCtx
protected javax.naming.Context envCtx
protected java.util.HashMap<java.lang.String,javax.management.ObjectName> objectNames
protected static final StringManager sm
public boolean getExceptionOnFailedWrite()
public void setExceptionOnFailedWrite(boolean exceptionOnFailedWrite)
exceptionOnFailedWrite
- The new valuepublic java.lang.String getName()
public void setName(java.lang.String name)
name
- The new namepublic javax.naming.Context getEnvContext()
public void lifecycleEvent(LifecycleEvent event)
lifecycleEvent
in interface LifecycleListener
event
- LifecycleEvent that has occurred@Deprecated public void containerEvent(ContainerEvent event)
ContainerListener
interface and implementing
methods will be removed from this class for Tomcat 10
onwards.containerEvent
in interface ContainerListener
event
- ContainerEvent that has occurredpublic void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
event
- The property change event that has occurredprotected javax.management.ObjectName createObjectName(ContextResource resource) throws javax.management.MalformedObjectNameException
ObjectName
for this
ContextResource
object.resource
- The resourcejavax.management.MalformedObjectNameException
- if a name cannot be createdpublic void addEjb(ContextEjb ejb)
ejb
- the EJB descriptorpublic void addEnvironment(ContextEnvironment env)
env
- the environment entrypublic void addLocalEjb(ContextLocalEjb localEjb)
localEjb
- the local EJB descriptor (unused)public void addMessageDestinationRef(MessageDestinationRef mdr)
mdr
- the message destination ref descriptor (unused)public void addService(ContextService service)
service
- the web service descriptorpublic void addResource(ContextResource resource)
resource
- the resource descriptorpublic void addResourceEnvRef(ContextResourceEnvRef resourceEnvRef)
resourceEnvRef
- the resource referencepublic void addResourceLink(ContextResourceLink resourceLink)
resourceLink
- the resource linkpublic void removeEjb(java.lang.String name)
name
- the name of the EJB which should be removedpublic void removeEnvironment(java.lang.String name)
name
- the name of the environment entry which should be removedpublic void removeLocalEjb(java.lang.String name)
name
- the name of the EJB which should be removedpublic void removeMessageDestinationRef(java.lang.String name)
name
- the name of the message destination ref which should be
removedpublic void removeService(java.lang.String name)
name
- the name of the web service which should be removedpublic void removeResource(java.lang.String name)
name
- the name of the resource which should be removedpublic void removeResourceEnvRef(java.lang.String name)
name
- the name of the resource environment reference which should
be removedpublic void removeResourceLink(java.lang.String name)
name
- the name of the resource link which should be removedCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.