Package com.sun.enterprise.naming.impl
Class SerialContext
- java.lang.Object
-
- com.sun.enterprise.naming.impl.SerialContext
-
- All Implemented Interfaces:
Context
public class SerialContext extends Object implements Context
This context provides access to the app server naming service. This is the default Context for GlassFish. Lookups of unqualified names (i.e. names not starting with "java:", "corbaname:" etc) are serviced by SerialContext. The namespace is implemented in the SerialContextProviderImpl object, which is accessed directly in the case that the client is collocated with the naming service impl or remotely via RMI-IIOP if not collocated. NOT THREAD SAFE: mutable instance variables
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXCEPTION_DURING_LOOKUP
-
Fields inherited from interface javax.naming.Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
-
-
Constructor Summary
Constructors Constructor Description SerialContext(String name, Hashtable environment, org.glassfish.hk2.api.ServiceLocator h)
Constructor for the context.SerialContext(Hashtable env, org.glassfish.hk2.api.ServiceLocator services)
This constructor takes the component id as an argument.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
addToEnvironment(String propName, Object propVal)
Add to the environment for the current context.void
bind(String name, Object obj)
Bind the object to the specified name.void
bind(Name name, Object obj)
Bind the object to the specified name.void
close()
Set the environment for the current context to null when close is called.String
composeName(String name, String prefix)
Name
composeName(Name name, Name prefix)
Context
createSubcontext(String name)
Create the specified subcontext.Context
createSubcontext(Name name)
Create the specified subcontext.void
destroySubcontext(String name)
Destroy the specified subcontext.void
destroySubcontext(Name name)
Destroy the specified subcontext.Hashtable
getEnvironment()
Return the environment for the current context.String
getNameInNamespace()
The getNameInNamespace API is not supported in this context.NameParser
getNameParser(String name)
Allow access to the name parser object.NameParser
getNameParser(Name name)
Allow access to the name parser object.NamingEnumeration<NameClassPair>
list(String name)
List the contents of the specified context.NamingEnumeration<NameClassPair>
list(Name name)
List the contents of the specified context.NamingEnumeration<Binding>
listBindings(String name)
List the bindings in the specified context.NamingEnumeration<Binding>
listBindings(Name name)
List the bindings in the specified context.Object
lookup(String name)
Lookup the specified name in the context.Object
lookup(Name name)
Lookup the specifed name in the context.Object
lookupLink(String name)
Links are not treated specially.Object
lookupLink(Name name)
Links are not treated specially.void
rebind(String name, Object obj)
Rebind the object to the specified name.void
rebind(Name name, Object obj)
Rebind the object to the specified name.Object
removeFromEnvironment(String propName)
Remove from the environment for the current context.void
rename(String oldname, String newname)
Rename the bound object.void
rename(Name oldname, Name newname)
Rename the bound object.String
toString()
void
unbind(String name)
Unbind the object with the specified name.void
unbind(Name name)
Unbind the object with the specified name.
-
-
-
Field Detail
-
EXCEPTION_DURING_LOOKUP
public static final String EXCEPTION_DURING_LOOKUP
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SerialContext
public SerialContext(String name, Hashtable environment, org.glassfish.hk2.api.ServiceLocator h) throws NamingException
Constructor for the context. Initializes the object reference to the remote provider object.- Throws:
NamingException
-
SerialContext
public SerialContext(Hashtable env, org.glassfish.hk2.api.ServiceLocator services) throws NamingException
This constructor takes the component id as an argument. All name arguments to operations are prepended by the component id.- Throws:
NamingException
-
-
Method Detail
-
getNameInNamespace
public String getNameInNamespace() throws NamingException
The getNameInNamespace API is not supported in this context.- Specified by:
getNameInNamespace
in interfaceContext
- Throws:
NamingException
- if there is a naming exception.
-
lookup
public Object lookup(String name) throws NamingException
Lookup the specified name in the context. Returns the resolved object.- Specified by:
lookup
in interfaceContext
- Returns:
- the resolved object.
- Throws:
NamingException
- if there is a naming exception.
-
lookup
public Object lookup(Name name) throws NamingException
Lookup the specifed name in the context. Returns the resolved object.- Specified by:
lookup
in interfaceContext
- Returns:
- the resolved object.
- Throws:
NamingException
- if there is a naming exception.
-
bind
public void bind(String name, Object obj) throws NamingException
Bind the object to the specified name.- Specified by:
bind
in interfaceContext
- Parameters:
name
- name that the object is being bound to.obj
- object that is being bound.- Throws:
NamingException
- if there is a naming exception.
-
bind
public void bind(Name name, Object obj) throws NamingException
Bind the object to the specified name.- Specified by:
bind
in interfaceContext
- Parameters:
name
- name that the object is being bound to.obj
- object that is being bound.- Throws:
NamingException
- if there is a naming exception.
-
rebind
public void rebind(String name, Object obj) throws NamingException
Rebind the object to the specified name.- Specified by:
rebind
in interfaceContext
- Parameters:
name
- name that the object is being bound to.obj
- object that is being bound.- Throws:
NamingException
- if there is a naming exception.
-
rebind
public void rebind(Name name, Object obj) throws NamingException
Rebind the object to the specified name.- Specified by:
rebind
in interfaceContext
- Parameters:
name
- name that the object is being bound to.obj
- object that is being bound.- Throws:
NamingException
- if there is a naming exception.
-
unbind
public void unbind(String name) throws NamingException
Unbind the object with the specified name.- Specified by:
unbind
in interfaceContext
- Parameters:
name
- that is being unbound.- Throws:
NamingException
- if there is a naming exception.
-
unbind
public void unbind(Name name) throws NamingException
Unbind the object with the specified name.- Specified by:
unbind
in interfaceContext
- Parameters:
name
- name that is being unbound.- Throws:
NamingException
- if there is a naming exception.
-
rename
public void rename(String oldname, String newname) throws NamingException
Rename the bound object.- Specified by:
rename
in interfaceContext
- Parameters:
oldname
- old name that the object is bound as.newname
- new name that the object will be bound as.- Throws:
NamingException
- if there is a naming exception.
-
rename
public void rename(Name oldname, Name newname) throws NamingException
Rename the bound object.- Specified by:
rename
in interfaceContext
- Parameters:
oldname
- old name that the object is bound as.newname
- new name that the object will be bound as.- Throws:
NamingException
- if there is a naming exception.
-
list
public NamingEnumeration<NameClassPair> list(String name) throws NamingException
List the contents of the specified context.- Specified by:
list
in interfaceContext
- Parameters:
name
- context name.- Returns:
- an enumeration of the contents.
- Throws:
NamingException
- if there is a naming exception.
-
list
public NamingEnumeration<NameClassPair> list(Name name) throws NamingException
List the contents of the specified context.- Specified by:
list
in interfaceContext
- Parameters:
name
- context name.- Returns:
- an enumeration of the contents.
- Throws:
NamingException
- if there is a naming exception.
-
listBindings
public NamingEnumeration<Binding> listBindings(String name) throws NamingException
List the bindings in the specified context.- Specified by:
listBindings
in interfaceContext
- Parameters:
name
- context name.- Returns:
- an enumeration of the bindings.
- Throws:
NamingException
- if there is a naming exception.
-
listBindings
public NamingEnumeration<Binding> listBindings(Name name) throws NamingException
List the bindings in the specified context.- Specified by:
listBindings
in interfaceContext
- Parameters:
name
- context name.- Returns:
- an enumeration of the bindings.
- Throws:
NamingException
- if there is a naming exception.
-
destroySubcontext
public void destroySubcontext(String name) throws NamingException
Destroy the specified subcontext.- Specified by:
destroySubcontext
in interfaceContext
- Parameters:
name
- name of the subcontext.- Throws:
NamingException
- if there is a naming exception.
-
destroySubcontext
public void destroySubcontext(Name name) throws NamingException
Destroy the specified subcontext.- Specified by:
destroySubcontext
in interfaceContext
- Parameters:
name
- name of the subcontext.- Throws:
NamingException
- if there is a naming exception.
-
createSubcontext
public Context createSubcontext(String name) throws NamingException
Create the specified subcontext.- Specified by:
createSubcontext
in interfaceContext
- Parameters:
name
- name of the subcontext.- Returns:
- the created subcontext.
- Throws:
NamingException
- if there is a naming exception.
-
createSubcontext
public Context createSubcontext(Name name) throws NamingException
Create the specified subcontext.- Specified by:
createSubcontext
in interfaceContext
- Parameters:
name
- name of the subcontext.- Returns:
- the created subcontext.
- Throws:
NamingException
- if there is a naming exception.
-
lookupLink
public Object lookupLink(String name) throws NamingException
Links are not treated specially.- Specified by:
lookupLink
in interfaceContext
- Parameters:
name
- name of the link.- Returns:
- the resolved object.
- Throws:
NamingException
- if there is a naming exception.
-
lookupLink
public Object lookupLink(Name name) throws NamingException
Links are not treated specially.- Specified by:
lookupLink
in interfaceContext
- Parameters:
name
- name of the link.- Returns:
- the resolved object.
- Throws:
NamingException
- if there is a naming exception.
-
getNameParser
public NameParser getNameParser(String name) throws NamingException
Allow access to the name parser object.- Specified by:
getNameParser
in interfaceContext
- Parameters:
name
- JNDI name, is ignored since there is only one Name Parser object.- Returns:
- NameParser object
- Throws:
NamingException
-
getNameParser
public NameParser getNameParser(Name name) throws NamingException
Allow access to the name parser object.- Specified by:
getNameParser
in interfaceContext
- Parameters:
name
- JNDI name, is ignored since there is only one Name Parser object.- Returns:
- NameParser object
- Throws:
NamingException
-
composeName
public String composeName(String name, String prefix) throws NamingException
- Specified by:
composeName
in interfaceContext
- Throws:
NamingException
-
composeName
public Name composeName(Name name, Name prefix) throws NamingException
- Specified by:
composeName
in interfaceContext
- Throws:
NamingException
-
addToEnvironment
public Object addToEnvironment(String propName, Object propVal) throws NamingException
Add to the environment for the current context.- Specified by:
addToEnvironment
in interfaceContext
- Throws:
NamingException
- if there is a naming exception.
-
removeFromEnvironment
public Object removeFromEnvironment(String propName) throws NamingException
Remove from the environment for the current context.- Specified by:
removeFromEnvironment
in interfaceContext
- Throws:
NamingException
- if there is a naming exception.
-
getEnvironment
public Hashtable getEnvironment() throws NamingException
Return the environment for the current context.- Specified by:
getEnvironment
in interfaceContext
- Throws:
NamingException
- if there is a naming exception.
-
close
public void close() throws NamingException
Set the environment for the current context to null when close is called.- Specified by:
close
in interfaceContext
- Throws:
NamingException
- if there is a naming exception.
-
-