|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.soa.esb.message.MessagePayloadProxy
public class MessagePayloadProxy
Utility class to help make accessing the message payload a little more deterministic.
This class can be used by actions/listeners to manage access to the payload on a Message instance. The class is constructed from the configuration of the component (listener, actions etc) using the proxy instance. It checks the configuration for "get-payload-location" and "set-payload-location" configuration properties, defaulting both to the Default Body Location (Body.DEFAULT_LOCATION
).
Prior to the introduction of this class, there was no standardised pattern for
components exchanging data through the ESB Message. It was adhoc in nature,
with components needing to have knowledge of where other components set
the data in the message. This functionality is still supported through the
"get-payload-location" and "set-payload-location" configuration
properties, but all ESB now (by default) get and set their data on the
Body.DEFAULT_LOCATION
.
Code writen to work against ESB version up to and including version 4.2GA
can still use the old adhoc exchange patterns by setting the
"core:use.legacy.message.payload.exchange.patterns" config property in the
jbossesb-properties.xml file.
Nested Class Summary | |
---|---|
static class |
MessagePayloadProxy.NullPayloadHandling
|
Field Summary | |
---|---|
static java.lang.String |
GET_PAYLOAD_LOCATION
Component property for the message location used in the getPayload(Message) method. |
static java.lang.String |
MIME_TYPE
Mime type message property key. |
static java.lang.String |
SET_PAYLOAD_LOCATION
Component property for the message location used in the setPayload(Message, Object) method. |
static java.lang.String |
USE_LEGACY_EXCHANGE_PATTERNS_CONFIG
jbossesb-properties.xml config key for switching on and off legacy (adhoc) message payload location getting/setting. |
Constructor Summary | |
---|---|
MessagePayloadProxy(ConfigTree config)
Public constructor. |
|
MessagePayloadProxy(ConfigTree config,
java.lang.String[] legacyGetPayloadLocations,
java.lang.String[] legacySetPayloadLocations)
Deprecated. Use the non-legacy constructor .
This method is here simply to support code that is dependent on the
4.2.x message payload exchange patterns an will be removed in a subsequent release. New code should use the
MessagePayloadProxy(org.jboss.soa.esb.helpers.ConfigTree) constructor. |
Method Summary | |
---|---|
java.lang.String |
getGetPayloadLocation()
Get the primary message input Location as configured on the component config ("get-payload-location"). |
MessagePayloadProxy.NullPayloadHandling |
getNullGetPayloadHandling()
Get the null set-payload handling config. |
MessagePayloadProxy.NullPayloadHandling |
getNullSetPayloadHandling()
Get the null get-payload handling config. |
java.lang.Object |
getPayload(Message message)
Get the primary message payload from the supplied message. |
java.lang.String |
getSetPayloadLocation()
Get the primary message output Location as configured on the component config ("set-payload-location"). |
static boolean |
isUsingLegacyPatterns()
|
void |
setNullGetPayloadHandling(MessagePayloadProxy.NullPayloadHandling nullGetPayloadHandling)
Set the null set-payload handling config. |
void |
setNullSetPayloadHandling(MessagePayloadProxy.NullPayloadHandling nullSetPayloadHandling)
Set the null get-payload handling config. |
void |
setPayload(Message message,
java.lang.Object payload)
Set the primary message payload on the supplied message. |
static void |
setUseLegacyPatterns(boolean useLegacyPatterns)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String USE_LEGACY_EXCHANGE_PATTERNS_CONFIG
public static final java.lang.String GET_PAYLOAD_LOCATION
getPayload(Message)
method.
Defaults to Body.DEFAULT_LOCATION
.
public static final java.lang.String SET_PAYLOAD_LOCATION
setPayload(Message, Object)
method.
Defaults to Body.DEFAULT_LOCATION
.
public static final java.lang.String MIME_TYPE
Constructor Detail |
---|
public MessagePayloadProxy(ConfigTree config, java.lang.String[] legacyGetPayloadLocations, java.lang.String[] legacySetPayloadLocations)
non-legacy constructor
.
This method is here simply to support code that is dependent on the
4.2.x message payload exchange patterns an will be removed in a subsequent release. New code should use the
MessagePayloadProxy(org.jboss.soa.esb.helpers.ConfigTree)
constructor.
config
- The component configuration.legacyGetPayloadLocations
- The message input locations as defined in the 4.2.x codebase.legacySetPayloadLocations
- The message output locations as defined in the 4.2.x codebase.public MessagePayloadProxy(ConfigTree config)
config
- The component configuration.Method Detail |
---|
public java.lang.Object getPayload(Message message) throws MessageDeliverException
message
- The Message instance.
MessageDeliverException
- See setNullGetPayloadHandling(org.jboss.soa.esb.message.MessagePayloadProxy.NullPayloadHandling)
.public void setPayload(Message message, java.lang.Object payload) throws MessageDeliverException
message
- The message instance.payload
- The message primary payload.
MessageDeliverException
- See setNullSetPayloadHandling(org.jboss.soa.esb.message.MessagePayloadProxy.NullPayloadHandling)
.public java.lang.String getGetPayloadLocation()
public java.lang.String getSetPayloadLocation()
public MessagePayloadProxy.NullPayloadHandling getNullGetPayloadHandling()
public void setNullGetPayloadHandling(MessagePayloadProxy.NullPayloadHandling nullGetPayloadHandling)
MessagePayloadProxy.NullPayloadHandling.EXCEPTION
.
nullGetPayloadHandling
- Null set-payload Handling config.public MessagePayloadProxy.NullPayloadHandling getNullSetPayloadHandling()
public void setNullSetPayloadHandling(MessagePayloadProxy.NullPayloadHandling nullSetPayloadHandling)
MessagePayloadProxy.NullPayloadHandling.NONE
.
nullSetPayloadHandling
- Null get-payload Handling config.public static void setUseLegacyPatterns(boolean useLegacyPatterns)
public static boolean isUsingLegacyPatterns()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |