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 Log |
logger |
protected String |
name
Name of the associated naming context.
|
protected NamingContext |
namingContext
Associated JNDI context.
|
protected NamingResources |
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 |
getCompContext()
Deprecated.
|
Context |
getEnvContext()
Return the env context.
|
boolean |
getExceptionOnFailedWrite()
Returns whether or not an attempt to modify the JNDI context will trigger
an exception or if the request will be ignored.
|
String |
getName()
Return the "name" property.
|
NamingContext |
getNamingContext()
Deprecated.
|
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 Log logger
protected String name
protected Object container
protected boolean initialized
protected NamingResources 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 name@Deprecated public Context getCompContext()
public Context getEnvContext()
@Deprecated public NamingContext getNamingContext()
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)
public void addEnvironment(ContextEnvironment env)
public 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)
public void addResource(ContextResource resource)
public void addResourceEnvRef(ContextResourceEnvRef resourceEnvRef)
public void addResourceLink(ContextResourceLink resourceLink)
public void removeEjb(String name)
public void removeEnvironment(String name)
public void removeLocalEjb(String name)
public 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)
public void removeResourceEnvRef(String name)
name
- the name of the resource environment reference which should
be removedpublic void removeResourceLink(String name)
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.