pl.bristleback.server.bristle.messages
Interface MessageSender<T>

All Known Implementing Classes:
AbstractMessageSender, RightsCheckingMessageBroadcaster, SimpleConnectorMessageSender

public interface MessageSender<T>

Message senders are designed for sending message to connectors specified by condition object. Condition object type is not restricted, so implementation can choose the way it will be used. All senders are provided by plugin with jwebsocket server implementation and MessageDispatcher implementation. It is recommended to not send messages directly by server, but by invoking MessageDispatcher.addMessage(WebSocketMessage) method. To add certain message sender, view documentation of used MessageContainerResolver implementation. Added senders are hold in MessageSendersExporter class and this class should be used to get senders.

Created on: 2010-09-03 16:07:47

Author:
Wojciech Niemiec

Method Summary
 void sendMessage(org.jwebsocket.token.Token token, T conditionsObject)
          Sends message to connectors obtained by processing conditions object.
 void setMessageDispatcher(MessageDispatcher dispatcher)
          Sets message dispatcher.
 void setServer(org.jwebsocket.api.WebSocketServer server)
          Sets jwebsocket server implementation.
 

Method Detail

sendMessage

void sendMessage(org.jwebsocket.token.Token token,
                 T conditionsObject)
Sends message to connectors obtained by processing conditions object. Every implementation can freely interpret condition object, so it can be map of conditions, or directly connector.

Parameters:
token - websocket token.
conditionsObject - conditions object.

setMessageDispatcher

void setMessageDispatcher(MessageDispatcher dispatcher)
Sets message dispatcher. Method is invoked by plugin at server start.

Parameters:
dispatcher - message dispatcher.

setServer

void setServer(org.jwebsocket.api.WebSocketServer server)
Sets jwebsocket server implementation. Method is invoked by plugin at server start.

Parameters:
server - jwebsocket server.


Copyright © 2011. All Rights Reserved.