Package org.glassfish.api.naming
Interface GlassfishNamingManager
-
- All Known Implementing Classes:
GlassfishNamingManagerImpl
@Contract public interface GlassfishNamingManager
The NamingManager provides an interface for various components to use naming functionality. It provides methods for binding and unbinding environment properties, resource and ejb references.
-
-
Field Summary
Fields Modifier and Type Field Description static String
LOGICAL_NAME
static String
NAMESPACE_METADATA_KEY
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
bindToAppNamespace(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 contextvoid
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 applicable java: namespace.void
bindToModuleNamespace(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 contextContext
getInitialContext()
Get the initial context.Remote
initializeRemoteNamingSupport(org.omg.CORBA.ORB orb)
Initialize RMI-IIOP naming servicesObject
lookup(String componentId, String name)
Lookup a naming entry for a particular componentIdObject
lookupFromAppNamespace(String appName, String name, Hashtable env)
Lookup a naming entry in a particular application's namespaceObject
lookupFromModuleNamespace(String appName, String moduleName, String name, Hashtable env)
Lookup a naming entry in a particular application's module's namespacevoid
publishCosNamingObject(String name, Object obj, boolean rebind)
Publish a CosNaming object.void
publishObject(String name, Object obj, boolean rebind)
Publish an object in the naming service.void
publishObject(Name name, Object obj, boolean rebind)
Publish an object 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)
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 contextvoid
unbindAppObjects(String appName)
Unbind app and module level bindings for the given app name.void
unbindComponentObjects(String componentId)
Unbind component-level bindingsvoid
unbindModuleObject(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 contextvoid
unpublishCosNamingObject(String name)
Remove an object from the CosNaming service and global naming service.void
unpublishObject(String name)
Remove an object from the naming service.void
unpublishObject(Name name)
Remove an object from the naming service.
-
-
-
Field Detail
-
LOGICAL_NAME
static final String LOGICAL_NAME
- See Also:
- Constant Field Values
-
NAMESPACE_METADATA_KEY
static final String NAMESPACE_METADATA_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInitialContext
Context getInitialContext()
Get the initial context.
-
lookup
Object lookup(String componentId, String name) throws NamingException
Lookup a naming entry for a particular componentId- Throws:
NamingException
-
lookupFromAppNamespace
Object lookupFromAppNamespace(String appName, String name, Hashtable env) throws NamingException
Lookup a naming entry in a particular application's namespace- Parameters:
appName
- application-namename
- name of the objectenv
- Environment- Returns:
- Object found by the name
- Throws:
NamingException
- when unable to find the object
-
lookupFromModuleNamespace
Object lookupFromModuleNamespace(String appName, String moduleName, String name, Hashtable env) throws NamingException
Lookup a naming entry in a particular application's module's namespace- 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
-
publishObject
void publishObject(String name, Object obj, boolean rebind) throws NamingException
Publish an object in the naming service.- 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:
Exception
NamingException
-
publishObject
void publishObject(Name name, Object obj, boolean rebind) throws NamingException
Publish an object in the naming service.- 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:
Exception
NamingException
-
publishCosNamingObject
void publishCosNamingObject(String name, Object obj, boolean rebind) throws NamingException
Publish 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.- 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:
Exception
NamingException
-
bindToComponentNamespace
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 applicable java: namespace.- Parameters:
treatComponentAsModule
- true if java:comp and java:module refer to the same namespace- Throws:
NamingException
-
bindToAppNamespace
void bindToAppNamespace(String appName, Collection<? extends JNDIBinding> bindings) throws NamingException
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 context- Parameters:
appName
- application-namebindings
- list of bindings- Throws:
NamingException
- when unable to bind the bindings
-
bindToModuleNamespace
void bindToModuleNamespace(String appName, String moduleName, Collection<? extends JNDIBinding> bindings) throws NamingException
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 context- Parameters:
appName
- application-namemoduleName
- module-namebindings
- list of bindings- Throws:
NamingException
- when unable to bind the bindings
-
unpublishObject
void unpublishObject(String name) throws NamingException
Remove an object from the naming service.- Parameters:
name
- Name that the object is bound as.- Throws:
Exception
NamingException
-
unpublishCosNamingObject
void unpublishCosNamingObject(String name) throws NamingException
Remove an object from the CosNaming service and global naming service.- Parameters:
name
- Name that the object is bound as.- Throws:
Exception
NamingException
-
unbindAppObject
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- Parameters:
name
- Name that the object is bound as.appName
- application-name- Throws:
NamingException
- when unable to unbind the object
-
unbindModuleObject
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- Parameters:
name
- Name that the object is bound as.appName
- application-namemoduleName
- module-name- Throws:
NamingException
- when unable to unbind the object
-
unpublishObject
void unpublishObject(Name name) throws NamingException
Remove an object from the naming service.- Parameters:
name
- Name that the object is bound as.- Throws:
Exception
NamingException
-
unbindComponentObjects
void unbindComponentObjects(String componentId) throws NamingException
Unbind component-level bindings- Throws:
NamingException
-
unbindAppObjects
void unbindAppObjects(String appName) throws NamingException
Unbind app and module level bindings for the given app name.- Throws:
NamingException
-
restoreJavaCompEnvContext
Context restoreJavaCompEnvContext(String contextName) throws NamingException
Recreate a context for java:comp/env or one of its sub-contexts given the context name.- Throws:
NamingException
-
initializeRemoteNamingSupport
Remote initializeRemoteNamingSupport(org.omg.CORBA.ORB orb) throws NamingException
Initialize RMI-IIOP naming services- Parameters:
orb
-- Returns:
- RemoteSerialProvider object instance
- Throws:
NamingException
-
-