|
|||||||||||
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 targetted at test environments, but also usable for standalone applications.
This class is not intended for direct usage by applications, although it can be used e.g. to override's JndiTemplate's createInitialContext method in unit tests. Use SimpleNamingContextBuilder 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(java.lang.String root)
Create a new naming context with the given naming root. |
|
SimpleNamingContext(java.lang.String root,
java.util.Hashtable boundObjects,
java.util.Hashtable environment)
Create a new naming context with the given naming root, the given name/object map, and the JNDI environment entries. |
Method Summary | |
java.lang.Object |
addToEnvironment(java.lang.String propName,
java.lang.Object propVal)
|
void |
bind(javax.naming.Name arg0,
java.lang.Object arg1)
|
void |
bind(java.lang.String name,
java.lang.Object obj)
Bind the given object to the given name. |
void |
close()
|
javax.naming.Name |
composeName(javax.naming.Name arg0,
javax.naming.Name arg1)
|
java.lang.String |
composeName(java.lang.String arg0,
java.lang.String arg1)
|
javax.naming.Context |
createSubcontext(javax.naming.Name arg0)
|
javax.naming.Context |
createSubcontext(java.lang.String name)
|
void |
destroySubcontext(javax.naming.Name arg0)
|
void |
destroySubcontext(java.lang.String name)
|
java.util.Hashtable |
getEnvironment()
|
java.lang.String |
getNameInNamespace()
|
javax.naming.NameParser |
getNameParser(javax.naming.Name arg0)
|
javax.naming.NameParser |
getNameParser(java.lang.String arg0)
|
javax.naming.NamingEnumeration |
list(javax.naming.Name arg0)
|
javax.naming.NamingEnumeration |
list(java.lang.String root)
|
javax.naming.NamingEnumeration |
listBindings(javax.naming.Name arg0)
|
javax.naming.NamingEnumeration |
listBindings(java.lang.String root)
|
java.lang.Object |
lookup(javax.naming.Name arg0)
|
java.lang.Object |
lookup(java.lang.String pname)
Look up the object with the given name. |
java.lang.Object |
lookupLink(javax.naming.Name arg0)
|
java.lang.Object |
lookupLink(java.lang.String name)
|
void |
rebind(javax.naming.Name arg0,
java.lang.Object arg1)
|
void |
rebind(java.lang.String name,
java.lang.Object obj)
|
java.lang.Object |
removeFromEnvironment(java.lang.String propName)
|
void |
rename(javax.naming.Name arg0,
javax.naming.Name arg1)
|
void |
rename(java.lang.String oldName,
java.lang.String newName)
|
void |
unbind(javax.naming.Name arg0)
|
void |
unbind(java.lang.String name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleNamingContext()
public SimpleNamingContext(java.lang.String root)
public SimpleNamingContext(java.lang.String root, java.util.Hashtable boundObjects, java.util.Hashtable environment)
Method Detail |
public javax.naming.NamingEnumeration list(java.lang.String root) throws javax.naming.NamingException
list
in interface javax.naming.Context
javax.naming.NamingException
public javax.naming.NamingEnumeration listBindings(java.lang.String root) throws javax.naming.NamingException
listBindings
in interface javax.naming.Context
javax.naming.NamingException
public java.lang.Object lookup(java.lang.String pname) throws javax.naming.NameNotFoundException
lookup
in interface javax.naming.Context
javax.naming.NameNotFoundException
- if the object could not be foundpublic java.lang.Object lookupLink(java.lang.String name) throws javax.naming.NameNotFoundException
lookupLink
in interface javax.naming.Context
javax.naming.NameNotFoundException
public void bind(java.lang.String name, java.lang.Object obj)
bind
in interface javax.naming.Context
SimpleNamingContextBuilder.bind(java.lang.String, java.lang.Object)
public void unbind(java.lang.String name)
unbind
in interface javax.naming.Context
public void rebind(java.lang.String name, java.lang.Object obj)
rebind
in interface javax.naming.Context
public void rename(java.lang.String oldName, java.lang.String newName) throws javax.naming.NameNotFoundException
rename
in interface javax.naming.Context
javax.naming.NameNotFoundException
public javax.naming.Context createSubcontext(java.lang.String name)
createSubcontext
in interface javax.naming.Context
public void destroySubcontext(java.lang.String name)
destroySubcontext
in interface javax.naming.Context
public java.util.Hashtable getEnvironment()
getEnvironment
in interface javax.naming.Context
public java.lang.Object addToEnvironment(java.lang.String propName, java.lang.Object propVal)
addToEnvironment
in interface javax.naming.Context
public java.lang.Object removeFromEnvironment(java.lang.String propName)
removeFromEnvironment
in interface javax.naming.Context
public void close()
close
in interface javax.naming.Context
public javax.naming.NamingEnumeration list(javax.naming.Name arg0)
list
in interface javax.naming.Context
public javax.naming.NamingEnumeration listBindings(javax.naming.Name arg0)
listBindings
in interface javax.naming.Context
public java.lang.Object lookup(javax.naming.Name arg0)
lookup
in interface javax.naming.Context
public java.lang.Object lookupLink(javax.naming.Name arg0)
lookupLink
in interface javax.naming.Context
public void bind(javax.naming.Name arg0, java.lang.Object arg1)
bind
in interface javax.naming.Context
public void unbind(javax.naming.Name arg0)
unbind
in interface javax.naming.Context
public void rebind(javax.naming.Name arg0, java.lang.Object arg1)
rebind
in interface javax.naming.Context
public void rename(javax.naming.Name arg0, javax.naming.Name arg1)
rename
in interface javax.naming.Context
public javax.naming.Context createSubcontext(javax.naming.Name arg0)
createSubcontext
in interface javax.naming.Context
public void destroySubcontext(javax.naming.Name arg0)
destroySubcontext
in interface javax.naming.Context
public java.lang.String getNameInNamespace()
getNameInNamespace
in interface javax.naming.Context
public javax.naming.NameParser getNameParser(javax.naming.Name arg0)
getNameParser
in interface javax.naming.Context
public javax.naming.NameParser getNameParser(java.lang.String arg0)
getNameParser
in interface javax.naming.Context
public javax.naming.Name composeName(javax.naming.Name arg0, javax.naming.Name arg1)
composeName
in interface javax.naming.Context
public java.lang.String composeName(java.lang.String arg0, java.lang.String arg1)
composeName
in interface javax.naming.Context
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |