Chapter 6. Message-Passing Systems
In this chapter we examine applications that use message-passing
schemes to distribute information between agents in a distributed
system. The first thing we’ll do is define what we mean by
“message passing,” then we’ll look at some ways
that messages can be handled by a Java agent. We’ll build two
versions of a message-passing system. The first is based on a
homegrown message-handling system, with Message
objects being transmitted over I/O streams between
MessageHandler
s. Most of our discussion about
message passing will be based on these classes. Near the end of the
chapter, we’ll look at a message-passing system based on the
delegation event model built into the JDK and used by the AWT
package. In this case, we’ll be using
EventObject
s as our messages, and leveraging the
model of event sources and listeners from the JDK to build a
message-handling framework.
Get Java Distributed Computing 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.