public class NettyServer extends Object implements MessageTransferServer
SynchronizeFxServer.| Modifier and Type | Field and Description |
|---|---|
protected Serializer |
serializer
The serializer that should be used to serialize SynchronizeFX messages.
|
| Constructor and Description |
|---|
NettyServer(int port,
Serializer serializer)
Takes the required informations needed to start the server but doesn't actually start it.
|
| Modifier and Type | Method and Description |
|---|---|
protected List<Object>[] |
chunk(List<Object> messages)
Splits a big list of messages which should be send into smaller lists of messages that can be send
individually.
|
void |
onConnectFinished(Object client) |
void |
send(List<Object> messages,
Object destination) |
void |
sendToAll(List<Object> messages) |
void |
sendToAllExcept(List<Object> messages,
Object nonReciver) |
void |
setTopologyLayerCallback(NetworkToTopologyCallbackServer callback) |
void |
shutdown() |
void |
start() |
protected final Serializer serializer
public NettyServer(int port,
Serializer serializer)
SynchronizeFxServer.port - The port to which to listen for new connections.serializer - The serializer that should be used to serialize SynchronizeFX messages.public void setTopologyLayerCallback(NetworkToTopologyCallbackServer callback)
setTopologyLayerCallback in interface MessageTransferServerpublic void start()
throws SynchronizeFXException
start in interface MessageTransferServerSynchronizeFXExceptionpublic void onConnectFinished(Object client)
onConnectFinished in interface MessageTransferServerpublic void sendToAll(List<Object> messages)
sendToAll in interface MessageTransferServerpublic void sendToAllExcept(List<Object> messages, Object nonReciver)
sendToAllExcept in interface MessageTransferServerpublic void send(List<Object> messages, Object destination)
send in interface MessageTransferServerpublic void shutdown()
shutdown in interface MessageTransferServerprotected List<Object>[] chunk(List<Object> messages)
NettyEndPoint.CHUNK_SIZE elements. All
other lists have NettyEndPoint.CHUNK_SIZE elements.messages - the big list that be split.Copyright © 2014 Saxonia Systems AG. All Rights Reserved.