com.sun.enterprise.naming.impl
Class TransientContext

java.lang.Object
  extended by com.sun.enterprise.naming.impl.TransientContext
All Implemented Interfaces:
java.io.Serializable, javax.naming.Context

public class TransientContext
extends java.lang.Object
implements javax.naming.Context, java.io.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
 java.lang.Object addToEnvironment(java.lang.String propName, java.lang.Object propVal)
          Add the property name and value to the environment.
 void bind(javax.naming.Name name, java.lang.Object obj)
          Bind the object to the specified name.
 void bind(java.lang.String name, java.lang.Object obj)
          Bind the object to the specified name.
 void close()
          Invalidate the current environment.
 javax.naming.Name composeName(javax.naming.Name name, javax.naming.Name prefix)
          Compose a new name specified by name and prefix.
 java.lang.String composeName(java.lang.String name, java.lang.String prefix)
          Compose a new name specified by name and prefix.
 javax.naming.Context createSubcontext(javax.naming.Name name)
          Create a subcontext with the specified name.
 javax.naming.Context createSubcontext(java.lang.String name)
          Create a subcontext with the specified name.
 void destroySubcontext(javax.naming.Name name)
          Destroy the subcontext with the specified name.
 void destroySubcontext(java.lang.String name)
          Destroy the subcontext with the specified name.
 java.util.Hashtable getEnvironment()
          List the current environment.
 java.lang.String getNameInNamespace()
          Operation not supported.
 javax.naming.NameParser getNameParser(javax.naming.Name name)
          List the NameParser specified by name.
 javax.naming.NameParser getNameParser(java.lang.String name)
          List the NameParser specified by name.
 java.util.Hashtable list()
          list the objects stored by the current context
 javax.naming.NamingEnumeration<javax.naming.NameClassPair> list(javax.naming.Name name)
          List the objects specified by name.
 javax.naming.NamingEnumeration<javax.naming.NameClassPair> list(java.lang.String name)
          List the objects specified by name.
 javax.naming.NamingEnumeration<javax.naming.Binding> listBindings(javax.naming.Name name)
          List the binding of objects specified by name.
 javax.naming.NamingEnumeration<javax.naming.Binding> listBindings(java.lang.String name)
          List the bindings of objects present in name.
 java.util.Hashtable listContext(java.lang.String name)
          List the objects specified by name.
 java.lang.Object lookup(javax.naming.Name name)
          Lookup the specified name.
 java.lang.Object lookup(java.lang.String name)
          Lookup the specified name.
 java.lang.Object lookupLink(javax.naming.Name name)
          Lookup name.
 java.lang.Object lookupLink(java.lang.String name)
          Lookup the name.
 void rebind(javax.naming.Name name, java.lang.Object obj)
          Binds or rebinds the object specified by name
 void rebind(java.lang.String name, java.lang.Object obj)
          Rebinds the object specified by name
 java.lang.Object removeFromEnvironment(java.lang.String propName)
          Remove property from the environment.
 void rename(javax.naming.Name oldname, javax.naming.Name newname)
          Rename the object specified by oldname to newname
 void rename(java.lang.String oldname, java.lang.String newname)
          Rename the object specified by oldname to newname
 void unbind(javax.naming.Name name)
          Unbinds the object specified by name
 void unbind(java.lang.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 javax.naming.Context createSubcontext(java.lang.String name)
                                      throws javax.naming.NamingException
Create a subcontext with the specified name.

Specified by:
createSubcontext in interface javax.naming.Context
Returns:
the created subcontext.
Throws:
javax.naming.NamingException - if there is a naming exception.

createSubcontext

public javax.naming.Context createSubcontext(javax.naming.Name name)
                                      throws javax.naming.NamingException
Create a subcontext with the specified name.

Specified by:
createSubcontext in interface javax.naming.Context
Returns:
the created subcontext.
Throws:
javax.naming.NamingException - if there is a naming exception.

destroySubcontext

public void destroySubcontext(java.lang.String name)
                       throws javax.naming.NamingException
Destroy the subcontext with the specified name.

Specified by:
destroySubcontext in interface javax.naming.Context
Throws:
javax.naming.NamingException - if there is a naming exception.

destroySubcontext

public void destroySubcontext(javax.naming.Name name)
                       throws javax.naming.NamingException
Destroy the subcontext with the specified name.

Specified by:
destroySubcontext in interface javax.naming.Context
Throws:
javax.naming.NamingException - if there is a naming exception.

lookup

public java.lang.Object lookup(java.lang.String name)
                        throws javax.naming.NamingException
Lookup the specified name.

Specified by:
lookup in interface javax.naming.Context
Returns:
the object or context bound to the name.
Throws:
javax.naming.NamingException - if there is a naming exception.
java.rmi.RemoteException - if there is an RMI exception.

lookup

public java.lang.Object lookup(javax.naming.Name name)
                        throws javax.naming.NamingException
Lookup the specified name.

Specified by:
lookup in interface javax.naming.Context
Returns:
the object or context bound to the name.
Throws:
javax.naming.NamingException - if there is a naming exception.
java.rmi.RemoteException - if there is an RMI exception.

bind

public void bind(java.lang.String name,
                 java.lang.Object obj)
          throws javax.naming.NamingException
Bind the object to the specified name.

Specified by:
bind in interface javax.naming.Context
Throws:
javax.naming.NamingException - if there is a naming exception.
java.rmi.RemoteException - if there is an RMI exception.

bind

public void bind(javax.naming.Name name,
                 java.lang.Object obj)
          throws javax.naming.NamingException
Bind the object to the specified name.

Specified by:
bind in interface javax.naming.Context
Throws:
javax.naming.NamingException - if there is a naming exception.
java.rmi.RemoteException - if there is an RMI exception.

rebind

public void rebind(java.lang.String name,
                   java.lang.Object obj)
            throws javax.naming.NamingException
Rebinds the object specified by name

Specified by:
rebind in interface javax.naming.Context
Throws:
javax.naming.NamingException - if there is a naming exception
java.rmi.RemoteException - if there is a RMI exception

rebind

public void rebind(javax.naming.Name name,
                   java.lang.Object obj)
            throws javax.naming.NamingException
Binds or rebinds the object specified by name

Specified by:
rebind in interface javax.naming.Context
Throws:
javax.naming.NamingException - if there is a naming exception
java.rmi.RemoteException - if there is a RMI exception

unbind

public void unbind(java.lang.String name)
            throws javax.naming.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 javax.naming.Context
Throws:
javax.naming.NamingException - if there is a naming exception
java.rmi.RemoteException - if there is a RMI exception

unbind

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

Specified by:
unbind in interface javax.naming.Context
Throws:
javax.naming.NamingException - if there is a naming exception
java.rmi.RemoteException - if there is a RMI exception

rename

public void rename(javax.naming.Name oldname,
                   javax.naming.Name newname)
            throws javax.naming.NamingException
Rename the object specified by oldname to newname

Specified by:
rename in interface javax.naming.Context
Throws:
javax.naming.NamingException - if there is a naming exception
java.rmi.RemoteException - if there is a RMI exception

rename

public void rename(java.lang.String oldname,
                   java.lang.String newname)
            throws javax.naming.NamingException
Rename the object specified by oldname to newname

Specified by:
rename in interface javax.naming.Context
Throws:
javax.naming.NamingException - if there is a naming exception
java.rmi.RemoteException - if there is a RMI exception

list

public java.util.Hashtable list()
list the objects stored by the current context

Throws:
javax.naming.NamingException - if there is a naming exception
java.rmi.RemoteException - if there is a RMI exception

listContext

public java.util.Hashtable listContext(java.lang.String name)
                                throws javax.naming.NamingException
List the objects specified by name.

Throws:
javax.naming.NamingException - if there is a naming exception
java.rmi.RemoteException - if there is a RMI exception

list

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

Specified by:
list in interface javax.naming.Context
Throws:
javax.naming.NamingException - if there is a naming exception

list

public javax.naming.NamingEnumeration<javax.naming.NameClassPair> list(java.lang.String name)
                                                                throws javax.naming.NamingException
List the objects specified by name.

Specified by:
list in interface javax.naming.Context
Throws:
javax.naming.NamingException - if there is a naming exception

listBindings

public javax.naming.NamingEnumeration<javax.naming.Binding> listBindings(java.lang.String name)
                                                                  throws javax.naming.NamingException
List the bindings of objects present in name.

Specified by:
listBindings in interface javax.naming.Context
Throws:
javax.naming.NamingException - if there is a naming exception

listBindings

public javax.naming.NamingEnumeration<javax.naming.Binding> listBindings(javax.naming.Name name)
                                                                  throws javax.naming.NamingException
List the binding of objects specified by name.

Specified by:
listBindings in interface javax.naming.Context
Throws:
javax.naming.NamingException - if there is a naming exception

lookupLink

public java.lang.Object lookupLink(java.lang.String name)
                            throws javax.naming.NamingException
Lookup the name.

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

lookupLink

public java.lang.Object lookupLink(javax.naming.Name name)
                            throws javax.naming.NamingException
Lookup name.

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

getNameParser

public javax.naming.NameParser getNameParser(java.lang.String name)
                                      throws javax.naming.NamingException
List the NameParser specified by name.

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

getNameParser

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

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

composeName

public java.lang.String composeName(java.lang.String name,
                                    java.lang.String prefix)
                             throws javax.naming.NamingException
Compose a new name specified by name and prefix.

Specified by:
composeName in interface javax.naming.Context
Returns:
null
Throws:
javax.naming.NamingException - if there is a naming exception

composeName

public javax.naming.Name composeName(javax.naming.Name name,
                                     javax.naming.Name prefix)
                              throws javax.naming.NamingException
Compose a new name specified by name and prefix.

Specified by:
composeName in interface javax.naming.Context
Returns:
Name result of the concatenation
Throws:
javax.naming.NamingException - if there is a naming exception

addToEnvironment

public java.lang.Object addToEnvironment(java.lang.String propName,
                                         java.lang.Object propVal)
                                  throws javax.naming.NamingException
Add the property name and value to the environment.

Specified by:
addToEnvironment in interface javax.naming.Context
Throws:
javax.naming.NamingException - if there is a naming exception

removeFromEnvironment

public java.lang.Object removeFromEnvironment(java.lang.String propName)
                                       throws javax.naming.NamingException
Remove property from the environment.

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

getEnvironment

public java.util.Hashtable getEnvironment()
                                   throws javax.naming.NamingException
List the current environment.

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

close

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

Specified by:
close in interface javax.naming.Context
Throws:
javax.naming.NamingException

getNameInNamespace

public java.lang.String getNameInNamespace()
                                    throws javax.naming.NamingException
Operation not supported.

Specified by:
getNameInNamespace in interface javax.naming.Context
Throws:
javax.naming.NamingException


Copyright © 2012 GlassFish Community. All Rights Reserved.