private void doFireClientEvent(final Client client, final boolean connected) { if (client == null) throw new IllegalArgumentException("Client is null."); for (final ClientListener clientListener : listeners) { concurrentMapManager.node.executorManager.executeNow(new Runnable() { public void run() { if (connected) { clientListener.clientConnected(client); } else { clientListener.clientDisconnected(client); } } }); } }
public void addClientListener(ClientListener clientListener) { listeners.add(clientListener); }
public void removeClientListener(ClientListener clientListener) { listeners.remove(clientListener); }