public abstract class JmsGatewaySupport extends Object implements InitializingBean
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.
setConnectionFactory(javax.jms.ConnectionFactory)
,
setJmsTemplate(org.springframework.jms.core.JmsTemplate)
,
createJmsTemplate(javax.jms.ConnectionFactory)
,
JmsTemplate
Modifier and Type | Field and Description |
---|---|
protected Log |
logger
Logger available to subclasses
|
Constructor and Description |
---|
JmsGatewaySupport() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
|
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.
|
protected final Log logger
public final void setConnectionFactory(ConnectionFactory connectionFactory)
protected JmsTemplate createJmsTemplate(ConnectionFactory connectionFactory)
Can be overridden in subclasses to provide a JmsTemplate instance with a different configuration.
connectionFactory
- the JMS ConnectionFactory to create a JmsTemplate forsetConnectionFactory(javax.jms.ConnectionFactory)
public final ConnectionFactory getConnectionFactory()
public final void setJmsTemplate(JmsTemplate jmsTemplate)
public final JmsTemplate getJmsTemplate()
public final void afterPropertiesSet() throws IllegalArgumentException, BeanInitializationException
InitializingBean
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
afterPropertiesSet
in interface InitializingBean
IllegalArgumentException
BeanInitializationException