All Packages This Package Class Hierarchy Class Search Index
Class utah.npm.core.IPCPayload
java.lang.Object
|
+----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
- Version:
- NPMJava 0.5.0 April, 1998
- Author:
-
Patrick Tullmann tullmann@cs.utah.edu
See Also:
IPC, ThreadIPC
public byte[] sendBuf
public int sendBufStart
public int sendBufEnd
public byte[] recvBuf
public int recvBufStart
public int recvBufEnd
public Reference[] sendRefTab
public int sendRefTabStart
public int sendRefTabEnd
public Reference[] recvRefTab
public int recvRefTabStart
public int recvRefTabEnd
public Object[] sendObjTab
public int sendObjTabStart
public int sendObjTabEnd
public Object[] recvObjTab
public int recvObjTabStart
public int recvObjTabEnd
public IPCPayload()
Default constructor
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 |
- Returns:
- true if data was copied, false if the to array
was too small for the all the data in from.
static final boolean objCopy(IPCPayload from,
IPCPayload to)
Same as bufCopy, but for an array of objects.
XXX This should be native.
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) |
- Returns:
-
RC_OK
if all went well, otherwise and RC
code describing the problem.
protected Object clone() throws CloneNotSupportedException, OutOfMemoryError
Create a deep copy of this IPCPayload.
- Returns:
- a new IPCPayload object with copies of the entire buffers
and buffer state of this payload.
- Overrides:
- 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