org.springframework.jca.context
Class SpringContextResourceAdapter

JCA 1.5 ResourceAdapter implementation
that loads a Spring ApplicationContext,
starting and stopping Spring-managed beans as part of the ResourceAdapter's
lifecycle.

Ideal for application contexts that do not need any HTTP entry points
but rather just consist of message endpoints and scheduled jobs etc.
Beans in such a context may use application server resources such as the
JTA transaction manager and JNDI-bound JDBC DataSources and JMS
ConnectionFactory instances, and may also register with the platform's
JMX server - all through Spring's standard transaction management and
JNDI and JMX support facilities.

If the need for scheduling asynchronous work arises, consider using
Spring's WorkManagerTaskExecutor
as a standard bean definition, to be injected into application beans
through dependency injection. This WorkManagerTaskExecutor will automatically
use the JCA WorkManager from the BootstrapContext that has been provided
to this ResourceAdapter.

The JCA BootstrapContext may also be
accessed directly, through application components that implement the
BootstrapContextAware interface. When deployed using this
ResourceAdapter, the BootstrapContext is guaranteed to be passed on
to such components.

This ResourceAdapter is to be defined in a "META-INF/ra.xml" file
within a J2EE ".rar" deployment unit like as follows:

Note that "META-INF/applicationContext.xml" is the default context config
location, so it doesn't have to specified unless you intend to specify
different/additional config files. So in the default case, you may remove
the entire config-property section above.

For simple deployment needs, all you need to do is the following:
Package all application classes into a RAR file (which is just a standard
JAR file with a different file extension), add all required library jars
into the root of the RAR archive, add a "META-INF/ra.xml" deployment
descriptor as shown above as well as the corresponding Spring XML bean
definition file(s) (typically "META-INF/applicationContext.xml"),
and drop the resulting RAR file into your application server's
deployment directory!

SpringContextResourceAdapter

setContextConfigLocation

Set the location of the context configuration files, within the
resource adapter's deployment unit. This can be a delimited
String that consists of multiple resource location, separated
by commas, semicolons, whitespace, or line breaks.

This can be specified as "ContextConfigLocation" config
property in the ra.xml deployment descriptor.