Package org.springframework.mock.jndi
Class SimpleNamingContext
- java.lang.Object
- org.springframework.mock.jndi.SimpleNamingContext
- All Implemented Interfaces:
Context
@Deprecated public class SimpleNamingContext extends Object implements Context
Deprecated.Deprecated as of Spring Framework 5.2 in favor of complete solutions from third parties such as Simple-JNDISimple implementation of a JNDI naming context. Only supports binding plain Objects to String names. Mainly for test environments, but also usable for standalone applications.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.- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
SimpleNamingContextBuilder
,JndiTemplate.createInitialContext()
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 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.
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Object
addToEnvironment(String propName, Object propVal)
Deprecated.void
bind(String name, Object obj)
Deprecated.Bind the given object to the given name.void
bind(Name name, Object obj)
Deprecated.void
close()
Deprecated.String
composeName(String name, String prefix)
Deprecated.Name
composeName(Name name, Name prefix)
Deprecated.Context
createSubcontext(String name)
Deprecated.Context
createSubcontext(Name name)
Deprecated.void
destroySubcontext(String name)
Deprecated.void
destroySubcontext(Name name)
Deprecated.Hashtable<String,Object>
getEnvironment()
Deprecated.String
getNameInNamespace()
Deprecated.NameParser
getNameParser(String name)
Deprecated.NameParser
getNameParser(Name name)
Deprecated.NamingEnumeration<NameClassPair>
list(String root)
Deprecated.NamingEnumeration<NameClassPair>
list(Name name)
Deprecated.NamingEnumeration<Binding>
listBindings(String root)
Deprecated.NamingEnumeration<Binding>
listBindings(Name name)
Deprecated.Object
lookup(String lookupName)
Deprecated.Look up the object with the given name.Object
lookup(Name name)
Deprecated.Object
lookupLink(String name)
Deprecated.Object
lookupLink(Name name)
Deprecated.void
rebind(String name, Object obj)
Deprecated.void
rebind(Name name, Object obj)
Deprecated.Object
removeFromEnvironment(String propName)
Deprecated.void
rename(String oldName, String newName)
Deprecated.void
rename(Name oldName, Name newName)
Deprecated.void
unbind(String name)
Deprecated.void
unbind(Name name)
Deprecated.
Constructor Detail
SimpleNamingContext
public SimpleNamingContext()
Deprecated.Create a new naming context.
SimpleNamingContext
public SimpleNamingContext(String root)
Deprecated.Create a new naming context with the given naming root.
Method Detail
list
public NamingEnumeration<NameClassPair> list(String root) throws NamingException
Deprecated.- Specified by:
list
in interfaceContext
- Throws:
NamingException
listBindings
public NamingEnumeration<Binding> listBindings(String root) throws NamingException
Deprecated.- Specified by:
listBindings
in interfaceContext
- Throws:
NamingException
lookup
public Object lookup(String lookupName) throws NameNotFoundException
Deprecated.Look up the object with the given name.Note: Not intended for direct use by applications. Will be used by any standard InitialContext JNDI lookups.
- Specified by:
lookup
in interfaceContext
- Throws:
NameNotFoundException
- if the object could not be found
lookupLink
public Object lookupLink(String name) throws NameNotFoundException
Deprecated.- Specified by:
lookupLink
in interfaceContext
- Throws:
NameNotFoundException
bind
public void bind(String name, Object obj)
Deprecated.Bind the given object to the given name. Note: Not intended for direct use by applications if setting up a JVM-level JNDI environment. Use SimpleNamingContextBuilder to set up JNDI bindings then.- Specified by:
bind
in interfaceContext
- See Also:
SimpleNamingContextBuilder.bind(java.lang.String, java.lang.Object)
rename
public void rename(String oldName, String newName) throws NameNotFoundException
Deprecated.- Specified by:
rename
in interfaceContext
- Throws:
NameNotFoundException
createSubcontext
public Context createSubcontext(String name)
Deprecated.- Specified by:
createSubcontext
in interfaceContext
destroySubcontext
public void destroySubcontext(String name)
Deprecated.- Specified by:
destroySubcontext
in interfaceContext
composeName
public String composeName(String name, String prefix)
Deprecated.- Specified by:
composeName
in interfaceContext
getEnvironment
public Hashtable<String,Object> getEnvironment()
Deprecated.- Specified by:
getEnvironment
in interfaceContext
addToEnvironment
@Nullable public Object addToEnvironment(String propName, Object propVal)
Deprecated.- Specified by:
addToEnvironment
in interfaceContext
removeFromEnvironment
public Object removeFromEnvironment(String propName)
Deprecated.- Specified by:
removeFromEnvironment
in interfaceContext
list
public NamingEnumeration<NameClassPair> list(Name name) throws NamingException
Deprecated.- Specified by:
list
in interfaceContext
- Throws:
NamingException
listBindings
public NamingEnumeration<Binding> listBindings(Name name) throws NamingException
Deprecated.- Specified by:
listBindings
in interfaceContext
- Throws:
NamingException
lookup
public Object lookup(Name name) throws NamingException
Deprecated.- Specified by:
lookup
in interfaceContext
- Throws:
NamingException
lookupLink
public Object lookupLink(Name name) throws NamingException
Deprecated.- Specified by:
lookupLink
in interfaceContext
- Throws:
NamingException
bind
public void bind(Name name, Object obj) throws NamingException
Deprecated.- Specified by:
bind
in interfaceContext
- Throws:
NamingException
unbind
public void unbind(Name name) throws NamingException
Deprecated.- Specified by:
unbind
in interfaceContext
- Throws:
NamingException
rebind
public void rebind(Name name, Object obj) throws NamingException
Deprecated.- Specified by:
rebind
in interfaceContext
- Throws:
NamingException
rename
public void rename(Name oldName, Name newName) throws NamingException
Deprecated.- Specified by:
rename
in interfaceContext
- Throws:
NamingException
createSubcontext
public Context createSubcontext(Name name) throws NamingException
Deprecated.- Specified by:
createSubcontext
in interfaceContext
- Throws:
NamingException
destroySubcontext
public void destroySubcontext(Name name) throws NamingException
Deprecated.- Specified by:
destroySubcontext
in interfaceContext
- Throws:
NamingException
getNameInNamespace
public String getNameInNamespace() throws NamingException
Deprecated.- Specified by:
getNameInNamespace
in interfaceContext
- Throws:
NamingException
getNameParser
public NameParser getNameParser(Name name) throws NamingException
Deprecated.- Specified by:
getNameParser
in interfaceContext
- Throws:
NamingException
getNameParser
public NameParser getNameParser(String name) throws NamingException
Deprecated.- Specified by:
getNameParser
in interfaceContext
- Throws:
NamingException
composeName
public Name composeName(Name name, Name prefix) throws NamingException
Deprecated.- Specified by:
composeName
in interfaceContext
- Throws:
NamingException