public abstract class Field extends Object implements IPumpable, Serializable
Fields that are handled by the gRS2 set of components. All implementations
of this abstract class must define a default constructor without arguments as instances of these classes will be instantiated
using reflection based on the existence of a default no arguments constructor| Modifier and Type | Field and Description |
|---|---|
protected Record |
record
The
Record this field is bound to |
| Constructor and Description |
|---|
Field() |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(Record record)
|
void |
deflate(DataOutput out)
Deflates the state and data of the implementor in a from capable of reconstructing the exact same instance
|
void |
dispose()
Disposes all internal state and invokes
extendDispose() |
abstract void |
extendDeflate(DataOutput out)
Method that needs to be implemented by the class extenders to deflate the information they keep
|
abstract void |
extendDispose()
Method to be implemented by class extenders to dispose their internal state
|
abstract void |
extendFromXML(Element element,
boolean reset) |
abstract void |
extendInflate(DataInput in,
boolean reset)
Method that needs to be implemented by the
Field extenders to inflate their internal information |
protected abstract void |
extendMakeLocal()
Method that needs to be implemented by the class extenders to reset any additional information concerning previous executed
transfers they keep and make the field behave as if it were local
|
abstract void |
extendReceive(DataInput in,
IBuffer.TransportOverride override)
Method that needs to be implemented by the
Field extenders to receive their priveously send information |
abstract void |
extendReceiveFromXML(Element element,
IBuffer.TransportOverride override) |
abstract void |
extendSend(DataOutput out,
IBuffer.TransportOverride override)
Method that needs to be implemented by the class extenders to send the information they keep
|
abstract void |
extendSendToXML(Document doc,
Element element,
IBuffer.TransportOverride override) |
abstract void |
extendToXML(Document doc,
Element element) |
void |
fromXML(Element element) |
void |
fromXML(Element element,
boolean reset) |
int |
getDefinitionIndex()
|
FieldDefinition |
getFieldDefinition()
|
abstract InputStream |
getInputStream()
Provides an
InputStream over the locally available payload of the Field |
MediatingInputStream |
getMediatingInputStream()
Retrieves an
MediatingInputStream over this Field |
void |
inflate(DataInput in)
Inflate the state and data of the implementor as was previously deflated using
IPumpable.deflate(DataOutput) |
void |
inflate(DataInput in,
boolean reset)
Inflate the state and data of the implementor as was previously deflated using
IPumpable.deflate(DataOutput) |
abstract boolean |
isAvailable()
Method that needs to be implemented by class extenders to indicate in case of a remote field copy when the field is not
expecting any more data from its original instance.
|
boolean |
isRemoteCopy()
Checks if the instance is a remote copy of the original
|
void |
makeAvailable()
Makes fully available the content of the
Field by invoking Field#makeAvailable(TransportOverride) with a
IBuffer.TransportOverride.Override value |
void |
makeAvailable(IBuffer.TransportOverride override)
Invokes the bound
Record's Record#requestPartial(TransportOverride, int) method with the provided
IBuffer.TransportOverride value |
void |
makeLocal()
Called by
Record.makeLocal(). |
void |
prebind(Record record)
|
void |
receive(DataInput in)
Receives the information send by a respective call to
send(DataOutput). |
void |
receiveFromXML(Element element) |
IBuffer.TransportDirective |
resolveTransportDirective()
Resolves the transport directive that needs to be used by this
Field. |
void |
send(DataOutput out)
Sets the state and information of this
Field in the provided stream. |
Element |
sendToXML(Document doc) |
void |
setDefinitionIndex(int index)
|
void |
setRemoteCopy(boolean remoteCopy)
|
Element |
toXML(Document doc) |
public void setDefinitionIndex(int index)
index - the indexpublic int getDefinitionIndex()
public void bind(Record record)
record - the recordpublic void prebind(Record record)
record - public void setRemoteCopy(boolean remoteCopy)
remoteCopy - whether or not it is a remote copypublic boolean isRemoteCopy()
public FieldDefinition getFieldDefinition() throws GRS2RecordDefinitionException
GRS2RecordDefinitionException - if the Field is not bound to a Record or no usable definition has been foundpublic IBuffer.TransportDirective resolveTransportDirective() throws GRS2RecordDefinitionException, GRS2BufferException
Field. If the defined IBuffer.TransportDirective is set
to IBuffer.TransportDirective.Inherit, the bound record's Record.resolveTransportDirective() is usedIBuffer.TransportDirectiveGRS2RecordDefinitionException - The bound Record's definition could not be retrievedGRS2BufferException - the IBuffer state does not allow for this operation to be completedpublic final void deflate(DataOutput out) throws GRS2RecordSerializationException
Field in the provided stream. After deflating the internally kept information,
extendDeflate(DataOutput) is invoked for class extenders to persist their informationdeflate in interface IPumpableout - the stream to writer information toGRS2RecordSerializationException - There was a problem in the serializationpublic final Element toXML(Document doc) throws GRS2RecordSerializationException
toXML in interface IPumpableGRS2RecordSerializationExceptionpublic final void fromXML(Element element) throws GRS2RecordSerializationException
fromXML in interface IPumpableGRS2RecordSerializationExceptionpublic final void fromXML(Element element, boolean reset) throws GRS2RecordSerializationException
GRS2RecordSerializationExceptionpublic final void send(DataOutput out) throws GRS2RecordSerializationException
Field in the provided stream. After sending the internally kept information,
Field#extendSend(DataOutput, TransportOverride) is invoked for class extenders to persist their informationout - the stream to send information toGRS2RecordSerializationException - There was a problem in the serializationpublic final Element sendToXML(Document doc) throws GRS2RecordSerializationException
GRS2RecordSerializationExceptionpublic final void receiveFromXML(Element element) throws GRS2RecordSerializationException
GRS2RecordSerializationExceptionpublic final void makeLocal()
Record.makeLocal(). External use is unnecessary and discouraged.
Resets any information which indicate previous executed transfers and makes the Field behave as if it were local.
If partial transfers are involved makeAvailable() should be invoked beforehand in case the full payload is needed.
This method has no effect if the Field is created locally or retrieved by the same IBuffer instance the producer used
public abstract void extendDeflate(DataOutput out) throws GRS2RecordSerializationException
out - the stream to deflate toGRS2RecordSerializationException - There was a problem in the serializationpublic abstract void extendToXML(Document doc, Element element) throws GRS2RecordSerializationException
GRS2RecordSerializationExceptionpublic abstract void extendFromXML(Element element, boolean reset) throws GRS2RecordSerializationException
GRS2RecordSerializationExceptionpublic abstract void extendSend(DataOutput out, IBuffer.TransportOverride override) throws GRS2RecordSerializationException
out - the stream to send information tooverride - the IBuffer.TransportOverride directiveGRS2RecordSerializationException - There was a problem in the serializationprotected abstract void extendMakeLocal()
public final void inflate(DataInput in) throws GRS2RecordSerializationException
IPumpable.deflate(DataOutput)
Similar as calling inflate(DataInput, boolean) with a reset parameter of falseinflate in interface IPumpablein - the stream to inflate fromGRS2RecordSerializationException - the inflate could not be completedinflate(DataInput),
IPumpable.inflate(DataInput)public final void inflate(DataInput in, boolean reset) throws GRS2RecordSerializationException
IPumpable.deflate(DataOutput)
Inflates a Field that was previously deflated using deflate(DataOutput). After the Field
deflate's its internal information, the extendInflate(DataInput, boolean) is invokedinflate in interface IPumpablein - the stream to inflate fromreset - whether or not the inflated information needs to be reset to clear any indication of previous executed transfersGRS2RecordSerializationException - There was a problem in the deserializationpublic final void receive(DataInput in) throws GRS2RecordSerializationException
send(DataOutput). After the internally kept information are read,
the stream is passed to Field#extendReceive(DataInput, TransportOverride)in - the stream to read fromGRS2RecordSerializationException - There was a problem in the deserializationpublic abstract void extendInflate(DataInput in, boolean reset) throws GRS2RecordSerializationException
Field extenders to inflate their internal informationin - the stream to inflate fromreset - whether or not the inflated information needs to be reset to clear any indication of previous executed transfersGRS2RecordSerializationException - There was a problem in the deserializationpublic abstract void extendReceive(DataInput in, IBuffer.TransportOverride override) throws GRS2RecordSerializationException
Field extenders to receive their priveously send informationin - the stream to receive fromoverride - the IBuffer.TransportOverride to useGRS2RecordSerializationException - There was a problem in the deserializationpublic void dispose()
extendDispose()public abstract void extendDispose()
public abstract boolean isAvailable()
public void makeAvailable()
throws GRS2RecordDefinitionException,
GRS2BufferException,
GRS2ProxyMirrorException
Field by invoking Field#makeAvailable(TransportOverride) with a
IBuffer.TransportOverride.Override valueGRS2RecordDefinitionException - the definition of the bound record could not be utilizedGRS2BufferException - the state of the IBuffer does not permit this operation to be completedGRS2ProxyMirrorException - The state of the mirroring protocol does not permit for this operation to be completedpublic void makeAvailable(IBuffer.TransportOverride override) throws GRS2RecordDefinitionException, GRS2BufferException, GRS2ProxyMirrorException
Record's Record#requestPartial(TransportOverride, int) method with the provided
IBuffer.TransportOverride valueoverride - the IBuffer.TransportOverride to useGRS2RecordDefinitionException - the definition of the bound record could not be utilizedGRS2BufferException - the state of the IBuffer does not permit this operation to be completedGRS2ProxyMirrorException - The state of the mirroring protocol does not permit for this operation to be completedpublic abstract InputStream getInputStream() throws IOException
InputStream over the locally available payload of the FieldIOException - The input stream could not be createdpublic MediatingInputStream getMediatingInputStream() throws IOException, GRS2RecordMediationException
MediatingInputStream over this FieldIOException - the stream could not be createdGRS2RecordMediationException - the mediated stream could not be createdpublic abstract void extendSendToXML(Document doc, Element element, IBuffer.TransportOverride override) throws GRS2RecordSerializationException
GRS2RecordSerializationExceptionpublic abstract void extendReceiveFromXML(Element element, IBuffer.TransportOverride override) throws GRS2RecordSerializationException
GRS2RecordSerializationExceptionCopyright © 2014. All Rights Reserved.