com.sun.enterprise.naming.impl
Class JavaURLContext

java.lang.Object
  extended by com.sun.enterprise.naming.impl.JavaURLContext
All Implemented Interfaces:
Cloneable, Context

public final class JavaURLContext
extends Object
implements Context, Cloneable

This class is a context implementation for the java:comp namespace. The context determines the component id from the invocation manager of the component that is invoking the method and then looks up the object in that component's local namespace.


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
JavaURLContext(Hashtable environment)
          Create a context with the specified environment.
JavaURLContext(Hashtable env, SerialContext serialContext)
          this constructor is called from SerialContext class
JavaURLContext(JavaURLContext ctx, SerialContext sctx)
           
JavaURLContext(String name, Hashtable env)
          Create a context with the specified name+environment.
 
Method Summary
 Object addToEnvironment(String propName, Object propVal)
          Add a property to the environment.
 void bind(Name name, Object obj)
          Bind an object in the namespace.
 void bind(String name, Object obj)
          Bind an object in the namespace.
 void close()
          New JNDI 1.2 operation.
 Name composeName(Name name, Name prefix)
           
 String composeName(String name, String prefix)
           
 Context createSubcontext(Name name)
           
 Context createSubcontext(String name)
           
 void destroySubcontext(Name name)
          The destroySubcontext operation is not supported by this context.
 void destroySubcontext(String name)
          The destroySubcontext operation is not supported by this context.
 Hashtable getEnvironment()
          Get the context's environment.
 String getNameInNamespace()
          Return the name of this context within the namespace.
 NameParser getNameParser(Name name)
          Return the name parser for the specified name.
 NameParser getNameParser(String name)
          Return the name parser for the specified name.
 NamingEnumeration<NameClassPair> list(Name name)
          Lists the contents of a context or subcontext.
 NamingEnumeration<NameClassPair> list(String name)
          Lists the contents of a context or subcontext.
 NamingEnumeration<Binding> listBindings(Name name)
          Lists the bindings of a context or subcontext.
 NamingEnumeration<Binding> listBindings(String name)
          Lists the bindings of a context or subcontext.
 Object lookup(Name name)
          Lookup a name in either the cosnaming or serial context.
 Object lookup(String name)
          Lookup an object in the serial context.
 Object lookupLink(Name name)
          This context does not treat links specially.
 Object lookupLink(String name)
          This context does not treat links specially.
 void rebind(Name name, Object obj)
          Rebind an object in the namespace.
 void rebind(String name, Object obj)
          Rebind an object in the namespace.
 Object removeFromEnvironment(String propName)
          Remove a property from the environment.
 void rename(Name oldname, Name newname)
          The rename operation is not supported by this context.
 void rename(String oldname, String newname)
          The rename operation is not supported by this context.
 void unbind(Name name)
          Unbind an object from the namespace.
 void unbind(String name)
          Unbind an object from the namespace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaURLContext

public JavaURLContext(Hashtable environment)
               throws NamingException
Create a context with the specified environment.

Throws:
NamingException

JavaURLContext

public JavaURLContext(String name,
                      Hashtable env)
               throws NamingException
Create a context with the specified name+environment. Called only from GlassfishNamingManager.

Throws:
NamingException

JavaURLContext

public JavaURLContext(Hashtable env,
                      SerialContext serialContext)
               throws NamingException
this constructor is called from SerialContext class

Throws:
NamingException

JavaURLContext

public JavaURLContext(JavaURLContext ctx,
                      SerialContext sctx)
Method Detail

lookup

public Object lookup(String name)
              throws NamingException
Lookup an object in the serial context.

Specified by:
lookup in interface Context
Returns:
the object that is being looked up.
Throws:
NamingException - if there is a naming exception.

lookup

public Object lookup(Name name)
              throws NamingException
Lookup a name in either the cosnaming or serial context.

Specified by:
lookup in interface Context
Returns:
the object that is being looked up.
Throws:
NamingException - if there is a naming exception.

bind

public void bind(String name,
                 Object obj)
          throws NamingException
Bind an object in the namespace. Binds the reference to the actual object in either the cosnaming or serial context.

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

bind

public void bind(Name name,
                 Object obj)
          throws NamingException
Bind an object in the namespace. Binds the reference to the actual object in either the cosnaming or serial context.

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

rebind

public void rebind(String name,
                   Object obj)
            throws NamingException
Rebind an object in the namespace. Rebinds the reference to the actual object in either the cosnaming or serial context.

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

rebind

public void rebind(Name name,
                   Object obj)
            throws NamingException
Rebind an object in the namespace. Rebinds the reference to the actual object in either the cosnaming or serial context.

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

unbind

public void unbind(String name)
            throws NamingException
Unbind an object from the namespace.

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

unbind

public void unbind(Name name)
            throws NamingException
Unbind an object from the namespace.

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

rename

public void rename(String oldname,
                   String newname)
            throws NamingException
The rename operation is not supported by this context. It throws an OperationNotSupportedException.

Specified by:
rename in interface Context
Throws:
NamingException

rename

public void rename(Name oldname,
                   Name newname)
            throws NamingException
The rename operation is not supported by this context. It throws an OperationNotSupportedException.

Specified by:
rename in interface Context
Throws:
NamingException

destroySubcontext

public void destroySubcontext(String name)
                       throws NamingException
The destroySubcontext operation is not supported by this context. It throws an OperationNotSupportedException.

Specified by:
destroySubcontext in interface Context
Throws:
NamingException

destroySubcontext

public void destroySubcontext(Name name)
                       throws NamingException
The destroySubcontext operation is not supported by this context. It throws an OperationNotSupportedException.

Specified by:
destroySubcontext in interface Context
Throws:
NamingException

createSubcontext

public Context createSubcontext(String name)
                         throws NamingException
Specified by:
createSubcontext in interface Context
Throws:
NamingException

createSubcontext

public Context createSubcontext(Name name)
                         throws NamingException
Specified by:
createSubcontext in interface Context
Throws:
NamingException

list

public NamingEnumeration<NameClassPair> list(String name)
                                      throws NamingException
Lists the contents of a context or subcontext. The operation is delegated to the serial context.

Specified by:
list in interface Context
Returns:
an enumeration of the contents of the context.
Throws:
NamingException - if there is a naming exception.

list

public NamingEnumeration<NameClassPair> list(Name name)
                                      throws NamingException
Lists the contents of a context or subcontext. The operation is delegated to the serial context.

Specified by:
list in interface Context
Returns:
an enumeration of the contents of the context.
Throws:
NamingException - if there is a naming exception.

listBindings

public NamingEnumeration<Binding> listBindings(String name)
                                        throws NamingException
Lists the bindings of a context or subcontext. The operation is delegated to the serial context.

Specified by:
listBindings in interface Context
Returns:
an enumeration of the bindings of the context.
Throws:
NamingException - if there is a naming exception.

listBindings

public NamingEnumeration<Binding> listBindings(Name name)
                                        throws NamingException
Lists the bindings of a context or subcontext. The operation is delegated to the serial context.

Specified by:
listBindings in interface Context
Returns:
an enumeration of the bindings of the context.
Throws:
NamingException - if there is a naming exception.

lookupLink

public Object lookupLink(String name)
                  throws NamingException
This context does not treat links specially. A lookup operation is performed.

Specified by:
lookupLink in interface Context
Throws:
NamingException

lookupLink

public Object lookupLink(Name name)
                  throws NamingException
This context does not treat links specially. A lookup operation is performed.

Specified by:
lookupLink in interface Context
Throws:
NamingException

getNameParser

public NameParser getNameParser(String name)
                         throws NamingException
Return the name parser for the specified name.

Specified by:
getNameParser in interface Context
Returns:
the NameParser instance.
Throws:
NamingException - if there is an exception.

getNameParser

public NameParser getNameParser(Name name)
                         throws NamingException
Return the name parser for the specified name.

Specified by:
getNameParser in interface Context
Returns:
the NameParser instance.
Throws:
NamingException - if there is an exception.

composeName

public String composeName(String name,
                          String prefix)
                   throws NamingException
Specified by:
composeName in interface Context
Throws:
NamingException

composeName

public Name composeName(Name name,
                        Name prefix)
                 throws NamingException
Specified by:
composeName in interface Context
Throws:
NamingException

addToEnvironment

public Object addToEnvironment(String propName,
                               Object propVal)
                        throws NamingException
Add a property to the environment.

Specified by:
addToEnvironment in interface Context
Throws:
NamingException

removeFromEnvironment

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

Specified by:
removeFromEnvironment in interface Context
Throws:
NamingException

getEnvironment

public Hashtable getEnvironment()
                         throws NamingException
Get the context's environment.

Specified by:
getEnvironment in interface Context
Throws:
NamingException

close

public void close()
           throws NamingException
New JNDI 1.2 operation.

Specified by:
close in interface Context
Throws:
NamingException

getNameInNamespace

public String getNameInNamespace()
                          throws NamingException
Return the name of this context within the namespace. The name can be passed as an argument to (new InitialContext()).lookup() to reproduce this context.

Specified by:
getNameInNamespace in interface Context
Throws:
NamingException


Copyright © 2012 GlassFish Community. All Rights Reserved.