wrapper
Class CPAMInterface

java.lang.Object
  |
  +--wrapper.CPAMInterface

public class CPAMInterface
extends java.lang.Object

General class for interfacing to a megamodule. Subclasses implement the various protocols for CPAM. This class offers a test-routine to test wrapped megamodules locally without using a distribution system to access them. Methods for accepting messages over CPAM and returning messages must be added by subclasses.


Field Summary
protected  CPAMMegamodule m
          Reference to the megamodule instance belonging to this interface instance.
protected  java.lang.String paramType
          Indicates which kind of parameters have to be expected; valid values are so far "String" and "Gentype"
 
Constructor Summary
CPAMInterface()
          Never use this constructor.
CPAMInterface(java.lang.String paramType, java.lang.String megamodule)
          Instantiates a megamodule inclusive its interface to a distribution protocol.
 
Method Summary
 void test()
          Interactive test method.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m

protected CPAMMegamodule m
Reference to the megamodule instance belonging to this interface instance. An instance of CPAMMEgamodule is automatically created when CPAMInterface is instanciated. The reference m is needed for accessing its methods when handling CPAM messages.

paramType

protected java.lang.String paramType
Indicates which kind of parameters have to be expected; valid values are so far "String" and "Gentype"
Constructor Detail

CPAMInterface

public CPAMInterface()
              throws java.rmi.RemoteException
Never use this constructor.

CPAMInterface

public CPAMInterface(java.lang.String paramType,
                     java.lang.String megamodule)
              throws java.rmi.RemoteException
Instantiates a megamodule inclusive its interface to a distribution protocol. Megamodule is the name of the wrapped computational code and is a subclass of CPAMMegamodule. Paramtype is so far either String or Gentype and indicates the type of parameters used by the interface class (and of course also by the wrapped computational code).

This constructor starts up a megamodule instance. It can be expanded by a subclass of CPAMInterface to also register the megamodule in a registry for remote access.

Method Detail

test

public void test()
Interactive test method. Allows to test a megamodule instance interactively even without any CPAM interface. In case of wrong inputs or other errors, exceptions will be thrown and printed out, yet interaction can continue. For a description of the commands and the possible parameters, see the description of CPAM and the appropriate CHAIMS repository.