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

Class agent.util.DispatchMessage

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

public class DispatchMessage
extends Message
A message from an AgentLauncher telling the AgentServer recipient to dispatch the agent named in the message to all the AgentServers in his list. Format: Message hdr Disp 4 bytes length of length 4 bytes ascii integer length length bytes ascii integer Class File Name Field hdr Name 4 bytes length 4 bytes ascii integer Name data length bytes Agent ID Field hdr ID__ 4 bytes length 4 bytes ascii integer ID data length bytes Argument Field hdr Arg_ 4 bytes length 4 bytes ascii integer Argument data length bytes

Variable Index

 o ARGLEN_SIZE
 o ARG_PREFIX
 o DISPATCH_PREFIX
 o IDLEN_SIZE
 o ID_PREFIX
 o NAMELEN_SIZE
 o NAME_PREFIX
 o args
 o id
 o name
 o sig

Constructor Index

 o DispatchMessage(String, String, Vector)
Save the name, id and arguments for future use in createMessage.

Method Index

 o createMessage()
Create a useable message from the instance variables: id args name When this method is done, the msg byte array contains a message that can be sent over the wire.
 o parse(byte[], int)
Parse the supplied byte array as if it were a dispatch message.

Variables

 o DISPATCH_PREFIX
  public final static String DISPATCH_PREFIX
 o ID_PREFIX
  public final static String ID_PREFIX
 o NAME_PREFIX
  public final static String NAME_PREFIX
 o IDLEN_SIZE
  public final static int IDLEN_SIZE
 o NAMELEN_SIZE
  public final static int NAMELEN_SIZE
 o ARGLEN_SIZE
  public final static int ARGLEN_SIZE
 o ARG_PREFIX
  public final static String ARG_PREFIX
 o name
  public String name
 o id
  public String id
 o sig
  public String sig
 o args
  public Vector args

Constructors

 o DispatchMessage
  public DispatchMessage(String Name,
                         String ID,
                         Vector Args)
Save the name, id and arguments for future use in createMessage.
Parameters:
Name - The String filename of the lead .class file.
ID - The id of this Agent, set by AgentLauncher
Args - A vector of argument data, significant ONLY to the Agent himself.

Methods

 o createMessage
  public void createMessage()
Create a useable message from the instance variables: id args name When this method is done, the msg byte array contains a message that can be sent over the wire.
Overrides:
createMessage in class Message
 o parse
  public boolean parse(byte b[],
                       int co)
Parse the supplied byte array as if it were a dispatch message.
Parameters:
b - An array of bytes containing message data.
co - The offset of the SECOND field in the message.
Returns:
true if successful, false otherwise

All Packages  Class Hierarchy  This Package  Previous  Next  Index