|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.jms.core.JmsTemplate org.springframework.jms.core.JmsTemplate102
A subclass of JmsTemplate that uses the JMS 1.0.2 specification, rather than the JMS 1.1 methods used by JmsTemplate itself. This class can be used for JMS 1.0.2 providers, offering the same API as JmsTemplate does for JMS 1.1 providers.
You must specify the domain or style of messaging to be either Point-to-Point (Queues) or Publish/Subscribe(Topics), using the "pubSubDomain" property. Point-to-Point (Queues) is the default domain.
The "pubSubDomain" property is an important setting due to the use of similar but seperate class hierarchies in the JMS 1.0.2 API. JMS 1.1 provides a new domain-independent API that allows for easy mix-and-match use of Point-to-Point and Publish/Subscribe domain.
This template uses a DynamicDestinationResolver and a SimpleMessageConverter102 as default strategies for resolving a destination name respectively converting a message.
JmsTemplate.setConnectionFactory(javax.jms.ConnectionFactory)
,
JmsTemplate.setPubSubDomain(boolean)
,
JmsTemplate
,
DynamicDestinationResolver
,
SimpleMessageConverter102
Field Summary |
Fields inherited from class org.springframework.jms.core.JmsTemplate |
DEFAULT_RECEIVE_TIMEOUT, logger |
Constructor Summary | |
JmsTemplate102()
Create a new JmsTemplate102 for bean-style usage. |
|
JmsTemplate102(javax.jms.ConnectionFactory connectionFactory,
boolean pubSubDomain)
Create a new JmsTemplate102, given a ConnectionFactory. |
Method Summary | |
void |
afterPropertiesSet()
In addition to checking if the connection factory is set, make sure that the supplied connection factory is of the appropriate type for the specified destination type: QueueConnectionFactory for queues, and TopicConnectionFactory for topics. |
protected javax.jms.Connection |
createConnection()
This implementation overrides the superclass method to use JMS 1.0.2 API. |
protected javax.jms.MessageConsumer |
createConsumer(javax.jms.Session session,
javax.jms.Destination destination)
This implementation overrides the superclass method to use JMS 1.0.2 API. |
protected javax.jms.MessageProducer |
createProducer(javax.jms.Session session,
javax.jms.Destination destination)
This implementation overrides the superclass method to use JMS 1.0.2 API. |
protected javax.jms.Session |
createSession(javax.jms.Connection con)
This implementation overrides the superclass method to use JMS 1.0.2 API. |
protected void |
doSend(javax.jms.MessageProducer producer,
javax.jms.Message message)
This implementation overrides the superclass method to use JMS 1.0.2 API. |
protected void |
initDefaultStrategies()
Initialize the default implementations for the template's strategies: DynamicDestinationResolver and SimpleMessageConverter102. |
protected boolean |
isClientAcknowledge(javax.jms.Session session)
This implementation overrides the superclass method to avoid using JMS 1.1's Session getAcknowledgeMode method.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JmsTemplate102()
Note: The ConnectionFactory has to be set before using the instance. This constructor can be used to prepare a JmsTemplate via a BeanFactory, typically setting the ConnectionFactory via setConnectionFactory.
JmsTemplate.setConnectionFactory(javax.jms.ConnectionFactory)
public JmsTemplate102(javax.jms.ConnectionFactory connectionFactory, boolean pubSubDomain)
connectionFactory
- the ConnectionFactory to obtain connections frompubSubDomain
- whether the Publish/Subscribe domain (Topics) or
Point-to-Point domain (Queues) should be usedJmsTemplate.setPubSubDomain(boolean)
Method Detail |
protected void initDefaultStrategies()
initDefaultStrategies
in class JmsTemplate
JmsTemplate.setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver)
,
JmsTemplate.setMessageConverter(org.springframework.jms.support.converter.MessageConverter)
,
DynamicDestinationResolver
,
SimpleMessageConverter102
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
afterPropertiesSet
in class JmsTemplate
protected javax.jms.Connection createConnection() throws javax.jms.JMSException
createConnection
in class JmsTemplate
javax.jms.JMSException
- if thrown by JMS API methodsprotected javax.jms.Session createSession(javax.jms.Connection con) throws javax.jms.JMSException
createSession
in class JmsTemplate
con
- the JMS Connection to create a Session for
javax.jms.JMSException
- if thrown by JMS API methodsprotected javax.jms.MessageProducer createProducer(javax.jms.Session session, javax.jms.Destination destination) throws javax.jms.JMSException
createProducer
in class JmsTemplate
session
- the JMS Session to create a MessageProducer fordestination
- the JMS Destination to create a MessageProducer for
javax.jms.JMSException
- if thrown by JMS API methodsprotected javax.jms.MessageConsumer createConsumer(javax.jms.Session session, javax.jms.Destination destination) throws javax.jms.JMSException
createConsumer
in class JmsTemplate
session
- the JMS Session to create a MessageConsumer fordestination
- the JMS Destination to create a MessageConsumer for
javax.jms.JMSException
- if thrown by JMS API methodsprotected void doSend(javax.jms.MessageProducer producer, javax.jms.Message message) throws javax.jms.JMSException
doSend
in class JmsTemplate
javax.jms.JMSException
protected boolean isClientAcknowledge(javax.jms.Session session) throws javax.jms.JMSException
getAcknowledgeMode
method.
The best we can do here is to check the setting on the template.
isClientAcknowledge
in class JmsTemplate
javax.jms.JMSException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |