01: package dalma.endpoints.jms;
02:
03: import dalma.Conversation;
04:
05: import javax.jms.Message;
06:
07: /**
08: * Callback interface that receives JMS messages that are not correlated
09: * to existing {@link Conversation}s.
10: *
11: * <p>
12: * Those {@link Message}s that have a correlation ID back to to the message
13: * sent from a conversation will be considered as replies and therefore
14: * routed to the appropriate conversation. This handler receives other
15: * messages.
16: *
17: * @see JMSEndPoint#setNewMessageHandler(MessageHandler)
18: * @author Kohsuke Kawaguchi
19: */
20: public interface MessageHandler {
21: /**
22: * Called for each new message.
23: *
24: * @param message
25: * represents a received message.
26: * always non-null.
27: * @throws Exception
28: * if the method throws any {@link Throwable},
29: * it will be simply logged.
30: */
31: void onNewMessage(Message message) throws Exception;
32: }
|