Listener pattern implementation
Naming the classes and the design (at least as far as I can see from the code you pasted) suggests that you want to use the observer pattern. The main idea of this pattern is to use listeners which implement common listener interface and register them for the specific object which you want to make 'observable'. Then in the observable object you can call notifyAllListeners() method or notifyAllListenersOnError() or some similar which will do nothing else than for listener from registered listeners call listener.notify() (or listener.onError() etc.).

Methods notify(), onError() etc have to be declared in the common listener interface.

What I mean is described here.

The main idea is:


Create observable object.
Create as many listeners which implements common listener interface.
Register all created listeners for the observable object.
In the observable object call notifyAll code.




I also created a short article which explains the idea.