public abstract class JmsGatewaySupport extends Object implements org.springframework.beans.factory.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() |
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)
connectionFactory
- createJmsTemplate(javax.jms.ConnectionFactory)
,
setConnectionFactory(javax.jms.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)
jmsTemplate
- setConnectionFactory(javax.jms.ConnectionFactory)
public final JmsTemplate getJmsTemplate()
public final void afterPropertiesSet() throws IllegalArgumentException, org.springframework.beans.factory.BeanInitializationException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
IllegalArgumentException
org.springframework.beans.factory.BeanInitializationException