站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.1.0 API 文档英文版

ProducerCallback (Spring Framework API 2.1) - Spring Framework 2.1.0 API 文档英文版


The Spring Framework

org.springframework.jms.core
Interface ProducerCallback


public interface ProducerCallback

Callback for sending a message to a JMS destination.

To be used with the JmsTemplate.execute(ProducerCallback) method, often implemented as an anonymous inner class.

The typical implementation will perform multiple operations on the supplied JMS Session and MessageProducer. When used with a 1.0.2 provider, you need to downcast to the appropriate domain implementation, either QueueSender or TopicPublisher, to actually send a message.

Since:
1.1
Author:
Mark Pollack
See Also:
JmsTemplate.execute(ProducerCallback)

Method Summary
 Object doInJms(Session session, MessageProducer producer)
          Perform operations on the given Session and MessageProducer.
 

Method Detail

doInJms

Object doInJms(Session session,
               MessageProducer producer)
               throws JMSException
Perform operations on the given Session and MessageProducer.

The message producer is not associated with any destination.

Parameters:
session - the JMS Session object to use
producer - the JMS MessageProducer object to use
Returns:
a result object from working with the Session, if any (can be null)
Throws:
JMSException - if thrown by JMS API methods

The Spring Framework

Copyright © 2002-2007 The Spring Framework.