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