Class agent.util.Message
All Packages Class Hierarchy This Package Previous Next Index
Class agent.util.Message
java.lang.Object
|
+----agent.util.Message
- public class Message
- extends Object
An abstract class for the messages that AgentServers
exchange with each other and with AgentLaunchers. Provides a
couple of utility functions to aid in message construction.
-
PREFIX_SIZE
-
-
command
-
-
msg
-
-
ZeroPadToLength(int, int)
- All field and message length indicators are sent as
zero-padded ascii integers.
-
createMessage()
- Message senders call this function to force the
construction of an actual message within the msg instance
variable.
-
getMessageBytes()
- Return a lump of bytes that is a valid message of this
type.
-
makePrefix(String, int, int)
- Make a string that is a valid field prefix in the format:
FieldName
Length of length
command
protected byte command[]
msg
protected byte msg[]
PREFIX_SIZE
public final static int PREFIX_SIZE
createMessage
public abstract void createMessage()
- Message senders call this function to force the
construction of an actual message within the msg instance
variable. Implementors MAY put message creation into the
constructor if they wish, and leave createMessage as an empty
method. Current implementations put all message creation code
here.
makePrefix
public String makePrefix(String prefix,
int fieldlen,
int lensize)
- Make a string that is a valid field prefix in the format:
FieldName
Length of length
- Returns:
- String String representation of the field prefix. Use
String.getBytes on this String and resulting bytes go straight
into the message right before the field data.
ZeroPadToLength
public String ZeroPadToLength(int num,
int length)
- All field and message length indicators are sent as
zero-padded ascii integers. This turns the supplied number
into a string and zero pads it to the specified length.
- Parameters:
- int - the number that needs to be converted to a string
- Returns:
- String
getMessageBytes
public byte[] getMessageBytes()
- Return a lump of bytes that is a valid message of this
type. Depends on createMessage to fill in the instance
variable msg.
- Returns:
- A lump of message bytes, suitable for transmission.
All Packages Class Hierarchy This Package Previous Next Index