org.springframework.jms.core
Interface ProducerCallback


public interface ProducerCallback

Callback interface for JMS code. To be used with JmsTemplate's execute method, often as an anonymous class within a method implementation.

The typical implementation will perform multiple operations on the 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 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
Throws:
JMSException - if thrown by JMS API methods


Copyright (c) 2002-2007 The Spring Framework Project.