Package org.springframework.jms.core
Interface SessionCallback<T>
- Type Parameters:
T
- the result type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface SessionCallback<T>
Callback for executing any number of operations on a providedSession
.To be used with the
JmsTemplate.execute(SessionCallback)
method, often implemented as an anonymous inner class or as a lambda expression.- Since:
- 1.1
- Author:
- Mark Pollack
- See Also:
JmsTemplate.execute(SessionCallback)
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
doInJms(Session session)
Execute any number of operations against the supplied JMSSession
, possibly returning a result.
Method Detail
doInJms
@Nullable T doInJms(Session session) throws JMSException
Execute any number of operations against the supplied JMSSession
, possibly returning a result.- Parameters:
session
- the JMSSession
- Returns:
- a result object from working with the
Session
, if any (ornull
if none) - Throws:
JMSException
- if thrown by JMS API methods