JavaBeans provides a way for a JavaBean to declare events that may be fired by that Bean. Such a Bean that fires events is called an event source. Other objects may register with the event source to receive those events when they are fired. These objects are called the event listeners.

The JavaBeans specification explains how to create event sources and listeners. The following is a short example that demonstrates how Nucleus services can fire and listen for events. In this example, a StockPricer service fires stock events whenever it receives an update for a stock price. The StockWatcher service will listen for these events and print them out.

 
loading table of contents...