类 StandardJmsActivationSpecFactory
- java.lang.Object
- org.springframework.jms.listener.endpoint.StandardJmsActivationSpecFactory
- 所有已实现的接口:
JmsActivationSpecFactory
public class StandardJmsActivationSpecFactory extends Object implements JmsActivationSpecFactory
Standard implementation of theJmsActivationSpecFactory
interface. Supports the standard JMS properties as defined by the JMS 1.5 specification (Appendix B); ignores Spring's "maxConcurrency" and "prefetchSize" settings.The 'activationSpecClass' property is required, explicitly defining the fully-qualified class name of the provider's ActivationSpec class (e.g. "org.apache.activemq.ra.ActiveMQActivationSpec").
Check out
DefaultJmsActivationSpecFactory
for an extended variant of this class, supporting some further default conventions beyond the plain JMS 1.5 specification.- 从以下版本开始:
- 2.5
- 作者:
- Juergen Hoeller
- 另请参阅:
setActivationSpecClass(java.lang.Class<?>)
,DefaultJmsActivationSpecFactory
构造器概要
构造器 构造器 说明 StandardJmsActivationSpecFactory()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected void
applyAcknowledgeMode(BeanWrapper bw, int ackMode)
Apply the specified acknowledge mode to the ActivationSpec object.ActivationSpec
createActivationSpec(ResourceAdapter adapter, JmsActivationSpecConfig config)
Create a JCA 1.5 ActivationSpec object based on the givenJmsActivationSpecConfig
object.protected Class<?>
determineActivationSpecClass(ResourceAdapter adapter)
Determine the ActivationSpec class for the given ResourceAdapter, if possible.DestinationResolver
getDestinationResolver()
Return theDestinationResolver
to use for resolving destinations names.protected void
populateActivationSpecProperties(BeanWrapper bw, JmsActivationSpecConfig config)
Populate the given ApplicationSpec object with the settings defined in the given configuration object.void
setActivationSpecClass(Class<?> activationSpecClass)
Specify the fully-qualified ActivationSpec class name for the target provider (e.g.void
setDefaultProperties(Map<String,String> defaultProperties)
Specify custom default properties, with String keys and String values.void
setDestinationResolver(DestinationResolver destinationResolver)
Set the DestinationResolver to use for resolving destination names into the JCA 1.5 ActivationSpec "destination" property.
构造器详细资料
StandardJmsActivationSpecFactory
public StandardJmsActivationSpecFactory()
方法详细资料
setActivationSpecClass
public void setActivationSpecClass(Class<?> activationSpecClass)
Specify the fully-qualified ActivationSpec class name for the target provider (e.g. "org.apache.activemq.ra.ActiveMQActivationSpec").
setDefaultProperties
public void setDefaultProperties(Map<String,String> defaultProperties)
Specify custom default properties, with String keys and String values.Applied to each ActivationSpec object before it gets populated with listener-specific settings. Allows for configuring vendor-specific properties beyond the Spring-defined settings in
JmsActivationSpecConfig
.
setDestinationResolver
public void setDestinationResolver(DestinationResolver destinationResolver)
Set the DestinationResolver to use for resolving destination names into the JCA 1.5 ActivationSpec "destination" property.If not specified, destination names will simply be passed in as Strings. If specified, destination names will be resolved into Destination objects first.
Note that a DestinationResolver for use with this factory must be able to work without an active JMS Session: e.g.
JndiDestinationResolver
orBeanFactoryDestinationResolver
but notDynamicDestinationResolver
.
getDestinationResolver
public DestinationResolver getDestinationResolver()
Return theDestinationResolver
to use for resolving destinations names.
createActivationSpec
public ActivationSpec createActivationSpec(ResourceAdapter adapter, JmsActivationSpecConfig config)
从接口复制的说明:JmsActivationSpecFactory
Create a JCA 1.5 ActivationSpec object based on the givenJmsActivationSpecConfig
object.- 指定者:
createActivationSpec
在接口中JmsActivationSpecFactory
- 参数:
adapter
- the ResourceAdapter to create an ActivationSpec object forconfig
- the configured object holding common JMS settings- 返回:
- the provider-specific JCA ActivationSpec object, representing the same settings
determineActivationSpecClass
protected Class<?> determineActivationSpecClass(ResourceAdapter adapter)
Determine the ActivationSpec class for the given ResourceAdapter, if possible. Called if no 'activationSpecClass' has been set explicitly- 参数:
adapter
- the ResourceAdapter to check- 返回:
- the corresponding ActivationSpec class, or
null
if not determinable - 另请参阅:
setActivationSpecClass(java.lang.Class<?>)
populateActivationSpecProperties
protected void populateActivationSpecProperties(BeanWrapper bw, JmsActivationSpecConfig config)
Populate the given ApplicationSpec object with the settings defined in the given configuration object.This implementation applies all standard JMS settings, but ignores "maxConcurrency" and "prefetchSize" - not supported in standard JCA 1.5.
- 参数:
bw
- the BeanWrapper wrapping the ActivationSpec objectconfig
- the configured object holding common JMS settings
applyAcknowledgeMode
protected void applyAcknowledgeMode(BeanWrapper bw, int ackMode)
Apply the specified acknowledge mode to the ActivationSpec object.This implementation applies the standard JCA 1.5 acknowledge modes "Auto-acknowledge" and "Dups-ok-acknowledge". It throws an exception in case of
CLIENT_ACKNOWLEDGE
orSESSION_TRANSACTED
having been requested.- 参数:
bw
- the BeanWrapper wrapping the ActivationSpec objectackMode
- the configured acknowledge mode (according to the constants inSession
- 另请参阅:
Session.AUTO_ACKNOWLEDGE
,Session.DUPS_OK_ACKNOWLEDGE
,Session.CLIENT_ACKNOWLEDGE
,Session.SESSION_TRANSACTED