Class agent.util.LoadMessage
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class agent.util.LoadMessage

java.lang.Object
   |
   +----agent.util.Message
           |
           +----agent.util.LoadMessage

public class LoadMessage
extends Message
A message that tells the receiver to load, instantiate and run the class that is supplied in the message. Message format: The command Load 4 bytes The length 10 bytes ascii int The dispatching agent server Field hdr Dsrv 4 bytes length 4 bytes server-name:port length bytes The arguments (unlimited repetitions) Field hdr Arg_ 4 bytes length 4 bytes ascii int Argument data length bytes The signature Field hdr Sig_ 4 bytes The length 4 bytes The sig data length bytes The run id Field hdr ID__ 4 bytes The length 4 bytes The run id length bytes The class data (unlimited repetitions) Field hdr Clas 4 bytes length 10 bytes ascii int the class data length bytes Class contains both message construction and message parsing methods. Also contains some message processing in the form of class loading. Essentially, the receiver of a load message is looking to receive a Java Class, so the parse method implements this.
See Also:
DispatchMessage, Message

Variable Index

 o ARGLEN_SIZE
 o ARG_PREFIX
 o CLASSLEN_SIZE
 o CLASS_PREFIX
 o ClassPath
 o DSRVLEN_SIZE
 o DSRV_PREFIX
 o IDLEN_SIZE
 o ID_PREFIX
 o LOADLEN_SIZE
 o LOAD_PREFIX
 o PREFIX_SIZE
 o SIGLEN_SIZE
 o SIG_PREFIX
 o dispatching_server_name
 o dispatching_server_port
 o sid
 o vargs

Constructor Index

 o LoadMessage()
The do-nothing constructor.
 o LoadMessage(String, String, String, Vector, String, int)
This is the constructor used by an AgentServer that wishes to SEND a load message.

Method Index

 o LoadClassFromFile(String)
Load the specified class file into a byte array and return that byte array.
 o LoadClassesFromDirectory(String)
Load the instance variable otherclasses with byte arrays that are filled from ALL the class files (except the lead class) in the directory embedded in the supplied class name.
 o createMessage()
Actually fill the byte array 'msg' with ALL the bytes that make up this load message.
 o parse(byte[], int)
parse the supplied byte array as if it were a load message.

Variables

 o vargs
  public Vector vargs
 o sid
  public String sid
 o dispatching_server_name
  public String dispatching_server_name
 o dispatching_server_port
  public int dispatching_server_port
 o PREFIX_SIZE
  public final static int PREFIX_SIZE
 o LOAD_PREFIX
  public final static String LOAD_PREFIX
 o ARG_PREFIX
  public final static String ARG_PREFIX
 o CLASS_PREFIX
  public final static String CLASS_PREFIX
 o SIG_PREFIX
  public final static String SIG_PREFIX
 o ID_PREFIX
  public final static String ID_PREFIX
 o DSRV_PREFIX
  public final static String DSRV_PREFIX
 o LOADLEN_SIZE
  public final static int LOADLEN_SIZE
 o ARGLEN_SIZE
  public final static int ARGLEN_SIZE
 o CLASSLEN_SIZE
  public final static int CLASSLEN_SIZE
 o SIGLEN_SIZE
  public final static int SIGLEN_SIZE
 o IDLEN_SIZE
  public final static int IDLEN_SIZE
 o DSRVLEN_SIZE
  public final static int DSRVLEN_SIZE
 o ClassPath
  public final static String ClassPath

Constructors

 o LoadMessage
  public LoadMessage()
The do-nothing constructor. Called when parsing a Load Message
 o LoadMessage
  public LoadMessage(String name,
                     String ID,
                     String thesig,
                     Vector args,
                     String dispatchServer,
                     int dispatchPort)
This is the constructor used by an AgentServer that wishes to SEND a load message. Supply the name of the lead class, the id, the signature, arguments, dispatching server and port.

Methods

 o parse
  public Object parse(byte b[],
                      int currentOffset)
parse the supplied byte array as if it were a load message. Start parsing at the supplied currentOffset. currentOffset should point to the FIRST byte of the SECOND field in a load message, i.e. to the first character in the word "DSrv". Fills the instance variables: dispatching_server_name dispatching_server_port vargs leadclass otherclasses ssig sid with data from the message. Instantiates the lead class if the message is OK, but does not call the run method.
 o LoadClassesFromDirectory
  public void LoadClassesFromDirectory(String leadclass)
Load the instance variable otherclasses with byte arrays that are filled from ALL the class files (except the lead class) in the directory embedded in the supplied class name.
 o LoadClassFromFile
  public byte[] LoadClassFromFile(String name)
Load the specified class file into a byte array and return that byte array. All class files are read into the load message via this method.
 o createMessage
  public void createMessage()
Actually fill the byte array 'msg' with ALL the bytes that make up this load message. Expects the intance variables: dispatching_server_name dispatching_server_port vargs leadclass otherclasses ssig sid to already be filled with valid data.
Overrides:
createMessage in class Message

All Packages  Class Hierarchy  This Package  Previous  Next  Index