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

Type Parameters:
TResponse - Type of the response message which can be sent back.
TRequest - Type of the request message which can be received.
All Superinterfaces:
IAttachableDuplexInputChannel

public interface IDuplexTypedMessageReceiver<TResponse,TRequest>
extends IAttachableDuplexInputChannel

Receiver for one specified message type. This is a service component which can receive request messages and send back response messages. It can receive messages only from DuplexTypedMessageSender or SyncDuplexTypedMessageSender.


Method Summary
 Event<TypedRequestReceivedEventArgs<TRequest>> messageReceived()
          Raised when a message is received.
 Event<ResponseReceiverEventArgs> responseReceiverConnected()
          Raised when a new client is connected.
 Event<ResponseReceiverEventArgs> responseReceiverDisconnected()
          Raised when a client closed the connection.
 void sendResponseMessage(java.lang.String responseReceiverId, TResponse responseMessage)
          Sends message to the client.
 
Methods inherited from interface eneter.messaging.infrastructure.attachable.IAttachableDuplexInputChannel
attachDuplexInputChannel, detachDuplexInputChannel, getAttachedDuplexInputChannel, isDuplexInputChannelAttached
 

Method Detail

messageReceived

Event<TypedRequestReceivedEventArgs<TRequest>> messageReceived()
Raised when a message is received.

Returns:

responseReceiverConnected

Event<ResponseReceiverEventArgs> responseReceiverConnected()
Raised when a new client is connected.

Returns:

responseReceiverDisconnected

Event<ResponseReceiverEventArgs> responseReceiverDisconnected()
Raised when a client closed the connection. The event is raised only if the connection was closed by the client. It is not raised if the client was disconnected by IDuplexInputChannel.disconnectResponseReceiver(...).

Returns:

sendResponseMessage

void sendResponseMessage(java.lang.String responseReceiverId,
                         TResponse responseMessage)
                         throws java.lang.Exception
Sends message to the client. If the parameter responseReceiverId is * then it sends the broadcast message to all connected clients.

Parameters:
responseReceiverId - identifies the client
responseMessage - response message
Throws:
java.lang.Exception