类 JmsGatewaySupport
- java.lang.Object
- org.springframework.jms.core.support.JmsGatewaySupport
- 所有已实现的接口:
InitializingBean
public abstract class JmsGatewaySupport extends Object implements InitializingBean
Convenient super class for application classes that need JMS access.Requires a ConnectionFactory or a JmsTemplate instance to be set. It will create its own JmsTemplate if a ConnectionFactory is passed in. A custom JmsTemplate instance can be created for a given ConnectionFactory through overriding the
createJmsTemplate(javax.jms.ConnectionFactory)
method.
构造器概要
构造器 构造器 说明 JmsGatewaySupport()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.protected JmsTemplate
createJmsTemplate(ConnectionFactory connectionFactory)
Create a JmsTemplate for the given ConnectionFactory.ConnectionFactory
getConnectionFactory()
Return the JMS ConnectionFactory used by the gateway.JmsTemplate
getJmsTemplate()
Return the JmsTemplate for the gateway.protected void
initGateway()
Subclasses can override this for custom initialization behavior.void
setConnectionFactory(ConnectionFactory connectionFactory)
Set the JMS connection factory to be used by the gateway.void
setJmsTemplate(JmsTemplate jmsTemplate)
Set the JmsTemplate for the gateway.
构造器详细资料
JmsGatewaySupport
public JmsGatewaySupport()
方法详细资料
setConnectionFactory
public final void setConnectionFactory(ConnectionFactory connectionFactory)
Set the JMS connection factory to be used by the gateway. Will automatically create a JmsTemplate for the given ConnectionFactory.
createJmsTemplate
protected JmsTemplate createJmsTemplate(ConnectionFactory connectionFactory)
Create a JmsTemplate for the given ConnectionFactory. Only invoked if populating the gateway with a ConnectionFactory reference.Can be overridden in subclasses to provide a JmsTemplate instance with a different configuration.
- 参数:
connectionFactory
- the JMS ConnectionFactory to create a JmsTemplate for- 返回:
- the new JmsTemplate instance
- 另请参阅:
setConnectionFactory(javax.jms.ConnectionFactory)
getConnectionFactory
@Nullable public final ConnectionFactory getConnectionFactory()
Return the JMS ConnectionFactory used by the gateway.
setJmsTemplate
public final void setJmsTemplate(@Nullable JmsTemplate jmsTemplate)
Set the JmsTemplate for the gateway.
getJmsTemplate
@Nullable public final JmsTemplate getJmsTemplate()
Return the JmsTemplate for the gateway.
afterPropertiesSet
public final void afterPropertiesSet() throws IllegalArgumentException, BeanInitializationException
从接口复制的说明:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
initGateway
protected void initGateway() throws Exception
Subclasses can override this for custom initialization behavior. Gets called after population of this instance's bean properties.- 抛出:
Exception
- if initialization fails