All Packages  This Package  Class Hierarchy  Class Search  Index

Class utah.npm.core.IPCPayload


public class  IPCPayload
     extends java.lang.Object
          // Fields 18
     public byte[] recvBuf;
     public int recvBufEnd;
     public int recvBufStart;
     public Object[] recvObjTab;
     public int recvObjTabEnd;
     public int recvObjTabStart;
     public Reference[] recvRefTab;
     public int recvRefTabEnd;
     public int recvRefTabStart;
     public byte[] sendBuf;
     public int sendBufEnd;
     public int sendBufStart;
     public Object[] sendObjTab;
     public int sendObjTabEnd;
     public int sendObjTabStart;
     public Reference[] sendRefTab;
     public int sendRefTabEnd;
     public int sendRefTabStart;

          // Constructors 1
     public IPCPayload();

          // Methods 4
     static final boolean byteCopy(IPCPayload, IPCPayload);
     static final boolean objCopy(IPCPayload, IPCPayload);
     static final int transfer(IPCPayload, IPCPayload);

     protected Object clone() throws CloneNotSupportedException, OutOfMemoryError;

IPCPayload defines the data to send in an IPC operation and/or to receive in an operation.

There are send/recv pairs for data (*Buf), NPM References (*RefTab), and arbitrary Java objects (*ObjTab). For each type of data, the associated *Start and *Length parameters define the start offset in the buffer and the end offset. After a successful receive, the recv*Start field will point to the end of the received data. After a successful send, the send*Start field will point to the end of the data sent. This means that for partially completed sends and receives, the IPCPayload buffers will be all set to resume the operation at the point of interruption.

There are no public methods in this class. Just set the defined objects as you need.

All of the return codes used are defined in the ThreadIPC class.

TODO: The copy function really should be native methods

NPMJava 0.5.0 April, 1998
Patrick Tullmann

See Also: IPC, ThreadIPC


· sendBuf

Summary  |  Top

   public byte[] sendBuf

· sendBufStart

Summary  |  Top
   public int sendBufStart

· sendBufEnd

Summary  |  Top
   public int sendBufEnd

· recvBuf

Summary  |  Top
   public byte[] recvBuf

· recvBufStart

Summary  |  Top
   public int recvBufStart

· recvBufEnd

Summary  |  Top
   public int recvBufEnd

· sendRefTab

Summary  |  Top
   public Reference[] sendRefTab

· sendRefTabStart

Summary  |  Top
   public int sendRefTabStart

· sendRefTabEnd

Summary  |  Top
   public int sendRefTabEnd

· recvRefTab

Summary  |  Top
   public Reference[] recvRefTab

· recvRefTabStart

Summary  |  Top
   public int recvRefTabStart

· recvRefTabEnd

Summary  |  Top
   public int recvRefTabEnd

· sendObjTab

Summary  |  Top
   public Object[] sendObjTab

· sendObjTabStart

Summary  |  Top
   public int sendObjTabStart

· sendObjTabEnd

Summary  |  Top
   public int sendObjTabEnd

· recvObjTab

Summary  |  Top
   public Object[] recvObjTab

· recvObjTabStart

Summary  |  Top
   public int recvObjTabStart

· recvObjTabEnd

Summary  |  Top
   public int recvObjTabEnd


· IPCPayload

Summary  |  Top

   public IPCPayload() 

Default constructor


· byteCopy

Summary  |  Top
   static final boolean byteCopy(IPCPayload from, 
                                 IPCPayload to) 

Copy a chunk of bytes from from to to. Bad start/end pairs for each array are handled the same as start/end pairs that are too small. For example, if the send buffer start is 10 and end is 5, the function simply transfers nothing and returns success.

XXX This should go native.

Parameter Description
from the payload to copy from
to the payload to copy into

true if data was copied, false if the to array was too small for the all the data in from.

· objCopy

Summary  |  Top
   static final boolean objCopy(IPCPayload from, 
                                IPCPayload to) 

Same as bufCopy, but for an array of objects.

XXX This should be native.

· transfer

Summary  |  Top
   static final int transfer(IPCPayload from, 
                             IPCPayload to) 

Transfer from payload send buffers into to payload recv buffers. First the raw byte data buffer is copied, then the reference tables, and finally, the Java object buffer. Returns one of RC_OK, RC_MOREDATA, RC_MOREREFS, or RC_MOREOBJS. Errors are only "possible" on the receiver side, so these return codes reflect that exclusively.

Parameter Description
from the payload to copy data out of (from its send buffers)
to the payload to copy data into (to its recv buffers)

RC_OK if all went well, otherwise and RC code describing the problem.

· clone

Summary  |  Top
   protected Object clone()  throws CloneNotSupportedException, OutOfMemoryError

Create a deep copy of this IPCPayload.

a new IPCPayload object with copies of the entire buffers and buffer state of this payload.
clone in class Object

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