next up previous contents
Next: RemoteMethodCall Up: Structural Patterns Previous: Example

   
MethodCall

This class represents a local method call. It is created giving the name of the method to be invoked (later) and a number of arguments. Arguments can also be added separately (they have to be added in the order of their formal parameters). Method Invoke takes as argument the target object on which the method is to be invoked. It returns an Object, which is either a return value (can also be null), or an exception. MethodCall is extended by RemoteMethodCall (2.2.8) to invoke methods in remote objects.

The static method CreateObjectFromByteBuffer can be used to unmarshal byte buffers into objects, e.g. reconstruct a MethodCall instance from a stream. The reverse, namely to marshal the method call into a byte buffer, can be done using method GetBytes.



Bela Ban
1998-08-06