com.sun.enterprise.naming.impl
Class TransientContext

java.lang.Object
  extended by 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
static boolean debug
           
 
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
TransientContext()
           
 
Method Summary
 Object addToEnvironment(String propName, Object propVal)
          Add the property name and value to the environment.
 void bind(Name name, Object obj)
          Bind the object to the specified name.
 void bind(String name, Object obj)
          Bind the object to the specified name.
 void close()
          Invalidate the current environment.
 Name composeName(Name name, Name prefix)
          Compose a new name specified by name and prefix.
 String composeName(String name, String prefix)
          Compose a new name specified by name and prefix.
 Context createSubcontext(Name name)
          Create a subcontext with the specified name.
 Context createSubcontext(String name)
          Create a subcontext with the specified name.
 void destroySubcontext(Name name)
          Destroy the subcontext with the specified name.
 void destroySubcontext(String name)
          Destroy the subcontext with the specified name.
 Hashtable getEnvironment()
          List the current environment.
 String getNameInNamespace()
          Operation not supported.
 NameParser getNameParser(Name name)
          List the NameParser specified by name.
 NameParser getNameParser(String name)
          List the NameParser specified by name.
 Hashtable list()
          list the objects stored by the current context
 NamingEnumeration<NameClassPair> list(Name name)
          List the objects specified by name.
 NamingEnumeration<NameClassPair> list(String name)
          List the objects specified by name.
 NamingEnumeration<Binding> listBindings(Name name)
          List the binding of objects specified by name.
 NamingEnumeration<Binding> listBindings(String name)
          List the bindings of objects present in name.
 Hashtable listContext(String name)
          List the objects specified by name.
 Object lookup(Name name)
          Lookup the specified name.
 Object lookup(String name)
          Lookup the specified name.
 Object lookupLink(Name name)
          Lookup name.
 Object lookupLink(String name)
          Lookup the name.
 void rebind(Name name, Object obj)
          Binds or rebinds the object specified by name
 void rebind(String name, Object obj)
          Rebinds the object specified by name
 Object removeFromEnvironment(String propName)
          Remove property from the environment.
 void rename(Name oldname, Name newname)
          Rename the object specified by oldname to newname
 void rename(String oldname, String newname)
          Rename the object specified by oldname to newname
 void unbind(Name name)
          Unbinds the object specified by name
 void unbind(String name)
          Unbinds the object specified by name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static final boolean debug
See Also:
Constant Field Values
Constructor Detail

TransientContext

public TransientContext()
Method Detail

createSubcontext

public Context createSubcontext(String name)
                         throws NamingException
Create a subcontext with the specified name.

Specified by:
createSubcontext in interface Context
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:
createSubcontext in interface Context
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:
destroySubcontext in interface Context
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:
destroySubcontext in interface Context
Throws:
NamingException - if there is a naming exception.

lookup

public Object lookup(String name)
              throws NamingException
Lookup the specified name.

Specified by:
lookup in interface Context
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:
lookup in interface Context
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:
bind in interface Context
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:
bind in interface Context
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:
rebind in interface Context
Throws:
NamingException - if there is a naming exception
RemoteException - 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:
rebind in interface Context
Throws:
NamingException - if there is a naming exception
RemoteException - 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:
unbind in interface Context
Throws:
NamingException - if there is a naming exception
RemoteException - if there is a RMI exception

unbind

public void unbind(Name name)
            throws NamingException
Unbinds the object specified by name

Specified by:
unbind in interface Context
Throws:
NamingException - if there is a naming exception
RemoteException - 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:
rename in interface Context
Throws:
NamingException - if there is a naming exception
RemoteException - 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:
rename in interface Context
Throws:
NamingException - if there is a naming exception
RemoteException - 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 exception
RemoteException - 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 exception
RemoteException - if there is a RMI exception

list

public NamingEnumeration<NameClassPair> list(Name name)
                                      throws NamingException
List the objects specified by name.

Specified by:
list in interface Context
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:
list in interface Context
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:
listBindings in interface Context
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:
listBindings in interface Context
Throws:
NamingException - if there is a naming exception

lookupLink

public Object lookupLink(String name)
                  throws NamingException
Lookup the name.

Specified by:
lookupLink in interface Context
Throws:
NamingException - if there is a naming exception

lookupLink

public Object lookupLink(Name name)
                  throws NamingException
Lookup name.

Specified by:
lookupLink in interface Context
Throws:
NamingException - if there is a naming exception

getNameParser

public NameParser getNameParser(String name)
                         throws NamingException
List the NameParser specified by name.

Specified by:
getNameParser in interface Context
Throws:
NamingException - if there is a naming exception

getNameParser

public NameParser getNameParser(Name name)
                         throws NamingException
List the NameParser specified by name.

Specified by:
getNameParser in interface Context
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:
composeName in interface Context
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:
composeName in interface Context
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:
addToEnvironment in interface Context
Throws:
NamingException - if there is a naming exception

removeFromEnvironment

public Object removeFromEnvironment(String propName)
                             throws NamingException
Remove property from the environment.

Specified by:
removeFromEnvironment in interface Context
Throws:
NamingException - if there is a naming exception

getEnvironment

public Hashtable getEnvironment()
                         throws NamingException
List the current environment.

Specified by:
getEnvironment in interface Context
Throws:
NamingException - if there is a naming exception

close

public void close()
           throws NamingException
Invalidate the current environment.

Specified by:
close in interface Context
Throws:
NamingException

getNameInNamespace

public String getNameInNamespace()
                          throws NamingException
Operation not supported.

Specified by:
getNameInNamespace in interface Context
Throws:
NamingException


Copyright © 2012 GlassFish Community. All Rights Reserved.