|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IWireState
An object that can read and write its internal state into a 'wire' format suitable for transporting to and from foreign hosts. The wire format is the fulmine delta (FD) protocol format.
When transmitting an IWireState
from a host, the object writes its
state (including its identity) to byte buffers that are sent to the network
transport layer as an FD frame. On the receiving host, the FD frame is
received, the byte buffers are reconstructed from the network transport layer
and the identity is extracted. An IWireState
object with the same
identity is located and the bytes are given to this object to process. This
object updates its internal state from the received byte buffers.
The mechanism for how the receiving host locates an IWireState
object
with the same identity is an implementation specific detail.
Method Summary | |
---|---|
void |
readState(IOperationScope scope,
byte[] buffer,
int start,
int numberOfBytes)
Update this object's internal state from the fulmine delta (FD) wire format state encapsulated in the byte buffer. |
void |
writeState(IOperationScope scope,
IWireIdentity wireId,
byte[][] headerBuffer,
int[] headerBufferPosition,
byte[][] dataBuffer,
int[] dataBufferPosition,
boolean completeState)
Write the state of this object in fulmine delta (FD) wire format to the byte buffers. |
Method Detail |
---|
void writeState(IOperationScope scope, IWireIdentity wireId, byte[][] headerBuffer, int[] headerBufferPosition, byte[][] dataBuffer, int[] dataBufferPosition, boolean completeState)
The object fields are written into headerBuffer[0] starting at headerBufferPosition[0]. The fields are written in 'component spec' format. The diagram below illustrates the IWF component spec for a single component:
------------------------------------------------------- | 1 byte | component bytes | data bytes | ------------------------------------------------------- | 7 6 5 4 3 2 1 0 | | | ------------------------------------------------------- | fbc | dbc | component | data position | -------------------------------------------------------
------------------------------------------------------- | 1 byte | 1 byte | component bytes | data bytes | ------------------------------------------------------- | fbc | dbc | component | data position | -------------------------------------------------------The data is written into dataBuffer[0] starting at dataBufferPosition[0].
scope
- the scope of the write state operationwireId
- the wire identity, expresses if this is an IWF or SWF
component specheaderBuffer
- headerBuffer[0] holds the header buffer to write the component
spec that describes the object's fields and their
corresponding data positions in the dataBufferheaderBufferPosition
- headerBufferPosition[0] holds the current position in the
headerBuffer[0]dataBuffer
- dataBuffer[0] holds the data buffer that component data is
written todataBufferPosition
- dataBufferPosition[0] holds the current position in the
dataBuffer[0]completeState
- whether to write the complete state or only changesvoid readState(IOperationScope scope, byte[] buffer, int start, int numberOfBytes)
The wire format state includes the fields of the object that have changed. The logic to read the component state should be delegated to the individual component.
scope
- the scope of the read state operationbuffer
- the byte buffer that holds the contiguous wire format state to
read, at some positionstart
- where the wire format state begins in the byte buffernumberOfBytes
- the number of bytes in the byte buffer to read the wire format
state
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |