8.1. Events in the Distributed Environment

Java provides a simple but powerful event model based on event sources, event listeners and event objects (see Figure 8.1). An event source is any object that “fires” an event. Events may be fired based on any internal state change in an object. For instance, an object representing a graphical button may fire an event when a user clicks on the button.

Figure 8.1. The Java programming language event model: event source, event object, and event listeners in a single JVM environment.

An event listener is an object that listens for events fired by an event source. Typically an event source provides a method ...

Get JavaSpaces™ Principles, Patterns, and Practice now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.