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
MessageHandlers. 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
EventObjects as our messages, and leveraging the
model of event sources and listeners from the JDK to build a
message-handling framework.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access