jrun.naming
Class ContextManager

jrunx.kernel.ServiceAdapter
  |
  +--jrunx.kernel.ServicePartition
        |
        +--jrunx.kernel.ConfigurableServicePartition
              |
              +--jrunx.cluster.ClusterableServiceAdapter
                    |
                    +--jrun.naming.ContextManager
All Implemented Interfaces:
ClusterableService, ClusterableServiceAdapterMBean, ClusterConstants, ConfigurableServicePartitionMBean, ContextProxy, javax.naming.Referenceable, java.rmi.Remote, java.io.Serializable, Service, ServiceMBean, ServicePartitionMBean

public class ContextManager
extends ClusterableServiceAdapter
implements ContextProxy, ClusterableService

The ContextManager handles the actual manipulation of objects and names in a specific Context. It is NOT a NamingContext implementation, and should not be used directly as such a Context. Instead, this object is used as a proxy (notice it implements ContextProxy) by the NamingContext implementation.

ContextManagers are assigned to a NamingContext both locally and remotely. The ContextManager is exported via rmi-iiop to be available remotely, and is set as a direct reference for local access. Whether the local ContextManager is returned is a decision for JRunNamingContext, which uses the NamingConstants.JRUN_JNDI_LOCAL property as a basis for the decision.

Since this Class is designed to be exported as a PorableRemoteObject, an rmic stub is generated for it in the JRun build process.

Author:
PS Neville
See Also:
Serialized Form

Field Summary
static java.lang.String OBJECT_NAME
           
 
Fields inherited from class jrunx.cluster.ClusterableServiceAdapter
clientSocketFactoryName, defaultAlgorithm, myHost, myIP, myPeers, myStub, port, serverSocketFactoryName
 
Fields inherited from class jrunx.kernel.ServicePartition
sortedServices
 
Fields inherited from class jrunx.kernel.ServiceAdapter
DEFAULT_DEACTIVATED, DEFAULT_DOMAIN, DOMAIN_NAME_SEPARATOR, DOMAIN_NAME_SUFFIX, domainName, jndiBindable, LOGGER_CACHE_TIME, SCHEDULER_SERVICE, SECURITY_MANAGER, server, status, TRANSACTION_MANAGER
 
Fields inherited from interface jrunx.kernel.Service
INITIALIZED, STARTED, STARTING, STOPPED, STOPPING, UNINITIALIZED
 
Fields inherited from interface jrunx.cluster.ClusterConstants
AVAILABLE_SERVICES, CLUSTER_MANAGER_JNDI, DEFAULT_CLUSTER_DOMAIN, DEFAULT_ENABLED, JINI_CODE_BASE_JAR, PRIMARY_SERVICE, SECONDARY_SERVICE
 
Constructor Summary
ContextManager()
           
ContextManager(javax.naming.Name prefix, ContextManager parent)
           
 
Method Summary
 void bind(javax.naming.Name name, java.lang.Object obj, java.lang.String className)
           
 javax.naming.Context createSubcontext(javax.naming.Name name, java.util.Hashtable env)
           
 java.lang.String getIIOPProviderURL()
           
 ContextProxy getRoot()
           
 java.rmi.dgc.VMID getVMID()
           
 java.util.Collection list(javax.naming.Name name)
           
 java.util.Collection listBindings(javax.naming.Name name)
           
 java.lang.Object lookup(javax.naming.Name name)
           
 void rebind(javax.naming.Name name, java.lang.Object obj, java.lang.String className)
           
 void setIIOPProviderURL(java.lang.String prefix)
           
 java.lang.String toString()
           
 void unbind(javax.naming.Name name)
           
 
Methods inherited from class jrunx.cluster.ClusterableServiceAdapter
addPeerListener, addServersToClients, destroy, getClientSocketFactory, getClusterAlgorithm, getPeers, getPort, getRemoteHostIP, getRemoteHostName, getRemoteServerName, getServerInfo, getServerSocketFactoryClass, init, invoke, isValidPeer, killRemoteServer, numPeers, setClientSocketFactoryClass, setClusterAlgorithm, setPort, setServerSocketFactoryClass, start, stop, toStub
 
Methods inherited from class jrunx.kernel.ConfigurableServicePartition
destroyServices, initServices, loadAndInit, loadChildren, setChildElements, startServices, stopServices
 
Methods inherited from class jrunx.kernel.ServicePartition
addService, addService, getServices, invokeChain, iterator, removeService, removeService
 
Methods inherited from class jrunx.kernel.ServiceAdapter
bind, findObjectInstance, findObjectInstance, findObjectInstance, getBindToJNDI, getDeactivated, getDomainName, getDomainSearchPath, getJRunService, getLogger, getName, getParentService, getReference, getResourceManager, getServerName, getServerProperties, getStatus, invokeMethod, isInPartition, isPartition, lookup, postDeregister, postRegister, preDeregister, preRegister, requestServer, scheduleRunnable, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, unbind, unscheduleRunnable, updateStatus
 
Methods inherited from interface jrunx.cluster.ClusterableService
getPeers, getRemoteHostIP, getRemoteHostName, getRemoteServerName, getServerInfo, invoke, killRemoteServer, numPeers, toStub
 
Methods inherited from interface jrunx.kernel.ConfigurableServicePartitionMBean
setChildElements
 
Methods inherited from interface jrunx.kernel.ServicePartitionMBean
addService, addService, iterator, removeService, removeService
 
Methods inherited from interface jrunx.kernel.ServiceMBean
bind, getBindToJNDI, getDeactivated, getDomainName, getJRunService, getLogger, getName, getParentService, getServerName, requestServer, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, unbind
 
Methods inherited from interface jrunx.kernel.Service
getStatus, updateStatus
 

Field Detail

OBJECT_NAME

public static final java.lang.String OBJECT_NAME
Constructor Detail

ContextManager

public ContextManager()
               throws javax.naming.NamingException

ContextManager

public ContextManager(javax.naming.Name prefix,
                      ContextManager parent)
               throws javax.naming.NamingException
Method Detail

getIIOPProviderURL

public java.lang.String getIIOPProviderURL()
                                    throws java.rmi.RemoteException
Specified by:
getIIOPProviderURL in interface ContextProxy

setIIOPProviderURL

public void setIIOPProviderURL(java.lang.String prefix)

getVMID

public java.rmi.dgc.VMID getVMID()
                          throws java.rmi.RemoteException
Specified by:
getVMID in interface ContextProxy

bind

public void bind(javax.naming.Name name,
                 java.lang.Object obj,
                 java.lang.String className)
          throws javax.naming.NamingException,
                 java.rmi.RemoteException
Specified by:
bind in interface ContextProxy

rebind

public void rebind(javax.naming.Name name,
                   java.lang.Object obj,
                   java.lang.String className)
            throws javax.naming.NamingException,
                   java.rmi.RemoteException
Specified by:
rebind in interface ContextProxy

unbind

public void unbind(javax.naming.Name name)
            throws javax.naming.NamingException,
                   java.rmi.RemoteException
Specified by:
unbind in interface ContextProxy

lookup

public java.lang.Object lookup(javax.naming.Name name)
                        throws javax.naming.NamingException,
                               java.rmi.RemoteException
Specified by:
lookup in interface ContextProxy

list

public java.util.Collection list(javax.naming.Name name)
                          throws javax.naming.NamingException,
                                 java.rmi.RemoteException
Specified by:
list in interface ContextProxy

listBindings

public java.util.Collection listBindings(javax.naming.Name name)
                                  throws javax.naming.NamingException,
                                         java.rmi.RemoteException
Specified by:
listBindings in interface ContextProxy

createSubcontext

public javax.naming.Context createSubcontext(javax.naming.Name name,
                                             java.util.Hashtable env)
                                      throws javax.naming.NamingException,
                                             java.rmi.RemoteException
Specified by:
createSubcontext in interface ContextProxy

getRoot

public ContextProxy getRoot()

toString

public java.lang.String toString()
Overrides:
toString in class ServiceAdapter


Copyright � 2002 Macromedia Corporation. All Rights Reserved.