| Java Doc By Examples | |
| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectorg.springframework.jms.support.JmsAccessororg.springframework.jms.support.destination.JmsDestinationAccessororg.springframework.jms.core.JmsTemplateorg.springframework.jms.core.JmsTemplate102public class JmsTemplate102extends JmsTemplateJmsTemplate102, JmsTemplate102, JmsTemplate, DynamicDestinationResolver, SimpleMessageConverter102, Queue, Topic, QueueSession, TopicSession, QueueSender, TopicPublisher, QueueReceiver, TopicSubscriberField Summary |
Fields inherited from class org.springframework.jms.core.JmsTemplate | |
DEFAULT_RECEIVE_TIMEOUT | |
Fields inherited from class org.springframework.jms.support.JmsAccessor | |
logger | |
Constructor Summary | |
| |
| |
Method Summary | |
void |
|
protected Connection |
|
protected MessageConsumer |
|
protected Session |
|
protected MessageProducer |
|
protected void |
|
protected void |
|
protected boolean |
|
Methods inherited from class org.springframework.jms.support.destination.JmsDestinationAccessor | |
getDestinationResolver, isPubSubDomain, resolveDestinationName, setDestinationResolver, setPubSubDomain | |
Methods inherited from class org.springframework.jms.support.JmsAccessor | |
afterPropertiesSet, convertJmsAccessException, getConnectionFactory, getSessionAcknowledgeMode, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName, setSessionTransacted | |
Methods inherited from class java.lang.Object | |
clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait | |
public JmsTemplate102()
Create a new JmsTemplate102 for bean-style usage. 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.
- See Also:
JmsTemplate102
public JmsTemplate102(ConnectionFactory connectionFactory, boolean pubSubDomain)
Create a new JmsTemplate102, given a ConnectionFactory.
- Parameters:
connectionFactory- the ConnectionFactory to obtain connections frompubSubDomain- whether the Publish/Subscribe domain (Topics) or Point-to-Point domain (Queues) should be used
- See Also:
JmsTemplate102
1: TransactionStatus ts = tm.getTransaction(new DefaultTransactionDefinition()); 2: JmsTemplate jt = new JmsTemplate102(cf, false); 3: jt.execute(new SessionCallback() { 4: ... 5: TransactionStatus ts = tm.getTransaction(new DefaultTransactionDefinition()); 6: JmsTemplate jt = new JmsTemplate102(cf, true); 7: jt.execute(new SessionCallback() { 8: public Object doInJms(Session sess) { 9: assertTrue(sess == session);
public 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.
- Specified by:
- afterPropertiesSet in interface InitializingBean
- Overrides:
- afterPropertiesSet in interface JmsAccessor
protected Connection createConnection() throws JMSException
This implementation overrides the superclass method to use JMS 1.0.2 API.
- Overrides:
- createConnection in interface JmsTemplate
protected MessageConsumer createConsumer(Session session, Destination destination, String messageSelector) throws JMSException
This implementation overrides the superclass method to use JMS 1.0.2 API.
- Overrides:
- createConsumer in interface JmsTemplate
protected Session createSession(Connection con) throws JMSException
This implementation overrides the superclass method to use JMS 1.0.2 API.
- Overrides:
- createSession in interface JmsTemplate
protected MessageProducer doCreateProducer(Session session, Destination destination) throws JMSException
This implementation overrides the superclass method to use JMS 1.0.2 API.
- Overrides:
- doCreateProducer in interface JmsTemplate
protected void doSend(MessageProducer producer, Message message) throws JMSException
This implementation overrides the superclass method to use JMS 1.0.2 API.
- Overrides:
- doSend in interface JmsTemplate
protected void initDefaultStrategies()
Initialize the default implementations for the template's strategies: DynamicDestinationResolver and SimpleMessageConverter102.
- Overrides:
- initDefaultStrategies in interface JmsTemplate
- See Also:
JmsTemplate102,JmsTemplate102,DynamicDestinationResolver,SimpleMessageConverter102
protected boolean isClientAcknowledge(Session session) throws JMSException
This implementation overrides the superclass method to avoid using JMS 1.1's SessiongetAcknowledgeMode()method. The best we can do here is to check the setting on the template.
- Overrides:
- isClientAcknowledge in interface JmsTemplate
- See Also:
getSessionAcknowledgeMode()