eneter.messaging.endpoints.typedmessages
Interface ISyncMultitypedMessageSender

All Superinterfaces:
IAttachableDuplexOutputChannel

public interface ISyncMultitypedMessageSender
extends IAttachableDuplexOutputChannel

Synchronized sender for multiple message types (it waits until the response is received). Message sender which sends request messages of specified type and receive response messages of specified type. Synchronous means when the message is sent it waits until the response message is received. If the waiting for the response message exceeds the specified timeout the TimeoutException is thrown.


Method Summary
 Event<DuplexChannelEventArgs> connectionClosed()
          Raised when the service closed the connection with the client.
 Event<DuplexChannelEventArgs> connectionOpened()
          Raised when the connection with the receiver is open.
<TRequest,TResponse>
TResponse
sendRequestMessage(TRequest message, java.lang.Class<TResponse> responseClazz, java.lang.Class<TRequest> requestClazz)
          Sends request message and returns the response.
 
Methods inherited from interface eneter.messaging.infrastructure.attachable.IAttachableDuplexOutputChannel
attachDuplexOutputChannel, detachDuplexOutputChannel, getAttachedDuplexOutputChannel, isDuplexOutputChannelAttached
 

Method Detail

connectionOpened

Event<DuplexChannelEventArgs> connectionOpened()
Raised when the connection with the receiver is open.

Returns:
event

connectionClosed

Event<DuplexChannelEventArgs> connectionClosed()
Raised when the service closed the connection with the client. The event is raised only if the service closes the connection with the client. It is not raised if the client closed the connection by IDuplexOutputChannel.closeConnection().

Returns:
event

sendRequestMessage

<TRequest,TResponse> TResponse sendRequestMessage(TRequest message,
                                                  java.lang.Class<TResponse> responseClazz,
                                                  java.lang.Class<TRequest> requestClazz)
                             throws java.lang.Exception
Sends request message and returns the response.

Parameters:
message - request message.
responseClazz - type of the expected response message.
requestClazz - type of the request message.
Returns:
response message.
Throws:
java.lang.Exception