Exercise 5.18 required the client to convert Object arguments into an array of bytes before invoking doOperation and Exercise 5.20 required the dispatcher to convert an array of bytes into an array of Objects before invoking the method. Discuss the implementation of a new version of doOperation with the following signature:
```
Object [] doOperation (RemoteObjectRef o, Method m, Object[] arguments);
```
which uses the ObjectOutputStream and ObjectInputStream classes to stream the request and reply messages between client and server over a TCP connection. How would these changes affect the design of the dispatcher?
The method DoOperation sends the invocation to the target’s remote object reference by setting up a TCP connection to the host and port specified in ref. It opens an ObjectOutputStream and uses writeObject to marshal ref, the method, m and the arguments by serializing them to an ObjectOutputStream. For the results, it opens an ObjectIntputStream and uses readObject to get the results from the stream.
At the server end, the dispatcher is given a connection to the client and opens an ObjectIntputStream and uses readObject to get the arguments sent by the client. Its signature will be:
public void dispatch(Object target, Method aMethod)
You might also like to view...
Declaring instance variables ________ is known as data hiding or information hiding.
a. secure b. private c. static d. masked
You can change the size of a picture by using the height and width ____________________.
Fill in the blank(s) with the appropriate word(s).
What types of nouns resulting from a grammatical parse should be considered as potential analysis classes?
What will be an ideal response?
A(n) _____ data type is created by a schema author for specific data values in an instance document.
Fill in the blank(s) with the appropriate word(s).