3. How it's done
The code in the wrapper classes is just code one would construct ``by hand'' if one were directly using the cam.netapp classes. For example, if one considers the two classes AclassCI.java and AclassSI.java that are generated, one sees that the client implementation (CI) contains the public methods of Aclass. For each method in the CI implementation, a vector of parameters
methodData is created and transmitted to the corresponding server (SI) class. The first element of
contains the index of the method, and the remaining elements of the vector contain the method parameters.
All parameters are transformed to Object instances before transmission, e.g. an int parameter is transformed to
an Integer object before being added to the vector of data.
The vector of data is transmitted over a connection established using a cam.netapp.NetworkConnection instance. There is one single transmission statement;
method automatically serializes all the elements of the data vector, and then writes the results to its associated
stream. On the receiving end, the server (SI) class has a single read statement that listens for the vector of
method data. Once this vector is received, the data is unpacked, and the appropriate method of a local instance
of Aclass is called. Every routine in the server implementation creates a return vector that carries return status,
return data, and any exceptions that may have been called. The client implementation (CI) reads the return data,
un-packs it, and returns to the invoking program.
To construct the client (CI) and server (SI) wrapper classes the CreateCISI application uses a utility class CreateNetAppWrappers. This utility class first loads an instance of Aclass, then uses Java's class reflection methods (i.e. the methods of java.lang.Class) to determine the public methods, parameters, return types, etc. and then writes the wrapper class code using this information.