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
-
ARGLEN_SIZE
-
-
ARG_PREFIX
-
-
DISPATCH_PREFIX
-
-
IDLEN_SIZE
-
-
ID_PREFIX
-
-
NAMELEN_SIZE
-
-
NAME_PREFIX
-
-
args
-
-
id
-
-
name
-
-
sig
-
-
DispatchMessage(String, String, Vector)
- Save the name, id and arguments for future use in
createMessage.
-
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.
-
parse(byte[], int)
- Parse the supplied byte array as if it were a dispatch
message.
DISPATCH_PREFIX
public final static String DISPATCH_PREFIX
ID_PREFIX
public final static String ID_PREFIX
NAME_PREFIX
public final static String NAME_PREFIX
IDLEN_SIZE
public final static int IDLEN_SIZE
NAMELEN_SIZE
public final static int NAMELEN_SIZE
ARGLEN_SIZE
public final static int ARGLEN_SIZE
ARG_PREFIX
public final static String ARG_PREFIX
name
public String name
id
public String id
sig
public String sig
args
public Vector args
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.
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
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