| |
|
| org.mule.api.MuleMessage
All known Subclasses: org.mule.DefaultMuleMessage,
MuleMessage | public interface MuleMessage extends MessageAdapter(Code) | | MuleMessage represents a message payload. The Message comprises of
the payload itself and properties associated with the payload.
|
applyTransformers | public void applyTransformers(List transformers) throws TransformerException(Code) | | Will apply a list of transformers to the payload of the message. This *Will* change the payload of the
message. This method provides the only way to alter the paylaod of this message without recreating a
copy of the message
Parameters: transformers - the transformers to apply to the message payload throws: TransformerException - if a transformation error occurs or one or more of the transformers passed in aare incompatible with the message payload |
applyTransformers | public void applyTransformers(List transformers, Class outputType) throws TransformerException(Code) | | Will apply a list of transformers to the payload of the message. This *Will* change the payload of the
message. This method provides the only way to alter the paylaod of this message without recreating a
copy of the message
Parameters: transformers - the transformers to apply to the message payload Parameters: outputType - the required output type for this transformation. by adding this parameter some additionaltransformations will occur on the message payload to ensure that the final payload is of the specified type.If no transformers can be found in the registry that can transform from the return type of the transformationlist to the outputType and exception will be thrown throws: TransformerException - if a transformation error occurs or one or more of the transformers passed in aare incompatible with the message payload |
getPayload | Object getPayload(Class outputType) throws TransformerException(Code) | | Will attempt to obtain the payload of this message with the desired Class type. This will
try and resolve a trnsformr that can do this transformation. If a transformer cannot be found
an exception is thrown. Any transfromers added to the reqgistry will be checked for compatability
Parameters: outputType - the desired return type The converted payload of this message. Note that this method will not alter the payload of thismessage *unless* the payload is an inputstream in which case the stream will be read and the payload will becomethe fully read stream. throws: TransformerException - if a transformer cannot be found or there is an error during transformation of thepayload |
getPayloadAsBytes | byte[] getPayloadAsBytes() throws Exception(Code) | | Converts the message implementation into a byte array representation
byte array of the message throws: Exception - Implemetation may throw an endpoint specific exception |
getPayloadAsString | String getPayloadAsString(String encoding) throws Exception(Code) | | Converts the message implementation into a String representation
Parameters: encoding - The encoding to use when transforming the message (ifnecessary). The parameter is used when converting from a byte array String representation of the message payload throws: Exception - Implementation may throw an endpoint specific exception |
getPayloadAsString | String getPayloadAsString() throws Exception(Code) | | Converts the message implementation into a String representation. If encoding
is required it will use the encoding set on the message
String representation of the message payload throws: Exception - Implementation may throw an endpoint specific exception |
setPayload | void setPayload(Object payload)(Code) | | Update the message payload. This is typically only called if the
payload was originally an InputStream. In which case, if the InputStream
is consumed, it needs to be replaced for future access.
Parameters: payload - the object to assign as the message payload |
|
|
|