Using DefaultClientListener
How to use the default client listener to avoid implementing all methods.
The publisher must implement all of the ClientListener methods.
For convenience, an abstract DefaultClientListener class is
provided which has empty implementations of all methods. This can be extended to
produce a class which implements only the methods you are interested in.
Alternatively an anonymous class can be used within the publisher as follows:
protected void initialLoad() throws APIException { Publishers.addEventListener( new DefaultClientListener() { public void clientConnected(Client client) { LOG.info("Client {} connected",client); } public void clientClosed(Client client) { LOG.info("Client {} closed",client); } }); }