com.sun.enterprise.naming.impl
Class GlassfishNamingManagerImpl

java.lang.Object
  extended by com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl
All Implemented Interfaces:
GlassfishNamingManager

@Service
@Scoped(value=org.jvnet.hk2.component.Singleton.class)
public final class GlassfishNamingManagerImpl
extends Object
implements GlassfishNamingManager

This is the manager that handles all naming operations including publishObject as well as binding environment props, resource and ejb references in the namespace.


Field Summary
static String IIOPOBJECT_FACTORY
           
 
Fields inherited from interface org.glassfish.api.naming.GlassfishNamingManager
LOGICAL_NAME
 
Constructor Summary
GlassfishNamingManagerImpl()
           
GlassfishNamingManagerImpl(InitialContext ic)
          Create the naming manager.
 
Method Summary
 void bindToAppNamespace(String appName, Collection<? extends JNDIBinding> bindings)
           
 void bindToComponentNamespace(String appName, String moduleName, String componentId, boolean treatComponentAsModule, Collection<? extends JNDIBinding> bindings)
          This method enumerates the env properties, ejb and resource references etc for a J2EE component and binds them in the component's java:comp namespace.
 void bindToModuleNamespace(String appName, String moduleName, Collection<? extends JNDIBinding> bindings)
           
 Context getInitialContext()
          Get the initial naming context.
 NameParser getNameParser()
           
 Remote initializeRemoteNamingSupport(ORB orb)
           
 NamingEnumeration<NameClassPair> list(String name)
           
 NamingEnumeration<Binding> listBindings(String name)
           
 Object lookup(String name)
           
 Object lookup(String name, SerialContext serialContext)
          This method is called from SerialContext class.
 Object lookup(String componentId, String name)
          Lookup object for a particular componentId and name.
 Object lookupFromAppNamespace(String appName, String name, Hashtable env)
           
 Object lookupFromModuleNamespace(String appName, String moduleName, String name, Hashtable env)
           
 void publishCosNamingObject(String name, Object obj, boolean rebind)
           
 void publishObject(Name name, Object obj, boolean rebind)
          Publish a name in the naming service.
 void publishObject(String name, Object obj, boolean rebind)
          Publish a name in the naming service.
 Context restoreJavaCompEnvContext(String contextName)
          Recreate a context for java:comp/env or one of its sub-contexts given the context name.
 void unbindAppObject(String appName, String name)
           
 void unbindAppObjects(String appName)
           
 void unbindComponentObjects(String componentId)
          This method enumerates the env properties, ejb and resource references and unbinds them from the java:comp namespace.
 void unbindModuleObject(String appName, String moduleName, String name)
           
 void unpublishCosNamingObject(String name)
          Remove an object from the naming service.
 void unpublishObject(Name name)
          Remove an object from the naming service.
 void unpublishObject(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IIOPOBJECT_FACTORY

public static final String IIOPOBJECT_FACTORY
See Also:
Constant Field Values
Constructor Detail

GlassfishNamingManagerImpl

public GlassfishNamingManagerImpl()
                           throws NamingException
Throws:
NamingException

GlassfishNamingManagerImpl

public GlassfishNamingManagerImpl(InitialContext ic)
                           throws NamingException
Create the naming manager. Creates a new initial context.

Throws:
NamingException
Method Detail

getInitialContext

public Context getInitialContext()
Get the initial naming context.

Specified by:
getInitialContext in interface GlassfishNamingManager

getNameParser

public NameParser getNameParser()

initializeRemoteNamingSupport

public Remote initializeRemoteNamingSupport(ORB orb)
                                     throws NamingException
Specified by:
initializeRemoteNamingSupport in interface GlassfishNamingManager
Throws:
NamingException

publishObject

public void publishObject(String name,
                          Object obj,
                          boolean rebind)
                   throws NamingException
Publish a name in the naming service.

Specified by:
publishObject in interface GlassfishNamingManager
Parameters:
name - Name that the object is bound as.
obj - Object that needs to be bound.
rebind - flag
Throws:
NamingException - if there is a naming exception.

publishObject

public void publishObject(Name name,
                          Object obj,
                          boolean rebind)
                   throws NamingException
Publish a name in the naming service.

Specified by:
publishObject in interface GlassfishNamingManager
Parameters:
name - Name that the object is bound as.
obj - Object that needs to be bound.
rebind - flag
Throws:
NamingException - if there is a naming exception.

publishCosNamingObject

public void publishCosNamingObject(String name,
                                   Object obj,
                                   boolean rebind)
                            throws NamingException
Specified by:
publishCosNamingObject in interface GlassfishNamingManager
Throws:
NamingException

unpublishObject

public void unpublishObject(String name)
                     throws NamingException
Specified by:
unpublishObject in interface GlassfishNamingManager
Throws:
NamingException

unpublishCosNamingObject

public void unpublishCosNamingObject(String name)
                              throws NamingException
Remove an object from the naming service.

Specified by:
unpublishCosNamingObject in interface GlassfishNamingManager
Parameters:
name - Name that the object is bound as.
Throws:
Exception
NamingException

unpublishObject

public void unpublishObject(Name name)
                     throws NamingException
Remove an object from the naming service.

Specified by:
unpublishObject in interface GlassfishNamingManager
Parameters:
name - Name that the object is bound as.
Throws:
Exception
NamingException

lookupFromAppNamespace

public Object lookupFromAppNamespace(String appName,
                                     String name,
                                     Hashtable env)
                              throws NamingException
Specified by:
lookupFromAppNamespace in interface GlassfishNamingManager
Throws:
NamingException

lookupFromModuleNamespace

public Object lookupFromModuleNamespace(String appName,
                                        String moduleName,
                                        String name,
                                        Hashtable env)
                                 throws NamingException
Specified by:
lookupFromModuleNamespace in interface GlassfishNamingManager
Throws:
NamingException

bindToComponentNamespace

public void bindToComponentNamespace(String appName,
                                     String moduleName,
                                     String componentId,
                                     boolean treatComponentAsModule,
                                     Collection<? extends JNDIBinding> bindings)
                              throws NamingException
This method enumerates the env properties, ejb and resource references etc for a J2EE component and binds them in the component's java:comp namespace.

Specified by:
bindToComponentNamespace in interface GlassfishNamingManager
Throws:
NamingException

bindToModuleNamespace

public void bindToModuleNamespace(String appName,
                                  String moduleName,
                                  Collection<? extends JNDIBinding> bindings)
                           throws NamingException
Specified by:
bindToModuleNamespace in interface GlassfishNamingManager
Throws:
NamingException

bindToAppNamespace

public void bindToAppNamespace(String appName,
                               Collection<? extends JNDIBinding> bindings)
                        throws NamingException
Specified by:
bindToAppNamespace in interface GlassfishNamingManager
Throws:
NamingException

unbindComponentObjects

public void unbindComponentObjects(String componentId)
                            throws NamingException
This method enumerates the env properties, ejb and resource references and unbinds them from the java:comp namespace.

Specified by:
unbindComponentObjects in interface GlassfishNamingManager
Throws:
NamingException

unbindAppObjects

public void unbindAppObjects(String appName)
                      throws NamingException
Specified by:
unbindAppObjects in interface GlassfishNamingManager
Throws:
NamingException

unbindAppObject

public void unbindAppObject(String appName,
                            String name)
                     throws NamingException
Specified by:
unbindAppObject in interface GlassfishNamingManager
Throws:
NamingException

unbindModuleObject

public void unbindModuleObject(String appName,
                               String moduleName,
                               String name)
                        throws NamingException
Specified by:
unbindModuleObject in interface GlassfishNamingManager
Throws:
NamingException

restoreJavaCompEnvContext

public Context restoreJavaCompEnvContext(String contextName)
                                  throws NamingException
Recreate a context for java:comp/env or one of its sub-contexts given the context name.

Specified by:
restoreJavaCompEnvContext in interface GlassfishNamingManager
Throws:
NamingException

lookup

public Object lookup(String name)
              throws NamingException
Throws:
NamingException

lookup

public Object lookup(String name,
                     SerialContext serialContext)
              throws NamingException
This method is called from SerialContext class. The serialContext instance that was created by the appclient's Main class is passed so that stickiness is preserved. Called from javaURLContext.lookup, for java:comp names.

Throws:
NamingException

lookup

public Object lookup(String componentId,
                     String name)
              throws NamingException
Lookup object for a particular componentId and name.

Specified by:
lookup in interface GlassfishNamingManager
Throws:
NamingException

list

public NamingEnumeration<NameClassPair> list(String name)
                                      throws NamingException
Throws:
NamingException

listBindings

public NamingEnumeration<Binding> listBindings(String name)
                                        throws NamingException
Throws:
NamingException


Copyright © 2012. All Rights Reserved.