Chapter 12. Agents and patterns

  • Introduction—Mobile agents—Callbacks—Mobile servers—Agents and design patterns—Adapter—Proxy—Client-server patterns—Singleton—Remote factory—Abstract remote—Session—Exercises—Remarks

In this chapter

We discuss mobile agents as a programming technique made possible by RMI, and their relationship to various existing “design patterns”. We then consider some fundamental design patterns as they relate to RMI, and introduce a few variants of our own—including the “Abstract Remote” pattern.

Introduction

An agent acts on your behalf. As in a spy novel, you send an agent somewhere, or leave him behind to carry out your instructions when you move.

Agents in RMI exploit two features of Java: serialization and polymorphism. Serialization ...

Get java.rmi: The Remote Method Invocation Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.