org.springframework.jndi
Class JndiLocatorDelegate
java.lang.Object
org.springframework.jndi.JndiAccessor
org.springframework.jndi.JndiLocatorSupport
org.springframework.jndi.JndiLocatorDelegate
public class JndiLocatorDelegate
- extends JndiLocatorSupport
JndiLocatorSupport
subclass with public lookup methods,
for convenient use as a delegate.
- Since:
- 3.0.1
- Author:
- Juergen Hoeller
Method Summary |
static JndiLocatorDelegate |
createDefaultResourceRefLocator()
Configure a JndiLocatorDelegate with its "resourceRef" property set to
true , meaning that all names will be prefixed with "java:comp/env/". |
static boolean |
isDefaultJndiEnvironmentAvailable()
Check whether a default JNDI environment, as in a J2EE environment,
is available on this JVM. |
java.lang.Object |
lookup(java.lang.String jndiName)
Perform an actual JNDI lookup for the given name via the JndiTemplate. |
|
lookup(java.lang.String jndiName,
java.lang.Class<T> requiredType)
Perform an actual JNDI lookup for the given name via the JndiTemplate. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JndiLocatorDelegate
public JndiLocatorDelegate()
lookup
public java.lang.Object lookup(java.lang.String jndiName)
throws javax.naming.NamingException
- Description copied from class:
JndiLocatorSupport
- Perform an actual JNDI lookup for the given name via the JndiTemplate.
If the name doesn't begin with "java:comp/env/", this prefix is added
if "resourceRef" is set to "true".
- Overrides:
lookup
in class JndiLocatorSupport
- Parameters:
jndiName
- the JNDI name to look up
- Returns:
- the obtained object
- Throws:
javax.naming.NamingException
- if the JNDI lookup failed- See Also:
JndiLocatorSupport.setResourceRef(boolean)
lookup
public <T> T lookup(java.lang.String jndiName,
java.lang.Class<T> requiredType)
throws javax.naming.NamingException
- Description copied from class:
JndiLocatorSupport
- Perform an actual JNDI lookup for the given name via the JndiTemplate.
If the name doesn't begin with "java:comp/env/", this prefix is added
if "resourceRef" is set to "true".
- Overrides:
lookup
in class JndiLocatorSupport
- Parameters:
jndiName
- the JNDI name to look uprequiredType
- the required type of the object
- Returns:
- the obtained object
- Throws:
javax.naming.NamingException
- if the JNDI lookup failed- See Also:
JndiLocatorSupport.setResourceRef(boolean)
createDefaultResourceRefLocator
public static JndiLocatorDelegate createDefaultResourceRefLocator()
- Configure a
JndiLocatorDelegate
with its "resourceRef" property set to
true
, meaning that all names will be prefixed with "java:comp/env/".
- See Also:
JndiLocatorSupport.setResourceRef(boolean)
isDefaultJndiEnvironmentAvailable
public static boolean isDefaultJndiEnvironmentAvailable()
- Check whether a default JNDI environment, as in a J2EE environment,
is available on this JVM.
- Returns:
true
if a default InitialContext can be used,
false
if not