@Service @Singleton public final class GlassfishNamingManagerImpl extends Object implements GlassfishNamingManager
Modifier and Type | Field and Description |
---|---|
static String |
ERROR_COSNAMING_UNBIND |
static String |
IIOPOBJECT_FACTORY |
static String |
NAMING_ALREADY_EXISTS |
LOGICAL_NAME, NAMESPACE_METADATA_KEY
Constructor and Description |
---|
GlassfishNamingManagerImpl() |
GlassfishNamingManagerImpl(InitialContext ic)
Create the naming manager.
|
Modifier and Type | Method and 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 context |
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)
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 |
Context |
getInitialContext()
Get the initial naming context.
|
NameParser |
getNameParser() |
Remote |
initializeRemoteNamingSupport(ORB orb)
Initialize RMI-IIOP naming services
|
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)
Lookup a naming entry in a particular application's namespace
|
Object |
lookupFromModuleNamespace(String appName,
String moduleName,
String name,
Hashtable env)
Lookup a naming entry in a particular application's module's namespace
|
void |
publishCosNamingObject(String name,
Object obj,
boolean rebind)
Publish a CosNaming object.
|
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)
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 |
void |
unbindAppObjects(String appName)
Unbind app and module level bindings for the given app name.
|
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)
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 |
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)
Remove an object from the naming service.
|
public static final String ERROR_COSNAMING_UNBIND
public static final String NAMING_ALREADY_EXISTS
public static final String IIOPOBJECT_FACTORY
public GlassfishNamingManagerImpl() throws NamingException
NamingException
public GlassfishNamingManagerImpl(InitialContext ic) throws NamingException
ic
- NamingException
public Context getInitialContext()
getInitialContext
in interface GlassfishNamingManager
public NameParser getNameParser()
public Remote initializeRemoteNamingSupport(ORB orb) throws NamingException
GlassfishNamingManager
initializeRemoteNamingSupport
in interface GlassfishNamingManager
NamingException
public void publishObject(String name, Object obj, boolean rebind) throws NamingException
publishObject
in interface GlassfishNamingManager
name
- Name that the object is bound as.obj
- Object that needs to be bound.rebind
- flagNamingException
- if there is a naming exception.public void publishObject(Name name, Object obj, boolean rebind) throws NamingException
publishObject
in interface GlassfishNamingManager
name
- Name that the object is bound as.obj
- Object that needs to be bound.rebind
- flagNamingException
- if there is a naming exception.public void publishCosNamingObject(String name, Object obj, boolean rebind) throws NamingException
GlassfishNamingManager
publishCosNamingObject
in interface GlassfishNamingManager
name
- Object that needs to be bound.obj
- Name that the object is bound as.rebind
- operation is a bind or a rebind.NamingException
public void unpublishObject(String name) throws NamingException
GlassfishNamingManager
unpublishObject
in interface GlassfishNamingManager
name
- Name that the object is bound as.NamingException
public void unpublishCosNamingObject(String name) throws NamingException
unpublishCosNamingObject
in interface GlassfishNamingManager
name
- Name that the object is bound as.NamingException
public void unpublishObject(Name name) throws NamingException
unpublishObject
in interface GlassfishNamingManager
name
- Name that the object is bound as.NamingException
public Object lookupFromAppNamespace(String appName, String name, Hashtable env) throws NamingException
GlassfishNamingManager
lookupFromAppNamespace
in interface GlassfishNamingManager
appName
- application-namename
- name of the objectenv
- EnvironmentNamingException
- when unable to find the objectpublic Object lookupFromModuleNamespace(String appName, String moduleName, String name, Hashtable env) throws NamingException
GlassfishNamingManager
lookupFromModuleNamespace
in interface GlassfishNamingManager
appName
- application-namemoduleName
- module-namename
- name of the objectenv
- EnvironmentNamingException
- when unable to find the objectpublic void bindToComponentNamespace(String appName, String moduleName, String componentId, boolean treatComponentAsModule, Collection<? extends JNDIBinding> bindings) throws NamingException
bindToComponentNamespace
in interface GlassfishNamingManager
appName
- moduleName
- componentId
- bindings
- treatComponentAsModule
- true if java:comp and java:module refer to the same
namespaceNamingException
public void bindToModuleNamespace(String appName, String moduleName, Collection<? extends JNDIBinding> bindings) throws NamingException
GlassfishNamingManager
bindToModuleNamespace
in interface GlassfishNamingManager
appName
- application-namemoduleName
- module-namebindings
- list of bindingsNamingException
- when unable to bind the bindingspublic void bindToAppNamespace(String appName, Collection<? extends JNDIBinding> bindings) throws NamingException
GlassfishNamingManager
bindToAppNamespace
in interface GlassfishNamingManager
appName
- application-namebindings
- list of bindingsNamingException
- when unable to bind the bindingspublic void unbindComponentObjects(String componentId) throws NamingException
unbindComponentObjects
in interface GlassfishNamingManager
NamingException
public void unbindAppObjects(String appName) throws NamingException
GlassfishNamingManager
unbindAppObjects
in interface GlassfishNamingManager
NamingException
public void unbindAppObject(String appName, String name) throws NamingException
GlassfishNamingManager
unbindAppObject
in interface GlassfishNamingManager
appName
- application-namename
- Name that the object is bound as.NamingException
- when unable to unbind the objectpublic void unbindModuleObject(String appName, String moduleName, String name) throws NamingException
GlassfishNamingManager
unbindModuleObject
in interface GlassfishNamingManager
appName
- application-namemoduleName
- module-namename
- Name that the object is bound as.NamingException
- when unable to unbind the objectpublic Context restoreJavaCompEnvContext(String contextName) throws NamingException
restoreJavaCompEnvContext
in interface GlassfishNamingManager
NamingException
public Object lookup(String name) throws NamingException
NamingException
public Object lookup(String name, SerialContext serialContext) throws NamingException
NamingException
public Object lookup(String componentId, String name) throws NamingException
lookup
in interface GlassfishNamingManager
NamingException
public NamingEnumeration<NameClassPair> list(String name) throws NamingException
NamingException
public NamingEnumeration<Binding> listBindings(String name) throws NamingException
NamingException
Copyright © 2018. All rights reserved.