interface JndiCallback<T : Any>
Callback interface to be implemented by classes that need to perform an operation (such as a lookup) in a JNDI context. This callback approach is valuable in simplifying error handling, which is performed by the JndiTemplate class. This is a similar to JdbcTemplate's approach. Note that there is hardly any need to implement this callback interface, as JndiTemplate provides all usual JNDI operations via convenience methods. |
|
open class JndiObjectFactoryBean : JndiObjectLocator, FactoryBean<Any>, BeanFactoryAware, BeanClassLoaderAware
org.springframework.beans.factory.FactoryBean that looks up a JNDI object. Exposes the object found in JNDI for bean references, e.g. for data access object's "dataSource" property in case of a javax.sql.DataSource. The typical usage will be to register this as singleton factory (e.g. for a certain JNDI-bound DataSource) in an application context, and give bean references to application services that need it. The default behavior is to look up the JNDI object on startup and cache it. This can be customized through the "lookupOnStartup" and "cache" properties, using a JndiObjectTargetSource underneath. Note that you need to specify a "proxyInterface" in such a scenario, since the actual JNDI object type is not known in advance. Of course, bean classes in a Spring environment may lookup e.g. a DataSource from JNDI themselves. This class simply enables central configuration of the JNDI name, and easy switching to non-JNDI alternatives. The latter is particularly convenient for test setups, reuse in standalone clients, etc. Note that switching to e.g. DriverManagerDataSource is just a matter of configuration: Simply replace the definition of this FactoryBean with a org.springframework.jdbc.datasource.DriverManagerDataSource definition! |
|
open class JndiObjectTargetSource : JndiObjectLocator, TargetSource
AOP org.springframework.aop.TargetSource that provides configurable JNDI lookups for Can be used as alternative to JndiObjectFactoryBean, to allow for relocating a JNDI object lazily or for each operation (see "lookupOnStartup" and "cache" properties). This is particularly useful during development, as it allows for hot restarting of the JNDI server (for example, a remote JMS server). Example: A createQueueConnection call on the "queueConnectionFactory" proxy will cause a lazy JNDI lookup for "JmsQueueConnectionFactory" and a subsequent delegating call to the retrieved QueueConnectionFactory's createQueueConnection .
Alternatively, use a JndiObjectFactoryBean with a "proxyInterface". "lookupOnStartup" and "cache" can then be specified on the JndiObjectFactoryBean, creating a JndiObjectTargetSource underneath (instead of defining separate ProxyFactoryBean and JndiObjectTargetSource beans). |
|
open class JndiPropertySource : PropertySource<JndiLocatorDelegate>
PropertySource implementation that reads properties from an underlying Spring JndiLocatorDelegate. By default, the underlying Note that org.springframework.web.context.support.StandardServletEnvironment includes a |
|
open class JndiTemplateEditor : PropertyEditorSupport
Properties editor for JndiTemplate objects. Allows properties of type JndiTemplate to be populated with a properties-format string. |
open class JndiLookupFailureException : NestedRuntimeException
RuntimeException to be thrown in case of JNDI lookup failures, in particular from code that does not declare JNDI's checked javax.naming.NamingException: for example, from Spring's JndiObjectTargetSource. |
|
open class TypeMismatchNamingException : NamingException
Exception thrown if a type mismatch is encountered for an object located in a JNDI environment. Thrown by JndiTemplate. |