|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.jndi.JndiTemplate
org.springframework.mock.jndi.ExpectedLookupTemplate
Simple implementation of JndiTemplate interface that always returns a given object. Very useful for testing. Effectively a mock object.
DriverManagerDataSource
Field Summary |
Fields inherited from class org.springframework.jndi.JndiTemplate |
logger |
Constructor Summary | |
ExpectedLookupTemplate(java.lang.String name,
java.lang.Object object)
Construct a new JndiTemplate that will always return the given object, but honour only requests for the given name. |
Method Summary | |
java.lang.Object |
lookup(java.lang.String name)
If the name is the expected name specified in the constructor, return the object provided in the constructor. |
Methods inherited from class org.springframework.jndi.JndiTemplate |
bind, createInitialContext, execute, getEnvironment, rebind, setEnvironment, unbind |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExpectedLookupTemplate(java.lang.String name, java.lang.Object object)
name
- the name the client is expected to look upobject
- the object that will be returnedMethod Detail |
public java.lang.Object lookup(java.lang.String name) throws javax.naming.NamingException
lookup
in class JndiTemplate
name
- the JNDI name of the object
javax.naming.NamingException
- if there is no object with the given
name bound to JNDI
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |