eneter.messaging.endpoints.typedmessages
Interface ISyncDuplexTypedMessageSender<TResponse,TRequest>

Type Parameters:
TResponse - Response message type.
TRequest - Request message type.
All Superinterfaces:
IAttachableDuplexOutputChannel

public interface ISyncDuplexTypedMessageSender<TResponse,TRequest>
extends IAttachableDuplexOutputChannel

Synchronized sender for one specified message type (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.
 TResponse sendRequestMessage(TRequest message)
          Sends the 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

TResponse sendRequestMessage(TRequest message)
                             throws java.lang.Exception
Sends the request message and returns the response. It waits until the response message is received. If waiting for the response exceeds the specified timeout TimeoutException is thrown.

Parameters:
message - request message
Returns:
response message
Throws:
java.lang.Exception