public final class MapMessageTranslator extends MessageTypeTranslatorImp
Translates between AdaptrisMessage
and javax.jms.MapMessage
.
In the adapter configuration file this class is aliased as map-message-translator which is the preferred alternative to the fully qualified classname when building your configuration.
helper, log, session
Constructor and Description |
---|
MapMessageTranslator() |
MapMessageTranslator(java.lang.String key) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getKeyForPayload() |
java.lang.Boolean |
getTreatMetadataAsPartOfMessage() |
void |
init()
Initialises the component.
|
void |
setKeyForPayload(java.lang.String s)
Specify the key of the map message that will be associated with the AdaptrisMessage Payload.
|
void |
setTreatMetadataAsPartOfMessage(java.lang.Boolean b)
When translating from AdaptrisMessage to MapMessage treat AdaptrisMessage metadata as part of the MapMessage.
|
javax.jms.Message |
translate(AdaptrisMessage msg)
Translates an
AdaptrisMessage into a MapMessage. |
AdaptrisMessage |
translate(javax.jms.Message msg)
Translates a MapMessage into an
AdaptrisMessage . |
close, copyConfiguration, currentMessageFactory, currentSession, getMetadataConverters, getMetadataFilter, getMoveJmsHeaders, getReportAllErrors, metadataConverters, metadataFilter, moveJmsHeaders, prepare, registerMessageFactory, registerSession, reportAllErrors, setMetadataConverters, setMetadataFilter, setMoveJmsHeaders, setReportAllErrors, start, start, stop, stop, translate
public MapMessageTranslator()
public MapMessageTranslator(java.lang.String key)
public void init() throws CoreException
ComponentLifecycle
Component initialisation includes config verification, creation of connections etc.
init
in interface ComponentLifecycle
init
in class MessageTypeTranslatorImp
CoreException
- wrapping any underlying Exception
sComponentLifecycle.init()
public javax.jms.Message translate(AdaptrisMessage msg) throws javax.jms.JMSException
Translates an AdaptrisMessage
into a MapMessage.
msg
- the AdaptrisMessage
to translateMapMessage
javax.jms.JMSException
public AdaptrisMessage translate(javax.jms.Message msg) throws javax.jms.JMSException
Translates a MapMessage into an AdaptrisMessage
.
msg
- the MapMessage
to translateAdaptrisMessage
javax.jms.JMSException
public java.lang.String getKeyForPayload()
setKeyForPayload(String)
public void setKeyForPayload(java.lang.String s)
Other keys will be added as metadata when translating to AdaptrisMessage; behaviour when
translating from AdaptrisMessage is defined by
setTreatMetadataAsPartOfMessage(Boolean)
.
s
- the keyForPayload to setpublic java.lang.Boolean getTreatMetadataAsPartOfMessage()
public void setTreatMetadataAsPartOfMessage(java.lang.Boolean b)
Setting this to true does not mean that MessageTypeTranslatorImp.setMetadataFilter(com.adaptris.core.metadata.MetadataFilter)
is ignored;
things may still be added as JMS Properties
b
- true to force AdaptrisMessage metadata to be treated as part of the MapMessage rather as standard JMS properties.