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.
Constructor and Description |
---|
ResourceAdapterFactoryBean() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Builds the BootstrapContext and starts the ResourceAdapter with it.
|
void |
destroy()
Stops the ResourceAdapter.
|
ResourceAdapter |
getObject() |
Class<? extends ResourceAdapter> |
getObjectType() |
boolean |
isSingleton() |
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.
|
public void setResourceAdapterClass(Class<? extends ResourceAdapter> resourceAdapterClass)
Alternatively, specify a pre-configured ResourceAdapter instance through the "resourceAdapter" property.
public void setResourceAdapter(ResourceAdapter resourceAdapter)
public void setBootstrapContext(BootstrapContext bootstrapContext)
Alternatively, you can specify the individual parts (such as the JCA WorkManager) as individual references.
public void setWorkManager(WorkManager workManager)
public void setXaTerminator(XATerminator xaTerminator)
public void afterPropertiesSet() throws ResourceException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
ResourceException
ResourceAdapter.start(javax.resource.spi.BootstrapContext)
@Nullable public ResourceAdapter getObject()
getObject
in interface org.springframework.beans.factory.FactoryBean<ResourceAdapter>
public Class<? extends ResourceAdapter> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<ResourceAdapter>
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<ResourceAdapter>
public void destroy()
destroy
in interface org.springframework.beans.factory.DisposableBean
ResourceAdapter.stop()