java.lang.Object
nl.andrewl.concord_server.event.EventManager
The event manager is responsible for the server's ability to respond to
various client requests.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<Class<? extends nl.andrewl.concord_core.msg.Message>,
MessageHandler<?>> private final ConcordServer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends nl.andrewl.concord_core.msg.Message>
voidhandle
(T message, ClientThread client) Handles a new message that was sent from a client.
-
Field Details
-
messageHandlers
private final Map<Class<? extends nl.andrewl.concord_core.msg.Message>,MessageHandler<?>> messageHandlers -
server
-
-
Constructor Details
-
EventManager
-
-
Method Details
-
handle
Handles a new message that was sent from a client. Tries to find an appropriate handler for the message, and if one is found, calls theMessageHandler.handle(Message, ClientThread, ConcordServer)
method on it.Note that it is expected that client threads will invoke this method during their
ClientThread.run()
method, so concurrent invocation is expected.- Type Parameters:
T
- The type of message.- Parameters:
message
- The message that was sent by a client.client
- The client thread that is used for communicating with the client.
-