public class NamingContextListener extends Object implements LifecycleListener, ContainerListener, PropertyChangeListener
Modifier and Type | Field and Description |
---|---|
protected Context |
compCtx
Comp context.
|
protected Object |
container
Associated container.
|
protected Context |
envCtx
Env context.
|
protected boolean |
initialized
Initialized flag.
|
protected String |
name
Name of the associated naming context.
|
protected NamingContext |
namingContext
Associated JNDI context.
|
protected NamingResourcesImpl |
namingResources
Associated naming resources.
|
protected HashMap<String,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 ObjectName |
createObjectName(ContextResource resource)
Create an
ObjectName for this
ContextResource object. |
Context |
getEnvContext() |
boolean |
getExceptionOnFailedWrite() |
String |
getName() |
void |
lifecycleEvent(LifecycleEvent event)
Acknowledge the occurrence of the specified event.
|
void |
propertyChange(PropertyChangeEvent event)
Process property change events.
|
void |
removeEjb(String name)
Remove the specified EJB from the naming context.
|
void |
removeEnvironment(String name)
Remove the specified environment entry from the naming context.
|
void |
removeLocalEjb(String name)
Remove the specified local EJB from the naming context.
|
void |
removeMessageDestinationRef(String name)
Remove the specified message destination ref from the naming context.
|
void |
removeResource(String name)
Remove the specified resource from the naming context.
|
void |
removeResourceEnvRef(String name)
Remove the specified resource environment reference from the naming
context.
|
void |
removeResourceLink(String name)
Remove the specified resource link from the naming context.
|
void |
removeService(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(String name)
Set the "name" property.
|
protected String name
protected Object container
protected boolean initialized
protected NamingResourcesImpl namingResources
protected NamingContext namingContext
protected Context compCtx
protected Context envCtx
protected HashMap<String,ObjectName> objectNames
protected static final StringManager sm
public boolean getExceptionOnFailedWrite()
public void setExceptionOnFailedWrite(boolean exceptionOnFailedWrite)
exceptionOnFailedWrite
- The new valuepublic String getName()
public void setName(String name)
name
- The new namepublic 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(PropertyChangeEvent event)
propertyChange
in interface PropertyChangeListener
event
- The property change event that has occurredprotected ObjectName createObjectName(ContextResource resource) throws MalformedObjectNameException
ObjectName
for this
ContextResource
object.resource
- The resourceMalformedObjectNameException
- 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(String name)
name
- the name of the EJB which should be removedpublic void removeEnvironment(String name)
name
- the name of the environment entry which should be removedpublic void removeLocalEjb(String name)
name
- the name of the EJB which should be removedpublic void removeMessageDestinationRef(String name)
name
- the name of the message destination ref which should be
removedpublic void removeService(String name)
name
- the name of the web service which should be removedpublic void removeResource(String name)
name
- the name of the resource which should be removedpublic void removeResourceEnvRef(String name)
name
- the name of the resource environment reference which should
be removedpublic void removeResourceLink(String name)
name
- the name of the resource link which should be removedCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.