Stubs
To call a method on a remote machine, a surrogate method is set up for you on the local machine, called the stub.
It packages the parameters, resolving local references. This is called marshalling the parameters:
- device-independent encoding of numbers
- strings and objects may have local memory references and so are passed by object serialization
The stub builds an information block with
- An identifier of the remote object to be used
- An operation number, describing the method to be called
- The marshalled parameters
Stubs will also “unmarshall” return values after the call and receive RemoteExceptions. It will throw the exceptions in the local space.