public class SimpleNamingContext extends Object implements Context
This class is not intended for direct usage by applications, although it
can be used for example to override JndiTemplate's createInitialContext
method in unit tests. Typically, SimpleNamingContextBuilder will be used to
set up a JVM-level JNDI environment.
SimpleNamingContextBuilder,
JndiTemplate.createInitialContext()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 and Description |
|---|
SimpleNamingContext()
Create a new naming context.
|
SimpleNamingContext(String root)
Create a new naming context with the given naming root.
|
SimpleNamingContext(String root,
Hashtable<String,Object> boundObjects,
Hashtable<String,Object> env)
Create a new naming context with the given naming root,
the given name/object map, and the JNDI environment entries.
|
public SimpleNamingContext()
public SimpleNamingContext(String root)
public NamingEnumeration<NameClassPair> list(String root) throws NamingException
list in interface ContextNamingExceptionpublic NamingEnumeration<Binding> listBindings(String root) throws NamingException
listBindings in interface ContextNamingExceptionpublic Object lookup(String lookupName) throws NameNotFoundException
Note: Not intended for direct use by applications. Will be used by any standard InitialContext JNDI lookups.
lookup in interface ContextNameNotFoundException - if the object could not be foundpublic Object lookupLink(String name) throws NameNotFoundException
lookupLink in interface ContextNameNotFoundExceptionpublic void bind(String name, Object obj)
bind in interface ContextSimpleNamingContextBuilder.bind(java.lang.String, java.lang.Object)public void rename(String oldName, String newName) throws NameNotFoundException
rename in interface ContextNameNotFoundExceptionpublic Context createSubcontext(String name)
createSubcontext in interface Contextpublic void destroySubcontext(String name)
destroySubcontext in interface Contextpublic String composeName(String name, String prefix)
composeName in interface Contextpublic Hashtable<String,Object> getEnvironment()
getEnvironment in interface Contextpublic Object addToEnvironment(String propName, Object propVal)
addToEnvironment in interface Contextpublic Object removeFromEnvironment(String propName)
removeFromEnvironment in interface Contextpublic NamingEnumeration<NameClassPair> list(Name name) throws NamingException
list in interface ContextNamingExceptionpublic NamingEnumeration<Binding> listBindings(Name name) throws NamingException
listBindings in interface ContextNamingExceptionpublic Object lookup(Name name) throws NamingException
lookup in interface ContextNamingExceptionpublic Object lookupLink(Name name) throws NamingException
lookupLink in interface ContextNamingExceptionpublic void bind(Name name, Object obj) throws NamingException
bind in interface ContextNamingExceptionpublic void unbind(Name name) throws NamingException
unbind in interface ContextNamingExceptionpublic void rebind(Name name, Object obj) throws NamingException
rebind in interface ContextNamingExceptionpublic void rename(Name oldName, Name newName) throws NamingException
rename in interface ContextNamingExceptionpublic Context createSubcontext(Name name) throws NamingException
createSubcontext in interface ContextNamingExceptionpublic void destroySubcontext(Name name) throws NamingException
destroySubcontext in interface ContextNamingExceptionpublic String getNameInNamespace() throws NamingException
getNameInNamespace in interface ContextNamingExceptionpublic NameParser getNameParser(Name name) throws NamingException
getNameParser in interface ContextNamingExceptionpublic NameParser getNameParser(String name) throws NamingException
getNameParser in interface ContextNamingExceptionpublic Name composeName(Name name, Name prefix) throws NamingException
composeName in interface ContextNamingException