Catherine Tornabene CHAIMS Project README RMI Wrappers 1.0 - How To Wrap June 19, 1998 In this README, I will discuss the steps necessary to wrap a megamodule. Since some of the changes will need to be customized, this is intended as a general guide. Exact steps will be specific to the wrapped megamodule. The best guides are probably the files FirstTestWrapper.java, SecondTestWrapper.java, and NaoParameterObject.java. These are the customized files that I used to wrap the TestObject server. The customized wrapper classes, FirstTestWrapper.java and SecondTestWrapper.java extend the class LocalMethodWrapper.java. The LocalMethodWrapper class is abstract, which is intended to force anybody desiring to wrap a megamodule to implement their own version of the following methods: public abstract void callMethod(ChaimsAttrValContainer c, Object obj); public abstract byte[] convertResultToBlob(); public abstract void initializeParameters(); public abstract void initializeName(); If the megamodule method does not use any complex types, but rather only uses boolean, integer, or String types, then the best model to use is the class SecondTestWrapper. This wraps a method that only takes and returns simple types. Information about the pararmeters can be stored in the ParameterObject class, in this case, because the ParameterObject class provides type and name checking for simple types. However, if the local method takes complex objects as parameters, then some further customization is necessary. In this case, the class FirstTestWrapper is the best model. FirstTestWrapper takes as a parameter the object NameAddressObject and then, after the firstTest() method completes execution, returns a modified NameAddressObject. Since NameAddressObject is a complex object, it is impossible to use the type and name checking methods in the ParameterObject, so we extend the ParameterObject class to create a specialized NaoParameterObject class. (Nao = NameAddressObject). The NaoParameterObject overrides the method 'parameterTypeMatches(Object o)' from its parent. This method checks to make sure the parameter sent via the INVOKE call is an acceptable argument to the wrapped method. By overriding this method, we ensure that checks on NameAddressObject are specialized for that object. The NaoParameterObject also adds the call 'getComplexValue', which returns a new NameAddressObject that contains either the default values or the data sent via the ASN.1 package. This is necessary to create the new parameter to the desired method. The best way to customize your own method wrapper is to take the FirstTestWrapper and SecondTestWrapper classes and modify them to make your own.