public class OnMessageHandler
extends java.lang.Object
Behaviour for javax.jms.MessageListener.onMessage
is identical for polling and listening implementations. It can't
easily be shared using inheritance because polling consumers must extend AdaptrisPollingConsumer
. Hence this utility
class to be used by both polling and listening imps. This class is not marshalled or configurable.
Constructor and Description |
---|
OnMessageHandler(JmsActorConfig cfg)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
onMessage(javax.jms.Message msg)
Uses
translator to create an AdaptrisMessage from
the javax.jms.Message . |
public OnMessageHandler(JmsActorConfig cfg) throws CoreException
Creates a new instance. Neither param may be null.
cfg
- the OnMessageConfig
to useCoreException
public void onMessage(javax.jms.Message msg)
Uses translator
to create an AdaptrisMessage
from
the javax.jms.Message
. Adds the JMSReplyTo
as
transient 'Object' metadata. Passes the AdaptrisMessage
to
listener
. Acknowledges javax.jms.Message
.
NB if, as is almost always the case, listener
is a
StandardWorkflow
, onAdaptrisMessage
will never
throw any Throwable
and acknowledge
will always
be called.