public class ServerListenerManager
extends java.lang.Object
| Constructor | Description |
|---|---|
ServerListenerManager() |
Constructs a new
ServerListenerManager with no listeners pre-registered |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addCommandListener(CommandListener listener) |
Adds the specified
CommandListener to the list |
void |
addConnectionListener(ServerConnectionListener listener) |
Adds the specified
ServerConnectionListener to the list |
void |
addMessageListener(MessageListener listener) |
Adds the specified
MessageListener to the list |
void |
raiseCommandEvent(Command command) |
Runs each of the
CommandListeners with the command as input |
void |
raiseConnectionEvent(ServerConnection connection,
Connection.event event) |
|
void |
raiseMessageEvent(Message message) |
Runs each of the
MessageListeners with the message as input |
void |
removeAllListeners() |
Removes every single listener registered to the server
|
void |
removeCommandListener(CommandListener listener) |
Removes the specified
CommandListener from the list |
void |
removeConnectionListener(ServerConnectionListener listener) |
Removes the specified
ServerConnectionListener from the list |
void |
removeMessageListener(MessageListener listener) |
Removes the specified
MessageListener from the list |
public ServerListenerManager()
ServerListenerManager with no listeners pre-registeredpublic void addMessageListener(MessageListener listener)
MessageListener to the listlistener - the listener to be addedpublic void removeMessageListener(MessageListener listener)
MessageListener from the listlistener - the listener to be removedpublic void addCommandListener(CommandListener listener)
CommandListener to the listlistener - the listener to be addedpublic void removeCommandListener(CommandListener listener)
CommandListener from the listlistener - the listener to be removedpublic void addConnectionListener(ServerConnectionListener listener)
ServerConnectionListener to the listlistener - the listener to be addedpublic void removeConnectionListener(ServerConnectionListener listener)
ServerConnectionListener from the listlistener - the listener to be removedpublic void removeAllListeners()
public void raiseMessageEvent(Message message)
MessageListeners with the message as inputmessage - the Message to pass to each of the listenerspublic void raiseConnectionEvent(ServerConnection connection, Connection.event event)
connection - the ServerConnection to pass to each of the listenersevent - the Connection.event associated with the connectionpublic void raiseCommandEvent(Command command)
CommandListeners with the command as inputcommand - the Command to pass to each of the listeners