com.bea.wli.sb.transports
Class CoLocatedMessageContext

java.lang.Object
  extended by com.bea.wli.sb.transports.CoLocatedMessageContext
All Implemented Interfaces:
InboundTransportMessageContext, OutboundTransportMessageContext, TransportMessageContext

public abstract class CoLocatedMessageContext
extends Object
implements InboundTransportMessageContext, OutboundTransportMessageContext

This class needs to be extended by a transport provider that implements optimization for co-located outbound calls to go through a Java method invokation instead of transport layer. For an example implementation, see com.bea.alsb.transports.sock.SocketCoLocatedMessageContext


Method Summary
 void close(TransportOptions options)
          Commits the contents of this context and clean up any resources used by this context
 TransportEndPoint getEndPoint()
           
 String getMessageId()
           
 RequestMetaData getRequestMetaData()
           
 Source getRequestPayload()
           
 ResponseMetaData getResponseMetaData()
           
 Source getResponsePayload()
          client should not need to read the body of the response on the inbound message
 URI getURI()
           
 void send(TransportSendListener listener)
           
 void setResponseMetaData(ResponseMetaData rmd)
          Sets the meta-data for the response part of the message, e.g.
 void setResponsePayload(Source src)
          Sets the response payload into the message context
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bea.wli.sb.transports.InboundTransportMessageContext
createResponseMetaData, createResponseMetaData
 

Method Detail

getURI

public URI getURI()
Specified by:
getURI in interface TransportMessageContext
Returns:
the base uri for to which the message was sent for an outbound message or from which the message was sent on an inbound message

getEndPoint

public TransportEndPoint getEndPoint()
Specified by:
getEndPoint in interface InboundTransportMessageContext
Returns:
the service endpoint object which has received this incoming message

getMessageId

public String getMessageId()
Specified by:
getMessageId in interface TransportMessageContext
Returns:
returns transport provider-specific message identifier. Ideally it should uniquely identify the message among other messages going through the ALSB runtime, However, ALSB does not depend on the message Id being unique. The message Id will be added to the message context and thus visible in the pipeline.

getRequestMetaData

public RequestMetaData getRequestMetaData()
                                   throws TransportException
Specified by:
getRequestMetaData in interface InboundTransportMessageContext
Returns:
the meta-data for the request part of the message, e.g. headers, etc. Returns null if there is no request meta-data
Throws:
TransportException

getRequestPayload

public Source getRequestPayload()
                         throws TransportException
Specified by:
getRequestPayload in interface InboundTransportMessageContext
Returns:
returns a source (e.g. input stream or a DOM object) for reading data in the body of the request of an inbound message or null if there is no body of the request. Note that the entire body of the payload is retrieved.
Throws:
TransportException

getResponseMetaData

public ResponseMetaData getResponseMetaData()
Specified by:
getResponseMetaData in interface OutboundTransportMessageContext
Returns:
the meta-data for the response part of the message, e.g. headers, etc. Returns null if there is no response meta-data

setResponseMetaData

public void setResponseMetaData(ResponseMetaData rmd)
                         throws TransportException
Description copied from interface: InboundTransportMessageContext
Sets the meta-data for the response part of the message, e.g. headers, etc.

Specified by:
setResponseMetaData in interface InboundTransportMessageContext
Parameters:
rmd - Transport Provider-specific POJO that represents response meta data
Throws:
TransportException

getResponsePayload

public Source getResponsePayload()
                          throws TransportException
client should not need to read the body of the response on the inbound message

Specified by:
getResponsePayload in interface OutboundTransportMessageContext
Returns:
returns a source for reading the body of the response of the outbound message. returns null if there is no response payload
Throws:
TransportException

setResponsePayload

public void setResponsePayload(Source src)
                        throws TransportException
Description copied from interface: InboundTransportMessageContext
Sets the response payload into the message context

Specified by:
setResponsePayload in interface InboundTransportMessageContext
Parameters:
src - source containing the response payload
Throws:
TransportException

send

public void send(TransportSendListener listener)
          throws TransportException
Throws:
TransportException

close

public void close(TransportOptions options)
Description copied from interface: InboundTransportMessageContext
Commits the contents of this context and clean up any resources used by this context

Specified by:
close in interface InboundTransportMessageContext
Parameters:
options - specifies additional run-time parameters with respect to processing of inbound response. E.g. it can signal the mode of a given message: one-way versus request/response