|
The Spring Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.mock.jndi.SimpleNamingContext
Simple 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.
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 | |
|---|---|
SimpleNamingContext()
Create a new naming context. |
|
SimpleNamingContext(String root)
Create a new naming context with the given naming root. |
|
SimpleNamingContext(String root,
Hashtable boundObjects,
Hashtable environment)
Create a new naming context with the given naming root, the given name/object map, and the JNDI environment entries. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleNamingContext()
public SimpleNamingContext(String root)
public SimpleNamingContext(String root, Hashtable boundObjects, Hashtable environment)
| Method Detail |
|---|
public NamingEnumeration list(String root) throws NamingException
NamingExceptionpublic NamingEnumeration listBindings(String root) throws NamingException
listBindings in interface ContextNamingExceptionpublic Object lookup(String pname) throws NameNotFoundException
NameNotFoundException - if the object could not be foundpublic Object lookupLink(String name) throws NameNotFoundException
lookupLink in interface ContextNameNotFoundExceptionpublic void bind(String name, Object obj)
public void unbind(String name)
public void rebind(String name, Object obj)
public void rename(String oldName, String newName) throws NameNotFoundException
NameNotFoundExceptionpublic 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 getEnvironment()
getEnvironment in interface Contextpublic Object addToEnvironment(String propName, Object propVal)
addToEnvironment in interface Contextpublic Object removeFromEnvironment(String propName)
removeFromEnvironment in interface Contextpublic void close()
public NamingEnumeration list(Name name) throws NamingException
NamingExceptionpublic NamingEnumeration listBindings(Name name) throws NamingException
listBindings in interface ContextNamingExceptionpublic Object lookup(Name name) throws NamingException
NamingExceptionpublic Object lookupLink(Name name) throws NamingException
lookupLink in interface ContextNamingExceptionpublic void bind(Name name, Object obj) throws NamingException
NamingExceptionpublic void unbind(Name name) throws NamingException
NamingExceptionpublic void rebind(Name name, Object obj) throws NamingException
NamingExceptionpublic void rename(Name oldName, Name newName) throws NamingException
NamingExceptionpublic 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
|
The Spring Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||