org.objectweb.jonas_lib.naming
Interface ContainerNaming

All Known Implementing Classes:
NamingManager

public interface ContainerNaming

Provide naming services for Web and EJB containers. Containers use this interface for binding the environment entries, remote object references, resource factories and for managing the naming context of the current thread.

Author:
Lutris

Method Summary
 javax.naming.Context createEnvironmentContext(java.lang.String namespace)
          Create context for application and component environments.
 javax.naming.Context createImmutableEnvironmentContext(java.lang.String namespace)
          Create immutable context for application and component environments.
 javax.naming.Context getComponentContext()
          Return the Context associated with the current thread.
 java.util.Hashtable getEnv()
          return the environment associated to this initial context
 javax.naming.InitialContext getInitialContext()
          Get the initial context
 javax.naming.Context setComponentContext(javax.naming.Context ctx)
          Aassociate this Context with the current thread.
 void setComponentContext(javax.naming.Context ctx, java.lang.ClassLoader cl)
          Associate the specified CompNamingContext with the given classloader.
 void unSetComponentContext(java.lang.ClassLoader cl)
          Remove the CompNamingContext associated with the given classloader.
 

Method Detail

createEnvironmentContext

public javax.naming.Context createEnvironmentContext(java.lang.String namespace)
                                              throws javax.naming.NamingException
Create context for application and component environments. Called by Web Container for each Web Application (as defined in web.xml). Called by EJB Container for each ejb component (as defined in ejb-jar.xml). The returned context provides an independent namespace for each components environment values, and resources.
Parameters:
namespace - Subcontext name(s) to create under Server Root. Usually consists of application name + component name.
 Examples:
 "App1/WebWar1" for Web Application
 "App1/EJBJar1/EJBName" for ejb in Enterprise Application.
 
Returns:
Naming context for component environment
Throws:
javax.naming.NamingException - If exception encountered creating namespace.

createImmutableEnvironmentContext

public javax.naming.Context createImmutableEnvironmentContext(java.lang.String namespace)
                                                       throws javax.naming.NamingException
Create immutable context for application and component environments. Called by Web Container for each Web Application (as defined in web.xml). Called by EJB Container for each ejb component (as defined in ejb-jar.xml). The returned context provides an independent namespace for each components environment values, and resources. This context must exist in the underlying name service. It must be previously created by an earlier deployment.
Parameters:
namespace - Subcontext name(s) to create under Server Root. Usually consists of application name + component name.
 Examples:
 "App1/WebWar1" for Web Application
 "App1/EJBJar1/EJBName" for ejb in Enterprise Application.
 
Returns:
Naming context for component environment
Throws:
javax.naming.NamingException - If context namespace does not exist.

getComponentContext

public javax.naming.Context getComponentContext()
Return the Context associated with the current thread.
Returns:
Context for current thread.

setComponentContext

public javax.naming.Context setComponentContext(javax.naming.Context ctx)
Aassociate this Context with the current thread. This method should be called in preinvoke/postinvoke and when we build the bean environment.
Parameters:
ctx - Context to associate with the current thread.
Returns:
Previous context setting for current thread.

setComponentContext

public void setComponentContext(javax.naming.Context ctx,
                                java.lang.ClassLoader cl)
Associate the specified CompNamingContext with the given classloader.
Parameters:
ctx - the context to associate to the classloader.
cl - the classloader which is bind to the context.

unSetComponentContext

public void unSetComponentContext(java.lang.ClassLoader cl)
Remove the CompNamingContext associated with the given classloader.
Parameters:
cl - the classloader which is bind to the context.

getInitialContext

public javax.naming.InitialContext getInitialContext()
Get the initial context

getEnv

public java.util.Hashtable getEnv()
return the environment associated to this initial context