Module org.refcodes.serial
Package org.refcodes.serial
Class AbstractErrorCorrectionTransmissionDecorator<DECORATEE extends Transmission>
- java.lang.Object
-
- org.refcodes.serial.AbstractErrorCorrectionTransmissionDecorator<DECORATEE>
-
- Type Parameters:
DECORATEE
- The decoratee type describing the according subclass to be enriched.
- All Implemented Interfaces:
Serializable
,org.refcodes.mixin.DecorateeAccessor<DECORATEE>
,org.refcodes.mixin.LengthAccessor
,AcknowledgeRetryNumberAccessor
,AcknowledgeTimeoutInMsAccessor
,ErrorCorrectionTransmission
,Transmission
,Transmission.TransmissionMixin
- Direct Known Subclasses:
AbstractStopAndWaitTransmissionDecorator
public abstract class AbstractErrorCorrectionTransmissionDecorator<DECORATEE extends Transmission> extends Object implements ErrorCorrectionTransmission, Transmission.TransmissionMixin, org.refcodes.mixin.DecorateeAccessor<DECORATEE>
TheAbstractErrorCorrectionTransmissionDecorator
class implements a decorator providing base functionality for an error correctionTransmission
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.serial.AcknowledgeRetryNumberAccessor
AcknowledgeRetryNumberAccessor.AcknowledgeRetryNumberBuilder<B extends AcknowledgeRetryNumberAccessor.AcknowledgeRetryNumberBuilder<B>>, AcknowledgeRetryNumberAccessor.AcknowledgeRetryNumberMutator, AcknowledgeRetryNumberAccessor.AcknowledgeRetryNumberProperty
-
Nested classes/interfaces inherited from interface org.refcodes.serial.AcknowledgeTimeoutInMsAccessor
AcknowledgeTimeoutInMsAccessor.AcknowledgeTimeoutInMsBuilder<B extends AcknowledgeTimeoutInMsAccessor.AcknowledgeTimeoutInMsBuilder<B>>, AcknowledgeTimeoutInMsAccessor.AcknowledgeTimeoutInMsMutator, AcknowledgeTimeoutInMsAccessor.AcknowledgeTimeoutInMsProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.DecorateeAccessor
org.refcodes.mixin.DecorateeAccessor.DecorateeBuilder<DECORATEE extends Object,B extends org.refcodes.mixin.DecorateeAccessor.DecorateeBuilder<DECORATEE,B>>, org.refcodes.mixin.DecorateeAccessor.DecorateeMutator<DECORATEE extends Object>, org.refcodes.mixin.DecorateeAccessor.DecorateeProperty<DECORATEE extends Object>
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.LengthAccessor
org.refcodes.mixin.LengthAccessor.LengthBuilder<B extends org.refcodes.mixin.LengthAccessor.LengthBuilder<B>>, org.refcodes.mixin.LengthAccessor.LengthMutator, org.refcodes.mixin.LengthAccessor.LengthProperty
-
Nested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin
-
-
Field Summary
Fields Modifier and Type Field Description protected int
_acknowledgeRetryNumber
protected long
_acknowledgeTimeoutInMs
protected DECORATEE
_decoratee
static String
ACK_RETRY_NUMBER
static String
ACK_TIMEOUT_IN_MS
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractErrorCorrectionTransmissionDecorator()
Hook constructor to be used by sub-classes.AbstractErrorCorrectionTransmissionDecorator(DECORATEE aDecoratee)
Constructs aAbstractErrorCorrectionTransmissionDecorator
instance with the given decoratee.AbstractErrorCorrectionTransmissionDecorator(DECORATEE aSegment, int aAckRetryNumber, long aAckTimeoutInMs)
Constructs aAbstractErrorCorrectionTransmissionDecorator
instance with the given decoratee.AbstractErrorCorrectionTransmissionDecorator(DECORATEE aSegment, TransmissionMetrics aTransmissionMetrics)
Constructs aAbstractErrorCorrectionTransmissionDecorator
instance with the given decoratee.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
getAcknowledgeRetryNumber()
Retrieves the number of retries from the acknowledge retry number.long
getAcknowledgeTimeoutInMs()
The acknowledge timeout attribute in milliseconds.DECORATEE
getDecoratee()
int
getLength()
Determines the overall length of thisTransmission
.int
hashCode()
Schema
toSchema()
Retrieves theSchema
representing theTransmission
.Sequence
toSequence()
Provides theSequence
representation of thisTransmission
.org.refcodes.struct.SimpleTypeMap
toSimpleTypeMap()
Returns theSimpleTypeMap
representation of thisTransmission
.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.refcodes.serial.Transmission
transmitTo, transmitTo
-
Methods inherited from interface org.refcodes.serial.Transmission.TransmissionMixin
transmitTo
-
-
-
-
Field Detail
-
ACK_TIMEOUT_IN_MS
public static final String ACK_TIMEOUT_IN_MS
- See Also:
- Constant Field Values
-
ACK_RETRY_NUMBER
public static final String ACK_RETRY_NUMBER
- See Also:
- Constant Field Values
-
_acknowledgeRetryNumber
protected int _acknowledgeRetryNumber
-
_acknowledgeTimeoutInMs
protected long _acknowledgeTimeoutInMs
-
_decoratee
protected DECORATEE extends Transmission _decoratee
-
-
Constructor Detail
-
AbstractErrorCorrectionTransmissionDecorator
public AbstractErrorCorrectionTransmissionDecorator(DECORATEE aSegment, TransmissionMetrics aTransmissionMetrics)
Constructs aAbstractErrorCorrectionTransmissionDecorator
instance with the given decoratee. The configuration attributes are taken from theTransmissionMetrics
configuration object, though only those attributes are supported which are also supported by the other constructors!- Parameters:
aSegment
- The decoratee or referencee to be contained by this facade.aTransmissionMetrics
- TheTransmissionMetrics
to be used for configuring this instance.
-
AbstractErrorCorrectionTransmissionDecorator
protected AbstractErrorCorrectionTransmissionDecorator()
Hook constructor to be used by sub-classes.
-
AbstractErrorCorrectionTransmissionDecorator
public AbstractErrorCorrectionTransmissionDecorator(DECORATEE aDecoratee)
Constructs aAbstractErrorCorrectionTransmissionDecorator
instance with the given decoratee. Takes a retry count ofObject.notify()
by default and a timeout detecting a retry situation ofIoTimeout.MIN
.- Parameters:
aDecoratee
- The decoratee to be contained by this facade.
-
AbstractErrorCorrectionTransmissionDecorator
public AbstractErrorCorrectionTransmissionDecorator(DECORATEE aSegment, int aAckRetryNumber, long aAckTimeoutInMs)
Constructs aAbstractErrorCorrectionTransmissionDecorator
instance with the given decoratee.- Parameters:
aSegment
- The decoratee or referencee to be contained by this facade.aAckRetryNumber
- The number of retries waiting for an ACK from the return channel.aAckTimeoutInMs
- The timeout in milliseconds to pend till the next retry.
-
-
Method Detail
-
toSchema
public Schema toSchema()
Retrieves theSchema
representing theTransmission
. Retrieving aSchema
is useful when analyzing and debugging data structures such as aAllocSectionDecoratorSegment
instance to help document, learn and verify on the structure (as well as the content) of that veryAllocSectionDecoratorSegment
.- Specified by:
toSchema
in interfaceTransmission
- Returns:
- The
Schema
representation of the implementing type for debugging and verification (or documentation) purposes.
-
getAcknowledgeRetryNumber
public int getAcknowledgeRetryNumber()
Retrieves the number of retries from the acknowledge retry number. A acknowledge retry number is the overall number of retries to use when counting retries.- Specified by:
getAcknowledgeRetryNumber
in interfaceAcknowledgeRetryNumberAccessor
- Returns:
- The number of retries stored by the acknowledge retry number.
-
getAcknowledgeTimeoutInMs
public long getAcknowledgeTimeoutInMs()
The acknowledge timeout attribute in milliseconds.- Specified by:
getAcknowledgeTimeoutInMs
in interfaceAcknowledgeTimeoutInMsAccessor
- Returns:
- An integer with the timeout in milliseconds.
-
getLength
public int getLength()
Determines the overall length of thisTransmission
. In case of nestedTransmission
instances, all length values from all sub-segments are accumulated to the result as well.- Specified by:
getLength
in interfaceorg.refcodes.mixin.LengthAccessor
- Specified by:
getLength
in interfaceTransmission
- Returns:
- The (overall) length of the
Transmission
(including any sub-segments).
-
toSequence
public Sequence toSequence()
Provides theSequence
representation of thisTransmission
. In case of nestedTransmission
instances, allSequence
representations from all sub-segments are accumulated to the result as well. Caution, the Transmission (or its nestedTransmission
instances) may be backed by the returnedSequence
.- Specified by:
toSequence
in interfaceTransmission
- Returns:
- The according instance's
Sequence
.
-
getDecoratee
public DECORATEE getDecoratee()
- Specified by:
getDecoratee
in interfaceorg.refcodes.mixin.DecorateeAccessor<DECORATEE extends Transmission>
-
toSimpleTypeMap
public org.refcodes.struct.SimpleTypeMap toSimpleTypeMap()
Returns theSimpleTypeMap
representation of thisTransmission
. In case this Transmission hasTransmission
children, then the children are queried as well and contained in the resultingSimpleTypeMap
. The aliases of the accordingTransmission
instances represent the resulting path to aTransmission
's final simple type.- Specified by:
toSimpleTypeMap
in interfaceTransmission
- Returns:
- The
SimpleTypeMap
representing thisTransmission
and (if any) its children, with the according aliases forming the paths to theTransmission
's values.
-
-