public interface ProducerCallback<T>
To be used with JmsTemplate's callback methods that take a ProducerCallback argument, often implemented as an anonymous inner class.
The typical implementation will perform multiple operations on the
supplied JMS Session
and MessageProducer
.
JmsTemplate.execute(ProducerCallback)
,
JmsTemplate.execute(javax.jms.Destination, ProducerCallback)
,
JmsTemplate.execute(String, ProducerCallback)
Modifier and Type | Method and Description |
---|---|
T |
doInJms(Session session,
MessageProducer producer)
Perform operations on the given
Session and MessageProducer . |
T doInJms(Session session, MessageProducer producer) throws JMSException
Session
and MessageProducer
.
The message producer is not associated with any destination unless when specified in the JmsTemplate call.
session
- the JMS Session
object to useproducer
- the JMS MessageProducer
object to useSession
, if any (can be null
)JMSException
- if thrown by JMS API methods