org.oasisopen.sca
Interface ResponseDispatch<T>

Type Parameters:
T - the type of the Response message returned by the service implementation method

public interface ResponseDispatch<T>

The following defines the ResponseDispatch interface, used to return a response message asynchronously from a service implementation method.


Method Summary
 java.util.Map<java.lang.String,java.lang.Object> getContext()
          Obtains the context object for the ResponseDispatch method
 void sendFault(java.lang.Throwable e)
          Sends an exception as a fault from an asynchronous service method.
 void sendResponse(T res)
          Sends the response message from an asynchronous service method.
 

Method Detail

sendResponse

void sendResponse(T res)
Sends the response message from an asynchronous service method. This method can only be invoked once for a given ResponseDispatch object and cannot be invoked if sendFault has previously been invoked for the same ResponseDispatch object.

Parameters:
res - an instance of the response message returned by the service operation
Throws:
InvalidStateException - if this method is called more than once for the same service operation.

sendFault

void sendFault(java.lang.Throwable e)
Sends an exception as a fault from an asynchronous service method. This method can only be invoked once for a given ResponseDispatch object and cannot be invoked if sendResponse has previously been invoked for the same ResponseDispatch object.

Parameters:
e - an instance of an exception returned by the service operation
Throws:
InvalidStateException - if this method is called more than once for the same service operation.

getContext

java.util.Map<java.lang.String,java.lang.Object> getContext()
Obtains the context object for the ResponseDispatch method

Returns:
a Map which is is the context object for the ResponseDispatch object. The invoker can update the context object with appropriate context information, prior to invoking either the sendResponse method or the sendFault method