类 AbstractMessageEndpointFactory
- java.lang.Object
- org.springframework.jca.endpoint.AbstractMessageEndpointFactory
- 所有已实现的接口:
MessageEndpointFactory
,Aware
,BeanNameAware
public abstract class AbstractMessageEndpointFactory extends Object implements MessageEndpointFactory, BeanNameAware
Abstract base implementation of the JCA 1.7MessageEndpointFactory
interface, providing transaction management capabilities as well as ClassLoader exposure for endpoint invocations.- 从以下版本开始:
- 2.5
- 作者:
- Juergen Hoeller
- 另请参阅:
setTransactionManager(java.lang.Object)
嵌套类概要
嵌套类 修饰符和类型 类 说明 protected class
AbstractMessageEndpointFactory.AbstractMessageEndpoint
Inner class for actual endpoint implementations, based on template method to allow for any kind of concrete endpoint implementation.
构造器概要
构造器 构造器 说明 AbstractMessageEndpointFactory()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 MessageEndpoint
createEndpoint(XAResource xaResource)
The standard JCA 1.5 version ofcreateEndpoint
.MessageEndpoint
createEndpoint(XAResource xaResource, long timeout)
The alternative JCA 1.6 version ofcreateEndpoint
.protected abstract AbstractMessageEndpointFactory.AbstractMessageEndpoint
createEndpointInternal()
Create the actual endpoint instance, as a subclass of theAbstractMessageEndpointFactory.AbstractMessageEndpoint
inner class of this factory.String
getActivationName()
Implementation of the JCA 1.7#getActivationName()
method, returning the bean name as set on this MessageEndpointFactory.Class<?>
getEndpointClass()
Implementation of the JCA 1.7#getEndpointClass()
method, returning null in order to indicate a synthetic endpoint type.boolean
isDeliveryTransacted(Method method)
This implementation returnstrue
if a transaction manager has been specified;false
otherwise.void
setBeanName(String beanName)
Set the name of this message endpoint.void
setTransactionFactory(TransactionFactory transactionFactory)
Set the Spring TransactionFactory to use for wrapping endpoint invocations, enlisting the endpoint resource in each such transaction.void
setTransactionManager(Object transactionManager)
Set the XA transaction manager to use for wrapping endpoint invocations, enlisting the endpoint resource in each such transaction.void
setTransactionName(String transactionName)
Specify the name of the transaction, if any.void
setTransactionTimeout(int transactionTimeout)
Specify the transaction timeout, if any.
构造器详细资料
AbstractMessageEndpointFactory
public AbstractMessageEndpointFactory()
方法详细资料
setTransactionManager
public void setTransactionManager(Object transactionManager)
Set the XA transaction manager to use for wrapping endpoint invocations, enlisting the endpoint resource in each such transaction.The passed-in object may be a transaction manager which implements Spring's
TransactionFactory
interface, or a plainTransactionManager
.If no transaction manager is specified, the endpoint invocation will simply not be wrapped in an XA transaction. Check out your resource provider's ActivationSpec documentation for local transaction options of your particular provider.
setTransactionFactory
public void setTransactionFactory(TransactionFactory transactionFactory)
Set the Spring TransactionFactory to use for wrapping endpoint invocations, enlisting the endpoint resource in each such transaction.Alternatively, specify an appropriate transaction manager through the
"transactionManager"
property.If no transaction factory is specified, the endpoint invocation will simply not be wrapped in an XA transaction. Check out your resource provider's ActivationSpec documentation for local transaction options of your particular provider.
setTransactionName
public void setTransactionName(String transactionName)
Specify the name of the transaction, if any.Default is none. A specified name will be passed on to the transaction manager, allowing to identify the transaction in a transaction monitor.
setTransactionTimeout
public void setTransactionTimeout(int transactionTimeout)
Specify the transaction timeout, if any.Default is -1: rely on the transaction manager's default timeout. Specify a concrete timeout to restrict the maximum duration of each endpoint invocation.
setBeanName
public void setBeanName(String beanName)
Set the name of this message endpoint. Populated with the bean name automatically when defined within Spring's bean factory.- 指定者:
setBeanName
在接口中BeanNameAware
- 参数:
beanName
- the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use theBeanFactoryUtils.originalBeanName(String)
method to extract the original bean name (without suffix), if desired.
getActivationName
@Nullable public String getActivationName()
Implementation of the JCA 1.7#getActivationName()
method, returning the bean name as set on this MessageEndpointFactory.
getEndpointClass
@Nullable public Class<?> getEndpointClass()
Implementation of the JCA 1.7#getEndpointClass()
method, returning null in order to indicate a synthetic endpoint type.- 指定者:
getEndpointClass
在接口中MessageEndpointFactory
isDeliveryTransacted
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException
This implementation returnstrue
if a transaction manager has been specified;false
otherwise.
createEndpoint
public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException
The standard JCA 1.5 version ofcreateEndpoint
.This implementation delegates to
createEndpointInternal()
, initializing the endpoint's XAResource before the endpoint gets invoked.
createEndpoint
public MessageEndpoint createEndpoint(XAResource xaResource, long timeout) throws UnavailableException
The alternative JCA 1.6 version ofcreateEndpoint
.This implementation delegates to
createEndpointInternal()
, ignoring the specified timeout. It is only here for JCA 1.6 compliance.
createEndpointInternal
protected abstract AbstractMessageEndpointFactory.AbstractMessageEndpoint createEndpointInternal() throws UnavailableException
Create the actual endpoint instance, as a subclass of theAbstractMessageEndpointFactory.AbstractMessageEndpoint
inner class of this factory.- 返回:
- the actual endpoint instance (never
null
) - 抛出:
UnavailableException
- if no endpoint is available at present