All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.ants.ants.DLResponseCapsule
java.lang.Object
   |
   +----edu.utah.janos.ants.ants.Capsule
           |
           +----edu.utah.janos.ants.ants.DLResponseCapsule

  Summary

public class  DLResponseCapsule
     extends edu.utah.janos.ants.ants.Capsule
{
          // Fields 11
     static final byte[] MID;
     private static final byte[] PID;
     public static final String VERSION;
     private int chunkMask;
     private int clen;
     private ByteArray code;
     private int coff;
     private TypeID groupID;
     private TypeID[] groups;
     private String name;
     private TypeID payloadID;

          // Constructors 2
     DLResponseCapsule();
     DLResponseCapsule(CapsuleClass, int, int, int);

          // Methods 6
     public Xdr decode();
     public Xdr encode();
     public boolean evaluate(Node);
     public int length();
     protected byte[] mid();
     protected byte[] pid();
}

Demand Load Response capsule. DLResponseCapsules are only created by a DLRequestCapsule that has been delivered to a node that can satisfy the request. DLResponseCapsules contain a single "chunk" of a CodeGroup.

A DLResponseCapsule packet contains the following fields (on top of the base Capsule fields):

See Also: DLProtocol, DLRequestCapsule, CodeGroup




  Fields

· VERSION

Summary  |  Top

   public static final String VERSION


· MID

Summary  |  Top
   static final byte[] MID


· PID

Summary  |  Top
   private static final byte[] PID


· payloadID

Summary  |  Top
   private TypeID payloadID

The MID of the CapsuleClass owning the chunk this capsule contains.


· groupID

Summary  |  Top
   private TypeID groupID

The GID of the CodeGroup this chunk belongs to.


· groups

Summary  |  Top
   private TypeID[] groups

The GID of every other CodeGroup in the Protocol this CodeGroup is part of. This is the only way a CodeGroup can compute its ProtocolID.

XXX seems like it would be more efficient to just send the ProtocolID across the wire and double check it after the CodeGroup is loaded. XXX Probably a security concern.


· chunkMask

Summary  |  Top
   private int chunkMask

The mask containing only the index of the chunk (in the CodeGroup's chunkmask) contained in this Capsule.


· clen

Summary  |  Top
   private int clen

Length of the full bytecode for the Class.


· coff

Summary  |  Top
   private int coff

Offset of this chunk in the CapsuleClass's code block.


· name

Summary  |  Top
   private String name

Name of the CapsuleClass this chunk represents.

XXX Only needs to be in the first chunk for a class.


· code

Summary  |  Top
   private ByteArray code

The chunk.


  Constructors

· DLResponseCapsule

Summary  |  Top

   DLResponseCapsule() 

Construct a blank DLResponseCapsule.

This is only invoked when a DLResponseCapsule capsule is received at a node and the node must construct a capsule before decoding the packet into it.



· DLResponseCapsule

Summary  |  Top
   DLResponseCapsule(CapsuleClass cc, 
                     int idx, 
                     int pos, 
                     int len) 

Construct a DLResponseCapsule that will contain the given chunk of the given method. Only invoked by DLRequestCapsule.evaluate().

Parameter Description
m The method which is being sent.
idx the chunk id
pos the position in the method's class file of the chunk start
len the size of the chunk (<= CodeGroup.CHUNK_SIZE)

See Also: evaluate



  Methods

· mid

Summary  |  Top
   protected byte[] mid() 
Overrides:
mid in class Capsule


· pid

Summary  |  Top
   protected byte[] pid() 
Overrides:
pid in class Capsule


· length

Summary  |  Top
   public int length() 
Overrides:
length in class Capsule


· encode

Summary  |  Top
   public Xdr encode() 
Overrides:
encode in class Capsule


· decode

Summary  |  Top
   public Xdr decode() 
Overrides:
decode in class Capsule


· evaluate

Summary  |  Top
   public boolean evaluate(Node node) 

Evalute a DLResponseCapsule at this node. Looks up the appropriate CapsuleClass and CodeGroup info, creating new ones if necessary.

XXX should deal with unanticipated DLResponseCapsules better.

Overrides:
evaluate in class Capsule


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7