org.gxos
Class ContextManager

java.lang.Object
  |
  +--org.gxos.ContextManager

public class ContextManager
extends java.lang.Object

Provides all the functionality needed for context management for GXOS such as initialization, root context creation, etc.

$Id: ContextManager.java,v 1.3 2001/05/01 14:34:13 balsoy Exp $


Constructor Summary
ContextManager()
           
 
Method Summary
static RootContext createRootContext(java.lang.String rootName)
          This function returns the root context, i.e.
static GxContext getContext()
          Returns the initial context for the context manager.
static RootContext getRootContext(java.lang.String rootName)
          This function returns the root context, i.e.
static GxContext initialize(java.util.Hashtable env)
          Initializes the context manages with the given environment settings.
static void setContext(GxContext ctx)
          Sets initial context for the context manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextManager

public ContextManager()
Method Detail

getContext

public static GxContext getContext()

Returns the initial context for the context manager.

Returns:
the initial context for the context manager.

setContext

public static void setContext(GxContext ctx)

Sets initial context for the context manager. This holds "//" context.

Parameters:
ctx - Initial GXOS context.

initialize

public static GxContext initialize(java.util.Hashtable env)
                            throws javax.naming.NamingException

Initializes the context manages with the given environment settings.

Throws:
javax.naming.NamingException - if a naming error is encountered.

createRootContext

public static RootContext createRootContext(java.lang.String rootName)
                                     throws javax.naming.NamingException

This function returns the root context, i.e. //GlobalRoot, //Education. If it does not exist, it creates a new one as well as other predefined subcontexts such as Admin, Documents, Events, etc.

Parameters:
rootName - Name for the root, i.e. Education, //University, //Education/University/CSDepartment
Returns:
context for the root object.
Throws:
javax.naming.NamingException - if a root context cannot be created or any other naming error is encountered.

getRootContext

public static RootContext getRootContext(java.lang.String rootName)
                                  throws javax.naming.NamingException

This function returns the root context, i.e. //GlobalRoot, //Education.

Parameters:
rootName - Name for the root, i.e. Education, //University, //Education/University/CSDepartment
Returns:
Context for the root object.
Throws:
NameNotFoundException - if the root context does not exist
javax.naming.NamingException - if any other naming error is encountered.