org.apache.tuscany.sca.invocation
Interface Message


public interface Message

Represents a request, response, or exception flowing through a wire

Version:
$Rev $Date

Method Summary
<T> T
getBody()
          Returns the body of the message, which will be the payload or parameters associated with the wire
 java.lang.String getConversationID()
          Get the conversation id
 ConversationSequence getConversationSequence()
          Returns the conversational sequence the message is associated with, NONE, START, CONTINUE, or END on TargetInvoker}
 java.lang.Object getCorrelationID()
          Returns the correlation id of the message or null if one is not available.
 EndpointReference getFrom()
          Get the end point reference of the source reference
 java.lang.Object getMessageID()
          Returns the id of the message
 EndpointReference getTo()
          Get the end point reference of target service
 boolean isFault()
          Determines if the message represents a fault/exception
<T> void
setBody(T body)
          Sets the body of the message.
 void setConversationID(java.lang.String conversationId)
          Set the conversation id
 void setConversationSequence(ConversationSequence sequence)
          Returns the conversational sequence the message is associated with, NONE, START, CONTINUE, or END
 void setCorrelationID(java.lang.Object correlationId)
          Sets the correlation id of the message.
<T> void
setFaultBody(T fault)
          Set the message body with a fault object.
 void setFrom(EndpointReference from)
          Set the end point reference of the reference originating the message
 void setMessageID(java.lang.Object messageId)
          Sets the id of the message
 void setTo(EndpointReference to)
          Set the end point reference of target service
 

Method Detail

getBody

<T> T getBody()
Returns the body of the message, which will be the payload or parameters associated with the wire

Returns:
The body of the message

setBody

<T> void setBody(T body)
Sets the body of the message.

Parameters:
body - The body of the message

getConversationID

java.lang.String getConversationID()
Get the conversation id

Returns:
The conversation ID

setConversationID

void setConversationID(java.lang.String conversationId)
Set the conversation id

Parameters:
conversationId - The conversation ID

getFrom

EndpointReference getFrom()
Get the end point reference of the source reference

Returns:
The end point reference of the reference originating the message

setFrom

void setFrom(EndpointReference from)
Set the end point reference of the reference originating the message

Parameters:
from - The end point reference of the reference originating the message

getTo

EndpointReference getTo()
Get the end point reference of target service

Returns:
The end point reference of the service that the message targets

setTo

void setTo(EndpointReference to)
Set the end point reference of target service

Parameters:
to - The end point reference of the service that the message targets

getMessageID

java.lang.Object getMessageID()
Returns the id of the message

Returns:
The message Id

setMessageID

void setMessageID(java.lang.Object messageId)
Sets the id of the message

Parameters:
messageId - The message ID

getCorrelationID

java.lang.Object getCorrelationID()
Returns the correlation id of the message or null if one is not available. Correlation ids are used by transports for message routing.

Returns:
The correlation Id

setCorrelationID

void setCorrelationID(java.lang.Object correlationId)
Sets the correlation id of the message. Correlation ids are used by transports for message routing.

Parameters:
correlationId - The correlation Id

isFault

boolean isFault()
Determines if the message represents a fault/exception

Returns:
true If the message body is a fault object, false if the body is a normal payload

setFaultBody

<T> void setFaultBody(T fault)
Set the message body with a fault object. After this method is called, isFault() returns true.

Parameters:
fault - The fault object represents an exception

getConversationSequence

ConversationSequence getConversationSequence()
Returns the conversational sequence the message is associated with, NONE, START, CONTINUE, or END on TargetInvoker}

Returns:
The conversational sequence the message is associated with

setConversationSequence

void setConversationSequence(ConversationSequence sequence)
Returns the conversational sequence the message is associated with, NONE, START, CONTINUE, or END

Parameters:
sequence - The conversational sequence