eneter.messaging.endpoints.typedmessages
Interface IMultiTypedMessageSender

All Superinterfaces:
IAttachableDuplexOutputChannel

public interface IMultiTypedMessageSender
extends IAttachableDuplexOutputChannel

Sender for multiple message types. This is a client component which can send and receive messages of multiple types.


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.
 java.util.ArrayList<java.lang.Class<?>> getRegisteredResponseMessageTypes()
          Returns the list of registered response message types which can be received.
<T> void
registerResponseMessageReceiver(EventHandler<TypedResponseReceivedEventArgs<T>> handler, java.lang.Class<T> clazz)
          Registers response message handler for specified message type.
<TRequestMessage>
void
sendRequestMessage(TRequestMessage message, java.lang.Class<TRequestMessage> clazz)
          Sends request message.
<T> void
unregisterResponseMessageReceiver(java.lang.Class<T> clazz)
          Unregisters the response message handler for the specified message type.
 
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

registerResponseMessageReceiver

<T> void registerResponseMessageReceiver(EventHandler<TypedResponseReceivedEventArgs<T>> handler,
                                         java.lang.Class<T> clazz)
                                     throws java.lang.Exception
Registers response message handler for specified message type. If the response message of the specified type is received the handler will be called to process it.

Parameters:
handler - response message handler.
clazz - type of the response message.
Throws:
java.lang.Exception

unregisterResponseMessageReceiver

<T> void unregisterResponseMessageReceiver(java.lang.Class<T> clazz)
Unregisters the response message handler for the specified message type.

Parameters:
clazz -

getRegisteredResponseMessageTypes

java.util.ArrayList<java.lang.Class<?>> getRegisteredResponseMessageTypes()
Returns the list of registered response message types which can be received.

Returns:
registered message types

sendRequestMessage

<TRequestMessage> void sendRequestMessage(TRequestMessage message,
                                          java.lang.Class<TRequestMessage> clazz)
                        throws java.lang.Exception
Sends request message. The message of the specified type will be serialized and sent to the receiver. If the receiver has registered a handler for this message type then the handler will be called to process the message.

Parameters:
message - request message
clazz - type of the message
Throws:
java.lang.Exception