org.apache.tuscany.sca.core.invocation
Class MessageImpl

java.lang.Object
  extended by org.apache.tuscany.sca.core.invocation.MessageImpl
All Implemented Interfaces:
Message

public class MessageImpl
extends java.lang.Object
implements Message

The default implementation of a message flowed through a wire during an invocation


Constructor Summary
MessageImpl()
           
 
Method Summary
<T> T
getBindingContext()
          Returns the binding context in force for this message
<T> T
getBody()
          Returns the body of the message, which will be the payload or parameters associated with the wire
 EndpointReference getFrom()
          Get the end point reference of the source reference
 java.util.List<java.lang.Object> getHeaders()
          Returns a list of objects that are contained in the message header
 java.lang.Object getMessageID()
          Returns the id of the message
 Operation getOperation()
          Returns the operation that created the message.
 EndpointReference getTo()
          Get the end point reference of target service
 boolean isFault()
          Determines if the message represents a fault/exception
<T> void
setBindingContext(T bindingContext)
          Set the binding context that is in force for this message
<T> void
setBody(T body)
          Sets the body of the message.
 void setFaultBody(java.lang.Object 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 setOperation(Operation op)
          Sets the operation that created the message.
 void setTo(EndpointReference to)
          Set the end point reference of target service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageImpl

public MessageImpl()
Method Detail

getBody

public <T> T getBody()
Description copied from interface: Message
Returns the body of the message, which will be the payload or parameters associated with the wire

Specified by:
getBody in interface Message
Returns:
The body of the message

setBody

public <T> void setBody(T body)
Description copied from interface: Message
Sets the body of the message.

Specified by:
setBody in interface Message
Parameters:
body - The body of the message

getMessageID

public java.lang.Object getMessageID()
Description copied from interface: Message
Returns the id of the message

Specified by:
getMessageID in interface Message
Returns:
The message Id

setMessageID

public void setMessageID(java.lang.Object messageId)
Description copied from interface: Message
Sets the id of the message

Specified by:
setMessageID in interface Message
Parameters:
messageId - The message ID

isFault

public boolean isFault()
Description copied from interface: Message
Determines if the message represents a fault/exception

Specified by:
isFault in interface Message
Returns:
true If the message body is a fault object, false if the body is a normal payload

setFaultBody

public void setFaultBody(java.lang.Object fault)
Description copied from interface: Message
Set the message body with a fault object. After this method is called, isFault() returns true.

Specified by:
setFaultBody in interface Message
Parameters:
fault - The fault object represents an exception

getFrom

public EndpointReference getFrom()
Description copied from interface: Message
Get the end point reference of the source reference

Specified by:
getFrom in interface Message
Returns:
The end point reference of the reference originating the message

setFrom

public void setFrom(EndpointReference from)
Description copied from interface: Message
Set the end point reference of the reference originating the message

Specified by:
setFrom in interface Message
Parameters:
from - The end point reference of the reference originating the message

getTo

public EndpointReference getTo()
Description copied from interface: Message
Get the end point reference of target service

Specified by:
getTo in interface Message
Returns:
The end point reference of the service that the message targets

setTo

public void setTo(EndpointReference to)
Description copied from interface: Message
Set the end point reference of target service

Specified by:
setTo in interface Message
Parameters:
to - The end point reference of the service that the message targets

getOperation

public Operation getOperation()
Description copied from interface: Message
Returns the operation that created the message.

Specified by:
getOperation in interface Message
Returns:
The operation that created the message

setOperation

public void setOperation(Operation op)
Description copied from interface: Message
Sets the operation that created the message.

Specified by:
setOperation in interface Message
Parameters:
op - The operation that created the message

getHeaders

public java.util.List<java.lang.Object> getHeaders()
Description copied from interface: Message
Returns a list of objects that are contained in the message header

Specified by:
getHeaders in interface Message
Returns:

getBindingContext

public <T> T getBindingContext()
Description copied from interface: Message
Returns the binding context in force for this message

Specified by:
getBindingContext in interface Message

setBindingContext

public <T> void setBindingContext(T bindingContext)
Description copied from interface: Message
Set the binding context that is in force for this message

Specified by:
setBindingContext in interface Message