COMP 310
Spring 2010
|
Lec25: RMI...
|
 |
The code has been updated to enable the GUI's to be edited using Jigloo.
Please download the new version!
Continuing our discussion of the remote task execution example...
- RegistryFactory:
- Has static services for creating and/or locating the Registry for
the client and server use.
- Uses techniques for composing lambdas to enable the methods to send
multiple messages to multiple output targets.
- Exchange of stubs to establish views of client and server on each other:
- client and server can talk directly to each other's views.
- Serialization:
- See Pi.java code
- Serializable interface tells the
compiler that this object can be serialized, i.e. its data (not its
code!) can be turned into a byte stream and sent over the network.
- Code, if needed, is transmitted separately and automatically.
The client's java.rmi.server.codebase
value is imbedded in the serialized byte stream. The
receiver Java class loader will look at this value and find the
class file server on the sender and then issue an http-type request
to download the associated class file.
- Note that the class file server does not have to be co-located
with the serialized object's sender. The class file
server can be a separate machine altogether, e.g. a central class
file repository.
- transient fields are not serialized.
- Optional readObject method is used for
custom deserialization processes, here to reinitialize the
transient taskView
field. The server will attach its own
ITaskView adapter so the transmitted task can communicate to the
server.
- TCP ports used:
- IRMI_Defs.REGISTRY_PORT - used by the
Registry. Inbound on the server.
- IRMI_Defs.CLASS_SERVER_PORT_A - Part of
java.rmi.server.codebase which tells what
port on the server where the class files can be downloaded from.
The port the class file server is attached to. Inbound on
the server.
- IRMI_Defs.CLASS_SERVER_PORT_B - Same as
IRMI_Defs.CLASS_SERVER_PORT_A but for the
client.
- ITextAdapater.BOUND_PORT_A - The port
the compute engine and the view adapter back to the server are bound to.
Inbound on the server.
- ITextAdapater.BOUND_PORT_B - The port
the view adapter back to the client is bound to. Inbound on the
client.
© 2010 by Stephen Wong