What are Network Objects for Java
- A simplified implementation of the network objects of Birrel.
- Developed mainly for pedagogical purposes by L. Mateu.
- All the classes are provided by the package netobj.
- The development of the package took just two-weeks.
Restrictions
- Does not provides a garbage collector, though it is simple to
add it.
- Usable, but does not provide a stub/skeleton generator.
- No security manager, so does not support dynamic class loading.
- Not fully debugged.
Description
- The remote methods provided by network objects must be encapsulated on
a network interface.
- A network interface is any interface being a subtype of
the interface NetObj (equivalent to the Remote interface of RMI).
- Concrete object classes must be subclass of ConcreteNetObj
(equivalent to the UnicastRemoteServer class of RMI).
- A concrete object can be referenced remotely only through variables
declared as any of the network interfaces implemented by the concrete
object.
- All remote methods must throw the exception NetException (equivalent
to RemoteException in RMI).
Parameter passing and value returning
As in RMI:
- Primitive types are passed by value.
- Network objects are passed by reference (remote references).
- Serializable objects are passed by deep copy.
- Each object is trasmitted only once.
- Recursive data structures don't loop forever.
Importing and Exporting Network Objects
- A Java process is identified by the hostname where it runs and
the socket port where it serves remote requests.
- The programmer may specify which socket port to use for
serving remote requests.
- Network objects can be exported by giving them a name.
- A network object can be imported by specifying its name and
the identifier of the Java process where it lives.
- There is no equivalent to the rmiregistry, but it is simple
to write one.
Writing stubs and skeletons
- The package provides the classes ConcreteNetObjStub and ConcreteNetObjSkel
for implementing stubs and skeletons.
- Both classes provide useful methods to send and receive parameters
and to return a value.
- The stub class must be subclass of ConcreteNetObjStub and be named as
the name of the class of the concrete object plus the suffix Stub.
- The stub class must implement also the network interfaces supported
by the concrete object.
- The skeleton class must be a subclass of ConcreteNetObjSkel and be
named as the name of the class of the concrete object plus the suffix
Skel.
- Don't worry, I won't ask you to program the stub generator. So you
will have to write stubs and skeletons by hand.