Helper class used to initialize and populate the JNDI context associated
with each context and server.
compCtx
protected javax.naming.Context compCtx
Comp context.
container
protected Object container
Associated container.
debug
protected int debug
Debugging level.
envCtx
protected javax.naming.Context envCtx
Env context.
initialized
protected boolean initialized
Initialized flag.
name
protected String name
Name of the associated naming context.
namingContext
protected NamingContext namingContext
Associated JNDI context.
namingResources
protected NamingResources namingResources
Associated naming resources.
sm
protected static StringManager sm
The string manager for this package.
addEjb
public void addEjb(ContextEjb ejb)
Set the specified EJBs in the naming context.
addEnvironment
public void addEnvironment(ContextEnvironment env)
Set the specified environment entries in the naming context.
addLocalEjb
public void addLocalEjb(ContextLocalEjb localEjb)
Set the specified local EJBs in the naming context.
addResource
public void addResource(ContextResource resource)
Set the specified resources in the naming context.
addResourceEnvRef
public void addResourceEnvRef(String name,
String type)
Set the specified resources in the naming context.
addResourceLink
public void addResourceLink(ContextResourceLink resourceLink)
Set the specified resource link in the naming context.
containerEvent
public void containerEvent(ContainerEvent event)
Acknowledge the occurrence of the specified event.
Note: Will never be called when the listener is associated to a Server,
since it is not a Container.
- containerEvent in interface ContainerListener
event
- ContainerEvent that has occurred
getDebug
public int getDebug()
Return the "debug" property.
getName
public String getName()
Return the "name" property.
getNamingContext
public NamingContext getNamingContext()
Return the associated naming context.
log
protected void log(String message)
Log the specified message to our current Logger (if any).
message
- Message to be logged
log
protected void log(String message,
Throwable throwable)
Log the specified message and exception to our current Logger
(if any).
message
- Message to be loggedthrowable
- Related exception
logName
protected String logName()
Return the abbreviated name of this container for logging messsages
propertyChange
public void propertyChange(PropertyChangeEvent event)
Process property change events. Currently, only listens to such events
on the NamingResources
instance for the global naming
resources.
event
- The property change event that has occurred
removeEjb
public void removeEjb(String name)
Set the specified EJBs in the naming context.
removeEnvironment
public void removeEnvironment(String name)
Set the specified environment entries in the naming context.
removeLocalEjb
public void removeLocalEjb(String name)
Set the specified local EJBs in the naming context.
removeResource
public void removeResource(String name)
Set the specified resources in the naming context.
removeResourceEnvRef
public void removeResourceEnvRef(String name)
Set the specified resources in the naming context.
removeResourceLink
public void removeResourceLink(String name)
Set the specified resources in the naming context.
setDebug
public void setDebug(int debug)
Set the "debug" property.
debug
- The new debug level
setName
public void setName(String name)
Set the "name" property.
name
- The new name