Package com.sun.enterprise.naming.impl
Class JavaURLContext
- java.lang.Object
-
- com.sun.enterprise.naming.impl.JavaURLContext
-
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
Constructors Constructor Description JavaURLContext(JavaURLContext ctx, SerialContext sctx)JavaURLContext(String name, Hashtable env)Create a context with the specified name+environment.JavaURLContext(Hashtable environment)Create a context with the specified environment.JavaURLContext(Hashtable env, SerialContext serialContext)this constructor is called from SerialContext class
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectaddToEnvironment(String propName, Object propVal)Add a property to the environment.voidbind(String name, Object obj)Bind an object in the namespace.voidbind(Name name, Object obj)Bind an object in the namespace.voidclose()New JNDI 1.2 operation.StringcomposeName(String name, String prefix)NamecomposeName(Name name, Name prefix)ContextcreateSubcontext(String name)ContextcreateSubcontext(Name name)voiddestroySubcontext(String name)The destroySubcontext operation is not supported by this context.voiddestroySubcontext(Name name)The destroySubcontext operation is not supported by this context.HashtablegetEnvironment()Get the context's environment.StringgetNameInNamespace()Return the name of this context within the namespace.NameParsergetNameParser(String name)Return the name parser for the specified name.NameParsergetNameParser(Name name)Return the name parser for the specified name.NamingEnumeration<NameClassPair>list(String name)Lists the contents of a context or subcontext.NamingEnumeration<NameClassPair>list(Name name)Lists the contents of a context or subcontext.NamingEnumeration<Binding>listBindings(String name)Lists the bindings of a context or subcontext.NamingEnumeration<Binding>listBindings(Name name)Lists the bindings of a context or subcontext.Objectlookup(String name)Lookup an object in the serial context.Objectlookup(Name name)Lookup a name in either the cosnaming or serial context.ObjectlookupLink(String name)This context does not treat links specially.ObjectlookupLink(Name name)This context does not treat links specially.voidrebind(String name, Object obj)Rebind an object in the namespace.voidrebind(Name name, Object obj)Rebind an object in the namespace.ObjectremoveFromEnvironment(String propName)Remove a property from the environment.voidrename(String oldname, String newname)The rename operation is not supported by this context.voidrename(Name oldname, Name newname)The rename operation is not supported by this context.voidunbind(String name)Unbind an object from the namespace.voidunbind(Name name)Unbind an object from the namespace.
-
-
-
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:
lookupin interfaceContext- 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:
lookupin interfaceContext- 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:
bindin interfaceContext- 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:
bindin interfaceContext- 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:
rebindin interfaceContext- 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:
rebindin interfaceContext- Throws:
NamingException- if there is a naming exception.
-
unbind
public void unbind(String name) throws NamingException
Unbind an object from the namespace.- Specified by:
unbindin interfaceContext- Throws:
NamingException- if there is a naming exception.
-
unbind
public void unbind(Name name) throws NamingException
Unbind an object from the namespace.- Specified by:
unbindin interfaceContext- 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:
renamein interfaceContext- 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:
renamein interfaceContext- 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:
destroySubcontextin interfaceContext- 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:
destroySubcontextin interfaceContext- Throws:
NamingException
-
createSubcontext
public Context createSubcontext(String name) throws NamingException
- Specified by:
createSubcontextin interfaceContext- Throws:
NamingException
-
createSubcontext
public Context createSubcontext(Name name) throws NamingException
- Specified by:
createSubcontextin interfaceContext- 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:
listin interfaceContext- 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:
listin interfaceContext- 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:
listBindingsin interfaceContext- 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:
listBindingsin interfaceContext- 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:
lookupLinkin interfaceContext- Throws:
NamingException
-
lookupLink
public Object lookupLink(Name name) throws NamingException
This context does not treat links specially. A lookup operation is performed.- Specified by:
lookupLinkin interfaceContext- Throws:
NamingException
-
getNameParser
public NameParser getNameParser(String name) throws NamingException
Return the name parser for the specified name.- Specified by:
getNameParserin interfaceContext- 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:
getNameParserin interfaceContext- Returns:
- the NameParser instance.
- Throws:
NamingException- if there is an exception.
-
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 a property to the environment.- Specified by:
addToEnvironmentin interfaceContext- Throws:
NamingException
-
removeFromEnvironment
public Object removeFromEnvironment(String propName) throws NamingException
Remove a property from the environment.- Specified by:
removeFromEnvironmentin interfaceContext- Throws:
NamingException
-
getEnvironment
public Hashtable getEnvironment() throws NamingException
Get the context's environment.- Specified by:
getEnvironmentin interfaceContext- Throws:
NamingException
-
close
public void close() throws NamingExceptionNew JNDI 1.2 operation.- Specified by:
closein interfaceContext- 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:
getNameInNamespacein interfaceContext- Throws:
NamingException
-
-