| java.lang.Object org.springframework.jndi.JndiAccessor org.springframework.jndi.JndiLocatorSupport
All known Subclasses: org.springframework.scheduling.commonj.TimerManagerFactoryBean, org.springframework.scheduling.commonj.WorkManagerTaskExecutor, org.springframework.jndi.support.SimpleJndiBeanFactory, org.springframework.context.access.ContextJndiBeanFactoryLocator, org.springframework.jndi.JndiObjectLocator, org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup, org.springframework.jmx.support.WebLogicJndiMBeanServerFactoryBean, org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor, org.springframework.jms.support.destination.JndiDestinationResolver,
JndiLocatorSupport | abstract public class JndiLocatorSupport extends JndiAccessor (Code) | | Convenient superclass for classes that can locate any number of JNDI objects.
Derives from JndiAccessor to inherit the "jndiTemplate" and "jndiEnvironment"
bean properties.
JNDI names may or may not include the "java:comp/env/" prefix expected
by J2EE applications when accessing a locally mapped (ENC - Environmental
Naming Context) resource. If it doesn't, the "java:comp/env/" prefix will
be prepended if the "resourceRef" property is true (the default is
false) and no other scheme (e.g. "java:") is given.
author: Juergen Hoeller since: 1.1 See Also: JndiLocatorSupport.setJndiTemplate See Also: JndiLocatorSupport.setJndiEnvironment See Also: JndiLocatorSupport.setResourceRef |
Method Summary | |
protected String | convertJndiName(String jndiName) Convert the given JNDI name into the actual JNDI name to use.
The default implementation applies the "java:comp/env/" prefix if
"resourceRef" is "true" and no other scheme (e.g. | public boolean | isResourceRef() Return whether the lookup occurs in a J2EE container. | protected Object | lookup(String jndiName) Perform an actual JNDI lookup for the given name via the JndiTemplate. | protected Object | lookup(String jndiName, Class requiredType) Perform an actual JNDI lookup for the given name via the JndiTemplate. | public void | setResourceRef(boolean resourceRef) Set whether the lookup occurs in a J2EE container, i.e. |
CONTAINER_PREFIX | final public static String CONTAINER_PREFIX(Code) | | JNDI prefix used in a J2EE container
|
isResourceRef | public boolean isResourceRef()(Code) | | Return whether the lookup occurs in a J2EE container.
|
lookup | protected Object lookup(String jndiName) throws NamingException(Code) | | 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".
Parameters: jndiName - the JNDI name to look up the obtained object throws: NamingException - if the JNDI lookup failed See Also: JndiLocatorSupport.setResourceRef |
lookup | protected Object lookup(String jndiName, Class requiredType) throws NamingException(Code) | | 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".
Parameters: jndiName - the JNDI name to look up Parameters: requiredType - the required type of the object the obtained object throws: NamingException - if the JNDI lookup failed See Also: JndiLocatorSupport.setResourceRef |
setResourceRef | public void setResourceRef(boolean resourceRef)(Code) | | Set whether the lookup occurs in a J2EE container, i.e. if the prefix
"java:comp/env/" needs to be added if the JNDI name doesn't already
contain it. Default is "false".
Note: Will only get applied if no other scheme (e.g. "java:") is given.
|
Fields inherited from org.springframework.jndi.JndiAccessor | final protected Log logger(Code)(Java Doc)
|
|
|