@Deprecated 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()
Deprecated.
Create a new naming context.
|
SimpleNamingContext(String root)
Deprecated.
Create a new naming context with the given naming root.
|
SimpleNamingContext(String root,
Hashtable<String,Object> boundObjects,
Hashtable<String,Object> env)
Deprecated.
Create a new naming context with the given naming root,
the given name/object map, and the JNDI environment entries.
|
Modifier and Type | Method and Description |
---|---|
Object |
addToEnvironment(String propName,
Object propVal)
Deprecated.
|
void |
bind(Name name,
Object obj)
Deprecated.
|
void |
bind(String name,
Object obj)
Deprecated.
Bind the given object to the given name.
|
void |
close()
Deprecated.
|
Name |
composeName(Name name,
Name prefix)
Deprecated.
|
String |
composeName(String name,
String prefix)
Deprecated.
|
Context |
createSubcontext(Name name)
Deprecated.
|
Context |
createSubcontext(String name)
Deprecated.
|
void |
destroySubcontext(Name name)
Deprecated.
|
void |
destroySubcontext(String name)
Deprecated.
|
Hashtable<String,Object> |
getEnvironment()
Deprecated.
|
String |
getNameInNamespace()
Deprecated.
|
NameParser |
getNameParser(Name name)
Deprecated.
|
NameParser |
getNameParser(String name)
Deprecated.
|
NamingEnumeration<NameClassPair> |
list(Name name)
Deprecated.
|
NamingEnumeration<NameClassPair> |
list(String root)
Deprecated.
|
NamingEnumeration<Binding> |
listBindings(Name name)
Deprecated.
|
NamingEnumeration<Binding> |
listBindings(String root)
Deprecated.
|
Object |
lookup(Name name)
Deprecated.
|
Object |
lookup(String lookupName)
Deprecated.
Look up the object with the given name.
|
Object |
lookupLink(Name name)
Deprecated.
|
Object |
lookupLink(String name)
Deprecated.
|
void |
rebind(Name name,
Object obj)
Deprecated.
|
void |
rebind(String name,
Object obj)
Deprecated.
|
Object |
removeFromEnvironment(String propName)
Deprecated.
|
void |
rename(Name oldName,
Name newName)
Deprecated.
|
void |
rename(String oldName,
String newName)
Deprecated.
|
void |
unbind(Name name)
Deprecated.
|
void |
unbind(String name)
Deprecated.
|
public SimpleNamingContext()
public SimpleNamingContext(String root)
public NamingEnumeration<NameClassPair> list(String root) throws NamingException
list
in interface Context
NamingException
public NamingEnumeration<Binding> listBindings(String root) throws NamingException
listBindings
in interface Context
NamingException
public 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 Context
NameNotFoundException
- if the object could not be foundpublic Object lookupLink(String name) throws NameNotFoundException
lookupLink
in interface Context
NameNotFoundException
public void bind(String name, Object obj)
bind
in interface Context
SimpleNamingContextBuilder.bind(java.lang.String, java.lang.Object)
public void rename(String oldName, String newName) throws NameNotFoundException
rename
in interface Context
NameNotFoundException
public Context createSubcontext(String name)
createSubcontext
in interface Context
public void destroySubcontext(String name)
destroySubcontext
in interface Context
public String composeName(String name, String prefix)
composeName
in interface Context
public Hashtable<String,Object> getEnvironment()
getEnvironment
in interface Context
@Nullable public Object addToEnvironment(String propName, Object propVal)
addToEnvironment
in interface Context
public Object removeFromEnvironment(String propName)
removeFromEnvironment
in interface Context
public NamingEnumeration<NameClassPair> list(Name name) throws NamingException
list
in interface Context
NamingException
public NamingEnumeration<Binding> listBindings(Name name) throws NamingException
listBindings
in interface Context
NamingException
public Object lookup(Name name) throws NamingException
lookup
in interface Context
NamingException
public Object lookupLink(Name name) throws NamingException
lookupLink
in interface Context
NamingException
public void bind(Name name, Object obj) throws NamingException
bind
in interface Context
NamingException
public void unbind(Name name) throws NamingException
unbind
in interface Context
NamingException
public void rebind(Name name, Object obj) throws NamingException
rebind
in interface Context
NamingException
public void rename(Name oldName, Name newName) throws NamingException
rename
in interface Context
NamingException
public Context createSubcontext(Name name) throws NamingException
createSubcontext
in interface Context
NamingException
public void destroySubcontext(Name name) throws NamingException
destroySubcontext
in interface Context
NamingException
public String getNameInNamespace() throws NamingException
getNameInNamespace
in interface Context
NamingException
public NameParser getNameParser(Name name) throws NamingException
getNameParser
in interface Context
NamingException
public NameParser getNameParser(String name) throws NamingException
getNameParser
in interface Context
NamingException
public Name composeName(Name name, Name prefix) throws NamingException
composeName
in interface Context
NamingException