8.4. Putting the Pieces Together
Now that we've seen the details of the various classes and interfaces that come into play in distributed event programming, we'll see how to use them by building an advanced example. The example we're going to build is a channel relay, based on channel distributed data structures. A thread will continually append messages to two channels. At the same time, a relayer object acts as a listener that's notified whenever the tail of either channel changes—indicating that new items have been added—and is responsible for transferring all messages appearing in those channels to a third. The functionality of the application will serve to illustrate the important points of event notification and event handling.
We could, ...
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.