|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.DefaultMuleMessage
org.mule.DefaultMessageCollection
public class DefaultMessageCollection
A MuleMessage type that manages a collection of MuleMessage Objects.
Typically this type of message is only used when users explicitly want to work with aggregated or re-sequenced
collections of messages.
Note that the DefaultMuleMessage.getPayload() for this message will return a List of payload objects for
each of the Mule messages stored in this collection.
Calling MuleMessage.getPayload(Class) will attempt to transform all payloads and return a List.
The methods MuleMessage.getPayloadAsString() and MuleMessage.getPayloadAsBytes() are unsupported, instead users should
call MuleMessage.getPayload(Class) and pass in the return type byte[].class or String.class.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.mule.api.ThreadSafeAccess |
|---|
ThreadSafeAccess.AccessControl |
| Nested classes/interfaces inherited from interface org.mule.util.store.DeserializationPostInitialisable |
|---|
DeserializationPostInitialisable.Implementation |
| Field Summary |
|---|
| Fields inherited from class org.mule.DefaultMuleMessage |
|---|
muleContext, NOT_SET |
| Fields inherited from interface org.mule.api.ThreadSafeAccess |
|---|
READ, WRITE |
| Constructor Summary | |
|---|---|
DefaultMessageCollection(DefaultMessageCollection msg,
MuleContext muleContext)
Performs a shallow copy |
|
DefaultMessageCollection(MuleContext muleContext)
|
|
| Method Summary | |
|---|---|
void |
addMessage(MuleMessage message)
|
void |
addMessage(MuleMessage message,
int index)
|
void |
addMessages(List messages)
|
void |
addMessages(MuleEvent[] events)
|
void |
addMessages(MuleMessage[] messages)
|
MuleMessage |
createInboundMessage()
Copy an inbound message to an outbound one, moving all message properties and attachments |
MuleMessage |
getMessage(int index)
|
protected List |
getMessageList()
|
MuleMessage[] |
getMessagesAsArray()
|
Object |
getPayload(Class outputType)
Applies the MuleMessage.getPayload(Class) call to every message in the collection and returns a
List of results. |
byte[] |
getPayloadAsBytes()
Converts the message implementation into a byte array representation |
String |
getPayloadAsString(String encoding)
Converts the message implementation into a String representation |
protected List |
getPayloadList()
|
Object[] |
getPayloadsAsArray()
|
ThreadSafeAccess |
newThreadCopy()
We need to overload this if we find we want to make this class available to users, but the copy will be expensive; |
void |
removedMessage(MuleMessage message)
|
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultMessageCollection(MuleContext muleContext)
public DefaultMessageCollection(DefaultMessageCollection msg,
MuleContext muleContext)
msg - muleContext - | Method Detail |
|---|
public void addMessage(MuleMessage message)
addMessage in interface MuleMessageCollectionpublic MuleMessage[] getMessagesAsArray()
getMessagesAsArray in interface MuleMessageCollectionpublic Object[] getPayloadsAsArray()
getPayloadsAsArray in interface MuleMessageCollectionpublic void removedMessage(MuleMessage message)
removedMessage in interface MuleMessageCollection
public void addMessage(MuleMessage message,
int index)
addMessage in interface MuleMessageCollectionpublic void addMessages(MuleEvent[] events)
addMessages in interface MuleMessageCollectionpublic void addMessages(List messages)
addMessages in interface MuleMessageCollectionpublic void addMessages(MuleMessage[] messages)
addMessages in interface MuleMessageCollectionpublic MuleMessage getMessage(int index)
getMessage in interface MuleMessageCollectionprotected List getMessageList()
protected List getPayloadList()
public Object getPayload(Class outputType)
throws TransformerException
MuleMessage.getPayload(Class) call to every message in the collection and returns a
List of results.
Will attempt to obtain the payload of this message with the desired Class type. This will
try and resolve a transformer that can do this transformation. If a transformer cannot be found
an exception is thrown. Any transformers added to the registry will be checked for compatibility
getPayload in interface MuleMessagegetPayload in class DefaultMuleMessageoutputType - the desired return type
TransformerException - if a transformer cannot be found or there is an error during transformation of the
payloadpublic int size()
size in interface MuleMessageCollection
public byte[] getPayloadAsBytes()
throws Exception
getPayloadAsBytes in interface MuleMessagegetPayloadAsBytes in class DefaultMuleMessageException - Implemetation may throw an endpoint specific exception
public String getPayloadAsString(String encoding)
throws Exception
getPayloadAsString in interface MuleMessagegetPayloadAsString in class DefaultMuleMessageencoding - The encoding to use when transforming the message (if
necessary). The parameter is used when converting from a byte array
Exception - Implementation may throw an endpoint specific exceptionpublic ThreadSafeAccess newThreadCopy()
newThreadCopy in interface ThreadSafeAccessnewThreadCopy in class DefaultMuleMessage
public MuleMessage createInboundMessage()
throws Exception
createInboundMessage in interface MuleMessagecreateInboundMessage in class DefaultMuleMessageException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||