Package com.sun.enterprise.naming.impl
Class GlassfishNamingManagerImpl
- java.lang.Object
-
- com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl
-
- All Implemented Interfaces:
GlassfishNamingManager
@Service @Singleton 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
Fields Modifier and Type Field Description static StringERROR_COSNAMING_UNBINDstatic StringIIOPOBJECT_FACTORYstatic StringNAMING_ALREADY_EXISTS-
Fields inherited from interface org.glassfish.api.naming.GlassfishNamingManager
LOGICAL_NAME, NAMESPACE_METADATA_KEY
-
-
Constructor Summary
Constructors Constructor Description GlassfishNamingManagerImpl()GlassfishNamingManagerImpl(InitialContext ic)Create the naming manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbindToAppNamespace(String appName, Collection<? extends JNDIBinding> bindings)Binds the bindings to module namespace of an application
Typically, to get access to application's namespace, invocation context must be set to appropriate application's context.
This API is useful in cases where containers within GlassFish need to bind the objects in application's name-space and do not have application's invocation contextvoidbindToComponentNamespace(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.voidbindToModuleNamespace(String appName, String moduleName, Collection<? extends JNDIBinding> bindings)Binds the bindings to module namespace of an application
Typically, to get access to application's module namespace, invocation context must be set to appropriate application's context.
This API is useful in cases where containers within GlassFish need to bind the objects in application's module name-space and do not have application's invocation contextContextgetInitialContext()Get the initial naming context.NameParsergetNameParser()RemoteinitializeRemoteNamingSupport(org.omg.CORBA.ORB orb)Initialize RMI-IIOP naming servicesNamingEnumeration<NameClassPair>list(String name)NamingEnumeration<Binding>listBindings(String name)Objectlookup(String name)Objectlookup(String name, SerialContext serialContext)This method is called from SerialContext class.Objectlookup(String componentId, String name)Lookup object for a particular componentId and name.ObjectlookupFromAppNamespace(String appName, String name, Hashtable env)Lookup a naming entry in a particular application's namespaceObjectlookupFromModuleNamespace(String appName, String moduleName, String name, Hashtable env)Lookup a naming entry in a particular application's module's namespacevoidpublishCosNamingObject(String name, Object obj, boolean rebind)Publish a CosNaming object.voidpublishObject(String name, Object obj, boolean rebind)Publish a name in the naming service.voidpublishObject(Name name, Object obj, boolean rebind)Publish a name in the naming service.ContextrestoreJavaCompEnvContext(String contextName)Recreate a context for java:comp/env or one of its sub-contexts given the context name.voidunbindAppObject(String appName, String name)Remove an object from the application's namespace.
Typically, to get access to application's namespace, invocation context must be set to appropriate application's context.
This API is useful in cases where containers within GlassFish need to unbind the objects in application's name-space and do not have application's invocation contextvoidunbindAppObjects(String appName)Unbind app and module level bindings for the given app name.voidunbindComponentObjects(String componentId)This method enumerates the env properties, ejb and resource references and unbinds them from the java:comp namespace.voidunbindModuleObject(String appName, String moduleName, String name)Remove an object from the module name-space of an application
Typically, to get access to application's module namespace, invocation context must be set to appropriate application's context.
This API is useful in cases where containers within GlassFish need to unbind the objects in application's module name-space and do not have application's invocation contextvoidunpublishCosNamingObject(String name)Remove an object from the naming service.voidunpublishObject(String name)Remove an object from the naming service.voidunpublishObject(Name name)Remove an object from the naming service.
-
-
-
Field Detail
-
ERROR_COSNAMING_UNBIND
public static final String ERROR_COSNAMING_UNBIND
- See Also:
- Constant Field Values
-
NAMING_ALREADY_EXISTS
public static final String NAMING_ALREADY_EXISTS
- See Also:
- Constant Field Values
-
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.- Parameters:
ic-- Throws:
NamingException
-
-
Method Detail
-
getInitialContext
public Context getInitialContext()
Get the initial naming context.- Specified by:
getInitialContextin interfaceGlassfishNamingManager
-
getNameParser
public NameParser getNameParser()
-
initializeRemoteNamingSupport
public Remote initializeRemoteNamingSupport(org.omg.CORBA.ORB orb) throws NamingException
Description copied from interface:GlassfishNamingManagerInitialize RMI-IIOP naming services- Specified by:
initializeRemoteNamingSupportin interfaceGlassfishNamingManager- Returns:
- RemoteSerialProvider object instance
- Throws:
NamingException
-
publishObject
public void publishObject(String name, Object obj, boolean rebind) throws NamingException
Publish a name in the naming service.- Specified by:
publishObjectin interfaceGlassfishNamingManager- 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:
publishObjectin interfaceGlassfishNamingManager- 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
Description copied from interface:GlassfishNamingManagerPublish a CosNaming object. The object is published to both the server's CosNaming service and the global naming service. Objects published with this method must be unpublished via unpublishCosNamingObject.- Specified by:
publishCosNamingObjectin interfaceGlassfishNamingManager- Parameters:
name- Object that needs to be bound.obj- Name that the object is bound as.rebind- operation is a bind or a rebind.- Throws:
NamingException
-
unpublishObject
public void unpublishObject(String name) throws NamingException
Description copied from interface:GlassfishNamingManagerRemove an object from the naming service.- Specified by:
unpublishObjectin interfaceGlassfishNamingManager- Parameters:
name- Name that the object is bound as.- Throws:
NamingException
-
unpublishCosNamingObject
public void unpublishCosNamingObject(String name) throws NamingException
Remove an object from the naming service.- Specified by:
unpublishCosNamingObjectin interfaceGlassfishNamingManager- Parameters:
name- Name that the object is bound as.- Throws:
NamingException
-
unpublishObject
public void unpublishObject(Name name) throws NamingException
Remove an object from the naming service.- Specified by:
unpublishObjectin interfaceGlassfishNamingManager- Parameters:
name- Name that the object is bound as.- Throws:
NamingException
-
lookupFromAppNamespace
public Object lookupFromAppNamespace(String appName, String name, Hashtable env) throws NamingException
Lookup a naming entry in a particular application's namespace- Specified by:
lookupFromAppNamespacein interfaceGlassfishNamingManager- Parameters:
appName- application-namename- name of the objectenv- Environment- Returns:
- Object found by the name
- Throws:
NamingException- when unable to find the object
-
lookupFromModuleNamespace
public Object lookupFromModuleNamespace(String appName, String moduleName, String name, Hashtable env) throws NamingException
Lookup a naming entry in a particular application's module's namespace- Specified by:
lookupFromModuleNamespacein interfaceGlassfishNamingManager- Parameters:
appName- application-namemoduleName- module-namename- name of the objectenv- Environment- Returns:
- Object found by the name
- Throws:
NamingException- when unable to find the object
-
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:
bindToComponentNamespacein interfaceGlassfishNamingManager- Parameters:
appName-moduleName-componentId-bindings-treatComponentAsModule- true if java:comp and java:module refer to the same namespace- Throws:
NamingException
-
bindToModuleNamespace
public void bindToModuleNamespace(String appName, String moduleName, Collection<? extends JNDIBinding> bindings) throws NamingException
Description copied from interface:GlassfishNamingManagerBinds the bindings to module namespace of an application
Typically, to get access to application's module namespace, invocation context must be set to appropriate application's context.
This API is useful in cases where containers within GlassFish need to bind the objects in application's module name-space and do not have application's invocation context- Specified by:
bindToModuleNamespacein interfaceGlassfishNamingManager- Parameters:
appName- application-namemoduleName- module-namebindings- list of bindings- Throws:
NamingException- when unable to bind the bindings
-
bindToAppNamespace
public void bindToAppNamespace(String appName, Collection<? extends JNDIBinding> bindings) throws NamingException
Description copied from interface:GlassfishNamingManagerBinds the bindings to module namespace of an application
Typically, to get access to application's namespace, invocation context must be set to appropriate application's context.
This API is useful in cases where containers within GlassFish need to bind the objects in application's name-space and do not have application's invocation context- Specified by:
bindToAppNamespacein interfaceGlassfishNamingManager- Parameters:
appName- application-namebindings- list of bindings- Throws:
NamingException- when unable to bind the bindings
-
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:
unbindComponentObjectsin interfaceGlassfishNamingManager- Throws:
NamingException
-
unbindAppObjects
public void unbindAppObjects(String appName) throws NamingException
Description copied from interface:GlassfishNamingManagerUnbind app and module level bindings for the given app name.- Specified by:
unbindAppObjectsin interfaceGlassfishNamingManager- Throws:
NamingException
-
unbindAppObject
public void unbindAppObject(String appName, String name) throws NamingException
Remove an object from the application's namespace.
Typically, to get access to application's namespace, invocation context must be set to appropriate application's context.
This API is useful in cases where containers within GlassFish need to unbind the objects in application's name-space and do not have application's invocation context- Specified by:
unbindAppObjectin interfaceGlassfishNamingManager- Parameters:
appName- application-namename- Name that the object is bound as.- Throws:
NamingException- when unable to unbind the object
-
unbindModuleObject
public void unbindModuleObject(String appName, String moduleName, String name) throws NamingException
Remove an object from the module name-space of an application
Typically, to get access to application's module namespace, invocation context must be set to appropriate application's context.
This API is useful in cases where containers within GlassFish need to unbind the objects in application's module name-space and do not have application's invocation context- Specified by:
unbindModuleObjectin interfaceGlassfishNamingManager- Parameters:
appName- application-namemoduleName- module-namename- Name that the object is bound as.- Throws:
NamingException- when unable to unbind the object
-
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:
restoreJavaCompEnvContextin interfaceGlassfishNamingManager- 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:
lookupin interfaceGlassfishNamingManager- Throws:
NamingException
-
list
public NamingEnumeration<NameClassPair> list(String name) throws NamingException
- Throws:
NamingException
-
listBindings
public NamingEnumeration<Binding> listBindings(String name) throws NamingException
- Throws:
NamingException
-
-