Chapter 15. Asynchronous beans 419
EventListener
Event listeners are asynchronous by nature. An application can create an
event listener and subscribe it to monitor the occurrence of a certain event.
When the event occurs, the listener will be notified and will handle the event.
Listeners can implement any interface, however, the application that
originates the event needs to know which method corresponds to the event
on the listener’s interface. The event originator will do this by acquiring a
“proxy” from the EventSource. Calling a method on the proxy will cause the
same method to be invoked on all listeners that are registered and implement
the requested interface.
The listener’s method will be executed in its own thread but it will r ...