Package org.springframework.jca.support
Class ResourceAdapterFactoryBean
java.lang.Object
org.springframework.jca.support.ResourceAdapterFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.FactoryBean<ResourceAdapter>
,org.springframework.beans.factory.InitializingBean
public class ResourceAdapterFactoryBean
extends Object
implements org.springframework.beans.factory.FactoryBean<ResourceAdapter>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
FactoryBean
that bootstraps
the specified JCA 1.7 ResourceAdapter
,
starting it with a local BootstrapContext
and exposing it for bean references. It will also stop the ResourceAdapter
on context shutdown. This corresponds to 'non-managed' bootstrap in a
local environment, according to the JCA 1.7 specification.
This is essentially an adapter for bean-style bootstrapping of a JCA ResourceAdapter, allowing the BootstrapContext or its elements (such as the JCA WorkManager) to be specified through bean properties.
- Since:
- 2.0.3
- Author:
- Juergen Hoeller
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Builds the BootstrapContext and starts the ResourceAdapter with it.void
destroy()
Stops the ResourceAdapter.Class<? extends ResourceAdapter>
boolean
void
setBootstrapContext
(BootstrapContext bootstrapContext) Specify the JCA BootstrapContext to use for starting the ResourceAdapter.void
setResourceAdapter
(ResourceAdapter resourceAdapter) Specify the target JCA ResourceAdapter, passed in as configured instance which hasn't been started yet.void
setResourceAdapterClass
(Class<? extends ResourceAdapter> resourceAdapterClass) Specify the target JCA ResourceAdapter as class, to be instantiated with its default configuration.void
setWorkManager
(WorkManager workManager) Specify the JCA WorkManager to use for bootstrapping the ResourceAdapter.void
setXaTerminator
(XATerminator xaTerminator) Specify the JCA XATerminator to use for bootstrapping the ResourceAdapter.
-
Constructor Details
-
ResourceAdapterFactoryBean
public ResourceAdapterFactoryBean()
-
-
Method Details
-
setResourceAdapterClass
Specify the target JCA ResourceAdapter as class, to be instantiated with its default configuration.Alternatively, specify a pre-configured ResourceAdapter instance through the "resourceAdapter" property.
-
setResourceAdapter
Specify the target JCA ResourceAdapter, passed in as configured instance which hasn't been started yet. This will typically happen as an inner bean definition, configuring the ResourceAdapter instance through its vendor-specific bean properties. -
setBootstrapContext
Specify the JCA BootstrapContext to use for starting the ResourceAdapter.Alternatively, you can specify the individual parts (such as the JCA WorkManager) as individual references.
-
setWorkManager
Specify the JCA WorkManager to use for bootstrapping the ResourceAdapter. -
setXaTerminator
Specify the JCA XATerminator to use for bootstrapping the ResourceAdapter. -
afterPropertiesSet
Builds the BootstrapContext and starts the ResourceAdapter with it.- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
ResourceException
- See Also:
-
getObject
- Specified by:
getObject
in interfaceorg.springframework.beans.factory.FactoryBean<ResourceAdapter>
-
getObjectType
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<ResourceAdapter>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceorg.springframework.beans.factory.FactoryBean<ResourceAdapter>
-
destroy
public void destroy()Stops the ResourceAdapter.- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- See Also:
-