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 StringEXCEPTION_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 ObjectaddToEnvironment(String propName, Object propVal)Add to the environment for the current context.voidbind(String name, Object obj)Bind the object to the specified name.voidbind(Name name, Object obj)Bind the object to the specified name.voidclose()Set the environment for the current context to null when close is called.StringcomposeName(String name, String prefix)NamecomposeName(Name name, Name prefix)ContextcreateSubcontext(String name)Create the specified subcontext.ContextcreateSubcontext(Name name)Create the specified subcontext.voiddestroySubcontext(String name)Destroy the specified subcontext.voiddestroySubcontext(Name name)Destroy the specified subcontext.HashtablegetEnvironment()Return the environment for the current context.StringgetNameInNamespace()The getNameInNamespace API is not supported in this context.NameParsergetNameParser(String name)Allow access to the name parser object.NameParsergetNameParser(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.Objectlookup(String name)Lookup the specified name in the context.Objectlookup(Name name)Lookup the specifed name in the context.ObjectlookupLink(String name)Links are not treated specially.ObjectlookupLink(Name name)Links are not treated specially.voidrebind(String name, Object obj)Rebind the object to the specified name.voidrebind(Name name, Object obj)Rebind the object to the specified name.ObjectremoveFromEnvironment(String propName)Remove from the environment for the current context.voidrename(String oldname, String newname)Rename the bound object.voidrename(Name oldname, Name newname)Rename the bound object.StringtoString()voidunbind(String name)Unbind the object with the specified name.voidunbind(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:
getNameInNamespacein 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:
lookupin 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:
lookupin 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:
bindin 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:
bindin 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:
rebindin 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:
rebindin 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:
unbindin 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:
unbindin 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:
renamein 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:
renamein 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:
listin 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:
listin 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:
listBindingsin 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:
listBindingsin 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:
destroySubcontextin 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:
destroySubcontextin 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:
createSubcontextin 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:
createSubcontextin 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:
lookupLinkin 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:
lookupLinkin 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:
getNameParserin 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:
getNameParserin 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:
composeNamein interfaceContext- Throws:
NamingException
-
composeName
public Name composeName(Name name, Name prefix) throws NamingException
- Specified by:
composeNamein interfaceContext- Throws:
NamingException
-
addToEnvironment
public Object addToEnvironment(String propName, Object propVal) throws NamingException
Add to the environment for the current context.- Specified by:
addToEnvironmentin 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:
removeFromEnvironmentin interfaceContext- Throws:
NamingException- if there is a naming exception.
-
getEnvironment
public Hashtable getEnvironment() throws NamingException
Return the environment for the current context.- Specified by:
getEnvironmentin interfaceContext- Throws:
NamingException- if there is a naming exception.
-
close
public void close() throws NamingExceptionSet the environment for the current context to null when close is called.- Specified by:
closein interfaceContext- Throws:
NamingException- if there is a naming exception.
-
-