Package com.sun.enterprise.naming.impl
Class TransientContext
- java.lang.Object
-
- com.sun.enterprise.naming.impl.TransientContext
-
- All Implemented Interfaces:
Serializable,Context
public class TransientContext extends Object implements Context, Serializable
Class to implement multiple level of subcontexts in SerialContext. To use this class a new object of class InitialContext (env) should be instantiated. The env i.e the Environment is initialised with SerialInitContextFactory An example for using this is in /test/subcontext- See Also:
- Serialized Form
-
-
Field Summary
-
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 TransientContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectaddToEnvironment(String propName, Object propVal)Add the property name and value to the environment.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()Invalidate the current environment.StringcomposeName(String name, String prefix)Compose a new name specified by name and prefix.NamecomposeName(Name name, Name prefix)Compose a new name specified by name and prefix.ContextcreateSubcontext(String name)Create a subcontext with the specified name.ContextcreateSubcontext(Name name)Create a subcontext with the specified name.voiddestroySubcontext(String name)Destroy the subcontext with the specified name.voiddestroySubcontext(Name name)Destroy the subcontext with the specified name.HashtablegetEnvironment()List the current environment.StringgetNameInNamespace()Operation not supported.NameParsergetNameParser(String name)List the NameParser specified by name.NameParsergetNameParser(Name name)List the NameParser specified by name.Hashtablelist()list the objects stored by the current contextNamingEnumeration<NameClassPair>list(String name)List the objects specified by name.NamingEnumeration<NameClassPair>list(Name name)List the objects specified by name.NamingEnumeration<Binding>listBindings(String name)List the bindings of objects present in name.NamingEnumeration<Binding>listBindings(Name name)List the binding of objects specified by name.HashtablelistContext(String name)List the objects specified by name.Objectlookup(String name)Lookup the specified name.Objectlookup(Name name)Lookup the specified name.ObjectlookupLink(String name)Lookup the name.ObjectlookupLink(Name name)Lookup name.voidrebind(String name, Object obj)Rebinds the object specified by namevoidrebind(Name name, Object obj)Binds or rebinds the object specified by nameObjectremoveFromEnvironment(String propName)Remove property from the environment.voidrename(String oldname, String newname)Rename the object specified by oldname to newnamevoidrename(Name oldname, Name newname)Rename the object specified by oldname to newnamevoidunbind(String name)Unbinds the object specified by name.voidunbind(Name name)Unbinds the object specified by name
-
-
-
Method Detail
-
createSubcontext
public Context createSubcontext(String name) throws NamingException
Create a subcontext with the specified name.- Specified by:
createSubcontextin interfaceContext- Returns:
- the created subcontext.
- Throws:
NamingException- if there is a naming exception.
-
createSubcontext
public Context createSubcontext(Name name) throws NamingException
Create a subcontext with the specified name.- Specified by:
createSubcontextin interfaceContext- Returns:
- the created subcontext.
- Throws:
NamingException- if there is a naming exception.
-
destroySubcontext
public void destroySubcontext(String name) throws NamingException
Destroy the subcontext with the specified name.- Specified by:
destroySubcontextin interfaceContext- Throws:
NamingException- if there is a naming exception.
-
destroySubcontext
public void destroySubcontext(Name name) throws NamingException
Destroy the subcontext with the specified name.- Specified by:
destroySubcontextin interfaceContext- Throws:
NamingException- if there is a naming exception.
-
lookup
public Object lookup(String name) throws NamingException
Lookup the specified name.- Specified by:
lookupin interfaceContext- Returns:
- the object or context bound to the name.
- Throws:
NamingException- if there is a naming exception.RemoteException- if there is an RMI exception.
-
lookup
public Object lookup(Name name) throws NamingException
Lookup the specified name.- Specified by:
lookupin interfaceContext- Returns:
- the object or context bound to the name.
- Throws:
NamingException- if there is a naming exception.RemoteException- if there is an RMI exception.
-
bind
public void bind(String name, Object obj) throws NamingException
Bind the object to the specified name.- Specified by:
bindin interfaceContext- Throws:
NamingException- if there is a naming exception.RemoteException- if there is an RMI exception.
-
bind
public void bind(Name name, Object obj) throws NamingException
Bind the object to the specified name.- Specified by:
bindin interfaceContext- Throws:
NamingException- if there is a naming exception.RemoteException- if there is an RMI exception.
-
rebind
public void rebind(String name, Object obj) throws NamingException
Rebinds the object specified by name- Specified by:
rebindin interfaceContext- Throws:
NamingException- if there is a naming exceptionRemoteException- if there is a RMI exception
-
rebind
public void rebind(Name name, Object obj) throws NamingException
Binds or rebinds the object specified by name- Specified by:
rebindin interfaceContext- Throws:
NamingException- if there is a naming exceptionRemoteException- if there is a RMI exception
-
unbind
public void unbind(String name) throws NamingException
Unbinds the object specified by name. Calls itself recursively to traverse down the context tree and unbind the object.- Specified by:
unbindin interfaceContext- Throws:
NamingException- if there is a naming exceptionRemoteException- if there is a RMI exception
-
unbind
public void unbind(Name name) throws NamingException
Unbinds the object specified by name- Specified by:
unbindin interfaceContext- Throws:
NamingException- if there is a naming exceptionRemoteException- if there is a RMI exception
-
rename
public void rename(Name oldname, Name newname) throws NamingException
Rename the object specified by oldname to newname- Specified by:
renamein interfaceContext- Throws:
NamingException- if there is a naming exceptionRemoteException- if there is a RMI exception
-
rename
public void rename(String oldname, String newname) throws NamingException
Rename the object specified by oldname to newname- Specified by:
renamein interfaceContext- Throws:
NamingException- if there is a naming exceptionRemoteException- if there is a RMI exception
-
list
public Hashtable list()
list the objects stored by the current context- Throws:
NamingException- if there is a naming exceptionRemoteException- if there is a RMI exception
-
listContext
public Hashtable listContext(String name) throws NamingException
List the objects specified by name.- Throws:
NamingException- if there is a naming exceptionRemoteException- if there is a RMI exception
-
list
public NamingEnumeration<NameClassPair> list(Name name) throws NamingException
List the objects specified by name.- Specified by:
listin interfaceContext- Throws:
NamingException- if there is a naming exception
-
list
public NamingEnumeration<NameClassPair> list(String name) throws NamingException
List the objects specified by name.- Specified by:
listin interfaceContext- Throws:
NamingException- if there is a naming exception
-
listBindings
public NamingEnumeration<Binding> listBindings(String name) throws NamingException
List the bindings of objects present in name.- Specified by:
listBindingsin interfaceContext- Throws:
NamingException- if there is a naming exception
-
listBindings
public NamingEnumeration<Binding> listBindings(Name name) throws NamingException
List the binding of objects specified by name.- Specified by:
listBindingsin interfaceContext- Throws:
NamingException- if there is a naming exception
-
lookupLink
public Object lookupLink(String name) throws NamingException
Lookup the name.- Specified by:
lookupLinkin interfaceContext- Throws:
NamingException- if there is a naming exception
-
lookupLink
public Object lookupLink(Name name) throws NamingException
Lookup name.- Specified by:
lookupLinkin interfaceContext- Throws:
NamingException- if there is a naming exception
-
getNameParser
public NameParser getNameParser(String name) throws NamingException
List the NameParser specified by name.- Specified by:
getNameParserin interfaceContext- Throws:
NamingException- if there is a naming exception
-
getNameParser
public NameParser getNameParser(Name name) throws NamingException
List the NameParser specified by name.- Specified by:
getNameParserin interfaceContext- Throws:
NamingException- if there is a naming exception
-
composeName
public String composeName(String name, String prefix) throws NamingException
Compose a new name specified by name and prefix.- Specified by:
composeNamein interfaceContext- Returns:
- null
- Throws:
NamingException- if there is a naming exception
-
composeName
public Name composeName(Name name, Name prefix) throws NamingException
Compose a new name specified by name and prefix.- Specified by:
composeNamein interfaceContext- Returns:
- Name result of the concatenation
- Throws:
NamingException- if there is a naming exception
-
addToEnvironment
public Object addToEnvironment(String propName, Object propVal) throws NamingException
Add the property name and value to the environment.- Specified by:
addToEnvironmentin interfaceContext- Throws:
NamingException- if there is a naming exception
-
removeFromEnvironment
public Object removeFromEnvironment(String propName) throws NamingException
Remove property from the environment.- Specified by:
removeFromEnvironmentin interfaceContext- Throws:
NamingException- if there is a naming exception
-
getEnvironment
public Hashtable getEnvironment() throws NamingException
List the current environment.- Specified by:
getEnvironmentin interfaceContext- Throws:
NamingException- if there is a naming exception
-
close
public void close() throws NamingExceptionInvalidate the current environment.- Specified by:
closein interfaceContext- Throws:
NamingException
-
getNameInNamespace
public String getNameInNamespace() throws NamingException
Operation not supported.- Specified by:
getNameInNamespacein interfaceContext- Throws:
NamingException
-
-