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
-
ARGLEN_SIZE
-
-
ARG_PREFIX
-
-
CLASSLEN_SIZE
-
-
CLASS_PREFIX
-
-
ClassPath
-
-
DSRVLEN_SIZE
-
-
DSRV_PREFIX
-
-
IDLEN_SIZE
-
-
ID_PREFIX
-
-
LOADLEN_SIZE
-
-
LOAD_PREFIX
-
-
PREFIX_SIZE
-
-
SIGLEN_SIZE
-
-
SIG_PREFIX
-
-
dispatching_server_name
-
-
dispatching_server_port
-
-
sid
-
-
vargs
-
-
LoadMessage()
- The do-nothing constructor.
-
LoadMessage(String, String, String, Vector, String, int)
- This is the constructor used by an AgentServer that wishes
to SEND a load message.
-
LoadClassFromFile(String)
- Load the specified class file into a byte array and return
that byte array.
-
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.
-
createMessage()
- Actually fill the byte array 'msg' with ALL the bytes that
make up this load message.
-
parse(byte[], int)
- parse the supplied byte array as if it were a load
message.
vargs
public Vector vargs
sid
public String sid
dispatching_server_name
public String dispatching_server_name
dispatching_server_port
public int dispatching_server_port
PREFIX_SIZE
public final static int PREFIX_SIZE
LOAD_PREFIX
public final static String LOAD_PREFIX
ARG_PREFIX
public final static String ARG_PREFIX
CLASS_PREFIX
public final static String CLASS_PREFIX
SIG_PREFIX
public final static String SIG_PREFIX
ID_PREFIX
public final static String ID_PREFIX
DSRV_PREFIX
public final static String DSRV_PREFIX
LOADLEN_SIZE
public final static int LOADLEN_SIZE
ARGLEN_SIZE
public final static int ARGLEN_SIZE
CLASSLEN_SIZE
public final static int CLASSLEN_SIZE
SIGLEN_SIZE
public final static int SIGLEN_SIZE
IDLEN_SIZE
public final static int IDLEN_SIZE
DSRVLEN_SIZE
public final static int DSRVLEN_SIZE
ClassPath
public final static String ClassPath
LoadMessage
public LoadMessage()
- The do-nothing constructor. Called when parsing a Load
Message
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.
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.
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.
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.
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