Module org.refcodes.serial
Package org.refcodes.serial
Class AbstractPortDecorator<PM extends PortMetrics>
java.lang.Object
org.refcodes.serial.AbstractPortDecorator<PM>
- Type Parameters:
PM
- The actualPortMetrics
type to use.
- All Implemented Interfaces:
Flushable
,Comparable<Port<?>>
,org.refcodes.component.Closable
,org.refcodes.component.Closable.CloseAutomaton
,org.refcodes.component.ClosedAccessor
,org.refcodes.component.ConnectableComponent
,org.refcodes.component.ConnectableComponent.ConnectableAutomaton
,org.refcodes.component.ConnectionComponent<PM>
,org.refcodes.component.ConnectionComponent.ConnectionAutomaton<PM>
,org.refcodes.component.ConnectionOpenable<PM>
,org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<PM>
,org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<PM,
,Port<PM>> org.refcodes.component.ConnectionStatusAccessor
,org.refcodes.component.Flushable
,org.refcodes.component.LinkComponent
,org.refcodes.component.LinkComponent.LinkAutomaton
,org.refcodes.component.Openable
,org.refcodes.component.Openable.OpenAutomaton
,org.refcodes.component.Openable.OpenBuilder<Port<PM>>
,org.refcodes.component.OpenedAccessor
,org.refcodes.io.Availability
,org.refcodes.io.ByteDestination
,org.refcodes.io.ByteReceiver
,org.refcodes.io.BytesDestination
,org.refcodes.io.ByteSource
,org.refcodes.io.BytesReceiver
,org.refcodes.io.BytesSource
,org.refcodes.io.BytesTransceiver
,org.refcodes.io.BytesTransmitter
,org.refcodes.io.ByteTransceiver
,org.refcodes.io.ByteTransmitter
,org.refcodes.io.Receivable
,org.refcodes.io.Skippable
,org.refcodes.io.TimeoutInputStreamAccessor
,org.refcodes.io.Transmittable
,org.refcodes.mixin.AliasAccessor
,org.refcodes.mixin.InputStreamAccessor
,org.refcodes.mixin.OutputStreamAccessor
,Port<PM>
,PortMetricsAccessor<PM>
,SegmentDestination
,SegmentReceiver
,SegmentSource
,SegmentTransceiver
,SegmentTransmitter
,SerialReceiver
,SerialTransceiver
,SerialTransmitter
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.AliasAccessor
org.refcodes.mixin.AliasAccessor.AliasBuilder<B extends org.refcodes.mixin.AliasAccessor.AliasBuilder<B>>, org.refcodes.mixin.AliasAccessor.AliasMutator, org.refcodes.mixin.AliasAccessor.AliasProperty
Nested classes/interfaces inherited from interface org.refcodes.io.BytesReceiver
org.refcodes.io.BytesReceiver.ReceiverInputStream
Nested classes/interfaces inherited from interface org.refcodes.io.BytesTransmitter
org.refcodes.io.BytesTransmitter.TransmitterOutputStream
Nested classes/interfaces inherited from interface org.refcodes.component.Closable
org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
Nested classes/interfaces inherited from interface org.refcodes.component.ClosedAccessor
org.refcodes.component.ClosedAccessor.ClosedMutator, org.refcodes.component.ClosedAccessor.ClosedProperty
Nested classes/interfaces inherited from interface org.refcodes.component.ConnectableComponent
org.refcodes.component.ConnectableComponent.ConnectableAutomaton
Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionComponent
org.refcodes.component.ConnectionComponent.ConnectionAutomaton<CON extends Object>, org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON extends Object,
B extends org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON, B>> Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionOpenable
org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<CON extends Object>, org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON extends Object,
B extends org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON, B>> Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionStatusAccessor
org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
Nested classes/interfaces inherited from interface org.refcodes.component.Flushable
org.refcodes.component.Flushable.FlushBuilder<B extends org.refcodes.component.Flushable.FlushBuilder<B>>
Nested classes/interfaces inherited from interface org.refcodes.mixin.InputStreamAccessor
org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<B extends org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<?>>, org.refcodes.mixin.InputStreamAccessor.InputStreamMutator, org.refcodes.mixin.InputStreamAccessor.InputStreamProperty
Nested classes/interfaces inherited from interface org.refcodes.component.LinkComponent
org.refcodes.component.LinkComponent.LinkAutomaton, org.refcodes.component.LinkComponent.LinkComponentBuilder<B extends org.refcodes.component.LinkComponent.LinkComponentBuilder<B>>
Nested classes/interfaces inherited from interface org.refcodes.component.Openable
org.refcodes.component.Openable.OpenAutomaton, org.refcodes.component.Openable.OpenBuilder<B extends org.refcodes.component.Openable.OpenBuilder<B>>
Nested classes/interfaces inherited from interface org.refcodes.component.OpenedAccessor
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.OutputStreamAccessor
org.refcodes.mixin.OutputStreamAccessor.OutputStreamBuilder<B extends org.refcodes.mixin.OutputStreamAccessor.OutputStreamBuilder<?>>, org.refcodes.mixin.OutputStreamAccessor.OutputStreamMutator, org.refcodes.mixin.OutputStreamAccessor.OutputStreamProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.PortMetricsAccessor
PortMetricsAccessor.PortMetricsBuilder<PM extends PortMetrics,
B extends PortMetricsAccessor.PortMetricsBuilder<PM, B>>, PortMetricsAccessor.PortMetricsMutator<PM extends PortMetrics>, PortMetricsAccessor.PortMetricsProperty<PM extends PortMetrics> Nested classes/interfaces inherited from interface org.refcodes.io.TimeoutInputStreamAccessor
org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<B extends org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<?>>, org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamMutator, org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamProperty
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractPortDecorator
(Port<PM> aPort) Decorates the givenPort
with the according functionality. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of bytes which can be read directly e.g. which are already been stored in an internal buffer.void
close()
Attention: Implementations of this method should do aObject.notifyAll()
in order to terminate any pending asynchronous operations such asSegmentReceiver.onReceiveSegment(Segment)
orSegmentReceiver.onReceiveSegment(Segment, SegmentConsumer)
.void
closeIn
(int aCloseInMillis) void
void
<SEGMENT extends Segment>
SegmentResult<SEGMENT>doTransmitSegment
(SEGMENT aSegment) <SEGMENT extends Segment>
voiddoTransmitSegment
(SEGMENT aSegment, SegmentConsumer<SEGMENT> aSegmentConsumer) void
flush()
void
getAlias()
org.refcodes.component.ConnectionStatus
org.refcodes.io.TimeoutInputStream
getInputStream
(long aTimeoutInMs) Retrieves thePortMetrics
from thePortMetrics
property.boolean
boolean
boolean
isClosed()
boolean
boolean
boolean
isOpenable
(PM aPortMetrics) boolean
isOpened()
<SEGMENT extends Segment>
SegmentResult<SEGMENT>onReceiveSegment
(SEGMENT aSegment) Asynchronously receives aSegment
'sSequence
data (does not block this thread) and updates theSegment
by invokingSegment.fromTransmission(Sequence)
.<SEGMENT extends Segment>
voidonReceiveSegment
(SEGMENT aSegment, SegmentConsumer<SEGMENT> aSegmentConsumer) Asynchronously receives aSegment
'sSequence
data (does not block this thread) and updates theSegment
by invokingSegment.fromTransmission(Sequence)
, passing the result to the callbackSegmentConsumer.onSegment(Segment)
.void
open()
Attention: Implementations of this method should do aObject.notifyAll()
in order to terminate any pending asynchronous operations such asSegmentReceiver.onReceiveSegment(Segment)
orSegmentReceiver.onReceiveSegment(Segment, SegmentConsumer)
.void
void
void
openUnchecked
(PM aPortMetrics) byte[]
byte
void
receiveBytes
(byte[] aBuffer, int aOffset, int aLength) byte[]
receiveBytes
(int aMaxLength) void
receiveBytesWithin
(long aTimeoutInMs, byte[] aBuffer, int aOffset, int aLength) byte[]
receiveBytesWithin
(long aTimeoutInMs, int aLength) byte
receiveByteWithin
(long aTimeoutInMs) <SEGMENT extends Segment>
voidreceiveSegment
(SEGMENT aSegment) Receives aSegment
(and blocks this thread) till all it'sSequence
data has been received and updates theSegment
by invokingSegment.fromTransmission(Sequence)
.<SEGMENT extends Segment>
voidreceiveSegmentWithin
(long aTimeoutInMs, SEGMENT aSegment) Receives aSegment
(and blocks this thread) till all it'sSequence
data has been received and updates theSegment
by invokingSegment.fromTransmission(Sequence)
.receiveSequence
(int aLength) Receives aSequence
with the number of bytes specified.This method blocks till all bytes are read.receiveSequenceWithin
(long aTimeoutInMs, int aLength) Receives aSequence
with the number of bytes specified.long
skip
(long aLength) void
void
skipAvailableExcept
(int aLength) void
skipAvailableTill
(long aSkipTimeSpanInMs) void
skipAvailableTillSilenceFor
(long aSilenceTimeSpanInMs) void
skipAvailableTillSilenceFor
(long aSilenceTimeSpanInMs, long aTimeoutInMs) void
skipAvailableWithin
(long aSkipTimeSpanInMs) void
skipAvailableWithin
(long aSkipTimeSpanInMs, long aTimeoutInMs) void
transmitBytes
(byte[] aBytes, int aOffset, int aLength) <SEGMENT extends Segment>
voidtransmitSegment
(SEGMENT aSegment) Transmits aSegment
(and blocks this thread) till all it'sSequence
data (as ofTransmission.toSequence()
) has been sent.void
transmitSequence
(Sequence aSequence) Transmits aSequence
(and blocks this thread) till all it's data has been sent.void
transmitSequence
(Sequence aSequence, int aOffset, int aLength) Transmits aSequence
.withOpen()
withOpenUnchecked
(PM aPortMetrics) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.io.BytesSource
transmitByte
Methods inherited from interface org.refcodes.serial.SerialTransmitter
transmitAllBytes
Methods inherited from interface org.refcodes.io.Skippable
skipAvailableWithin
-
Field Details
-
_port
-
-
Constructor Details
-
Method Details
-
receiveSegment
public <SEGMENT extends Segment> void receiveSegment(SEGMENT aSegment) throws TransmissionException, IOException Receives aSegment
(and blocks this thread) till all it'sSequence
data has been received and updates theSegment
by invokingSegment.fromTransmission(Sequence)
. This method blocks till all bytes are read.- Specified by:
receiveSegment
in interfaceSegmentDestination
- Specified by:
receiveSegment
in interfaceSerialReceiver
- Specified by:
receiveSegment
in interfaceSerialTransceiver
- Type Parameters:
SEGMENT
- TheSegment
type describing theSegment
subclass of implementingSegment
types.- Parameters:
aSegment
- TheSegment
to be (re-)initialized with the received data.- Throws:
TransmissionException
- Thrown in case the received data cannot be used to (re-)initialize the givenSegment
.IOException
- thrown in case of I/O issues (e.g. a timeout) while receiving.
-
transmitSegment
Transmits aSegment
(and blocks this thread) till all it'sSequence
data (as ofTransmission.toSequence()
) has been sent.- Specified by:
transmitSegment
in interfaceSegmentSource
- Specified by:
transmitSegment
in interfaceSerialTransceiver
- Specified by:
transmitSegment
in interfaceSerialTransmitter
- Type Parameters:
SEGMENT
- TheSegment
type describing theSegment
subclass used.- Parameters:
aSegment
- TheSegment
's data to be sent.- Throws:
IOException
- thrown in case of I/O issues (e.g. a timeout) while sending.
-
transmitBytes
- Specified by:
transmitBytes
in interfaceorg.refcodes.io.BytesSource
- Specified by:
transmitBytes
in interfaceorg.refcodes.io.BytesTransmitter
- Specified by:
transmitBytes
in interfaceSerialTransmitter
- Throws:
IOException
-
getOutputStream
- Specified by:
getOutputStream
in interfaceorg.refcodes.io.BytesTransmitter
- Specified by:
getOutputStream
in interfaceorg.refcodes.mixin.OutputStreamAccessor
-
receiveSegmentWithin
public <SEGMENT extends Segment> void receiveSegmentWithin(long aTimeoutInMs, SEGMENT aSegment) throws TransmissionException, IOException Receives aSegment
(and blocks this thread) till all it'sSequence
data has been received and updates theSegment
by invokingSegment.fromTransmission(Sequence)
. This method blocks till all bytes are read or the timeout has been reached.- Specified by:
receiveSegmentWithin
in interfaceSegmentReceiver
- Specified by:
receiveSegmentWithin
in interfaceSerialReceiver
- Type Parameters:
SEGMENT
- TheSegment
type describing theSegment
subclass of implementingSegment
types.- Parameters:
aTimeoutInMs
- The default timeout for read operations not explicitly called with a timeout argument. With a value of -1 timeout handling is disabled (blocking mode) or a technical timeout occurs (implementation depended).aSegment
- TheSegment
to be (re-)initialized with the received data.- Throws:
TransmissionException
- Thrown in case the received data cannot be used to (re-)initialize the givenSegment
.IOException
- thrown in case of I/O issues (e.g. a timeout) while receiving.
-
receiveSequenceWithin
Receives aSequence
with the number of bytes specified. This method blocks till all bytes are read or the timeout has been reached.- Specified by:
receiveSequenceWithin
in interfaceSerialReceiver
- Parameters:
aTimeoutInMs
- The default timeout for read operations not explicitly called with a timeout argument. With a value of -1 timeout handling is disabled (blocking mode) or a technical timeout occurs (implementation depended).aLength
- The number of bytes to receive.- Returns:
- A
Sequence
containing the accordingly received bytes. - Throws:
IOException
- thrown in case of I/O issues (e.g. a timeout) while receiving.
-
onReceiveSegment
public <SEGMENT extends Segment> void onReceiveSegment(SEGMENT aSegment, SegmentConsumer<SEGMENT> aSegmentConsumer) throws IOException Asynchronously receives aSegment
'sSequence
data (does not block this thread) and updates theSegment
by invokingSegment.fromTransmission(Sequence)
, passing the result to the callbackSegmentConsumer.onSegment(Segment)
.- Specified by:
onReceiveSegment
in interfaceSegmentReceiver
- Type Parameters:
SEGMENT
- TheSegment
type describing theSegment
subclass of implementingSegment
types.- Parameters:
aSegment
- TheSegment
to be (re-)initialized with the received data.aSegmentConsumer
- The callback asynchronously invoked upon having received theSegment
.- Throws:
IOException
- thrown in case of I/O issues (e.g. a closed connection) while receiving.
-
onReceiveSegment
public <SEGMENT extends Segment> SegmentResult<SEGMENT> onReceiveSegment(SEGMENT aSegment) throws IOException Asynchronously receives aSegment
'sSequence
data (does not block this thread) and updates theSegment
by invokingSegment.fromTransmission(Sequence)
. The result is provided by the returnedSegmentResult
instance providing the (asynchronously) (re-)initialized providedSegment
instance.- Specified by:
onReceiveSegment
in interfaceSegmentReceiver
- Type Parameters:
SEGMENT
- TheSegment
type describing theSegment
subclass used.- Parameters:
aSegment
- TheSegment
to be (re-)initialized with the received data.- Returns:
- The
SegmentResult
which provides the result (asynchronously). - Throws:
IOException
- thrown in case of I/O issues (e.g. a closed connection) while receiving.
-
receiveSequence
Receives aSequence
with the number of bytes specified.This method blocks till all bytes are read.- Specified by:
receiveSequence
in interfaceSerialReceiver
- Parameters:
aLength
- The number of bytes to receive.- Returns:
- A
Sequence
containing the accordingly received bytes. - Throws:
IOException
- thrown in case of I/O issues (e.g. a timeout) while receiving.
-
close
Attention: Implementations of this method should do aObject.notifyAll()
in order to terminate any pending asynchronous operations such asSegmentReceiver.onReceiveSegment(Segment)
orSegmentReceiver.onReceiveSegment(Segment, SegmentConsumer)
.- Specified by:
close
in interfaceorg.refcodes.component.Closable
- Specified by:
close
in interfaceSerialReceiver
- Throws:
IOException
-
closeUnchecked
public void closeUnchecked()- Specified by:
closeUnchecked
in interfaceorg.refcodes.component.Closable
-
closeQuietly
public void closeQuietly()- Specified by:
closeQuietly
in interfaceorg.refcodes.component.Closable
-
closeIn
public void closeIn(int aCloseInMillis) - Specified by:
closeIn
in interfaceorg.refcodes.component.Closable
-
getAlias
- Specified by:
getAlias
in interfaceorg.refcodes.mixin.AliasAccessor
-
open
Attention: Implementations of this method should do aObject.notifyAll()
in order to terminate any pending asynchronous operations such asSegmentReceiver.onReceiveSegment(Segment)
orSegmentReceiver.onReceiveSegment(Segment, SegmentConsumer)
.- Specified by:
open
in interfaceorg.refcodes.component.Openable
- Specified by:
open
in interfaceSerialReceiver
- Throws:
IOException
-
openUnchecked
public void openUnchecked()- Specified by:
openUnchecked
in interfaceorg.refcodes.component.Openable
-
skip
- Specified by:
skip
in interfaceorg.refcodes.io.BytesReceiver
- Specified by:
skip
in interfaceorg.refcodes.io.Skippable
- Throws:
IOException
-
getInputStream
- Specified by:
getInputStream
in interfaceorg.refcodes.io.BytesReceiver
- Specified by:
getInputStream
in interfaceorg.refcodes.mixin.InputStreamAccessor
-
getInputStream
public org.refcodes.io.TimeoutInputStream getInputStream(long aTimeoutInMs) - Specified by:
getInputStream
in interfaceorg.refcodes.io.BytesReceiver
- Specified by:
getInputStream
in interfaceorg.refcodes.io.TimeoutInputStreamAccessor
-
receiveAllBytes
- Specified by:
receiveAllBytes
in interfaceorg.refcodes.io.BytesDestination
- Specified by:
receiveAllBytes
in interfaceorg.refcodes.io.BytesReceiver
- Throws:
IOException
-
receiveBytes
- Specified by:
receiveBytes
in interfaceorg.refcodes.io.BytesDestination
- Specified by:
receiveBytes
in interfaceorg.refcodes.io.BytesReceiver
- Specified by:
receiveBytes
in interfaceSerialReceiver
- Throws:
IOException
-
receiveByteWithin
- Specified by:
receiveByteWithin
in interfaceorg.refcodes.io.BytesReceiver
- Throws:
IOException
-
receiveBytesWithin
- Specified by:
receiveBytesWithin
in interfaceorg.refcodes.io.BytesReceiver
- Throws:
IOException
-
receiveBytesWithin
public void receiveBytesWithin(long aTimeoutInMs, byte[] aBuffer, int aOffset, int aLength) throws IOException - Specified by:
receiveBytesWithin
in interfaceorg.refcodes.io.BytesReceiver
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceorg.refcodes.io.ByteTransmitter
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in interfaceorg.refcodes.component.Flushable
- Specified by:
flush
in interfaceSegmentTransmitter
- Specified by:
flush
in interfaceSerialTransmitter
- Throws:
IOException
-
isOpened
public boolean isOpened()- Specified by:
isOpened
in interfaceorg.refcodes.component.ConnectionStatusAccessor
- Specified by:
isOpened
in interfaceorg.refcodes.component.OpenedAccessor
-
available
Returns the number of bytes which can be read directly e.g. which are already been stored in an internal buffer. May return (0 or) a value less than 0 (-1) when it is not supported. Similar toInputStream.available()
: "Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream. The next invocation might be the same thread or another thread. A single read or skip of this many bytes will not block, but may read or skip fewer bytes. Note that while some implementations of InputStream will return the total number of bytes in the stream, many will not. It is never correct to use the return value of this method to allocate a buffer intended to hold all data in this stream. A subclass' implementation of this method may choose to throw an IOException if this input stream has been closed by invoking the close() method. The available method for class InputStream always returns 0. This method should be overridden by subclasses."- Specified by:
available
in interfaceorg.refcodes.io.Availability
- Specified by:
available
in interfaceSerialReceiver
- Specified by:
available
in interfaceorg.refcodes.io.Skippable
- Returns:
- The number of available bytes: An estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking or 0 when it reaches the end of the input stream. Throws:
- Throws:
IOException
- - if an I/O error occurs.
-
hasAvailable
- Specified by:
hasAvailable
in interfaceorg.refcodes.io.Availability
- Throws:
IOException
-
getConnectionStatus
public org.refcodes.component.ConnectionStatus getConnectionStatus()- Specified by:
getConnectionStatus
in interfaceorg.refcodes.component.ConnectionStatusAccessor
-
getPortMetrics
Retrieves thePortMetrics
from thePortMetrics
property.- Specified by:
getPortMetrics
in interfacePortMetricsAccessor<PM extends PortMetrics>
- Returns:
- The
PortMetrics
stored by thePortMetrics
property.
-
doTransmitSegment
public <SEGMENT extends Segment> void doTransmitSegment(SEGMENT aSegment, SegmentConsumer<SEGMENT> aSegmentConsumer) throws IOException - Specified by:
doTransmitSegment
in interfaceSegmentTransmitter
- Type Parameters:
SEGMENT
- TheSegment
type describing theSegment
subclass used.- Parameters:
aSegment
- TheSegment
to be sent.aSegmentConsumer
- The callback asynchronously invoked upon having sent theSegment
.- Throws:
IOException
- thrown in case of I/O issues (e.g. a closed connection upon the time of invocation).
-
doTransmitSegment
public <SEGMENT extends Segment> SegmentResult<SEGMENT> doTransmitSegment(SEGMENT aSegment) throws IOException - Specified by:
doTransmitSegment
in interfaceSegmentTransmitter
- Type Parameters:
SEGMENT
- TheSegment
type describing theSegment
subclass used.- Parameters:
aSegment
- TheSegment
to be sent.- Returns:
- The
SegmentResult
which provides the result of the operation (asynchronously), e.g. theSegment
being sent or anIOException
having occurred. - Throws:
IOException
- thrown in case of I/O issues (e.g. a closed connection upon the time of invocation).
-
transmitSequence
Transmits aSequence
.- Specified by:
transmitSequence
in interfaceSerialTransmitter
- Parameters:
aSequence
- TheSequence
containing the data to be send.aOffset
- The offset from where to take the chunk data.aLength
- The number of bytes to take, beginning at the provided offset.- Throws:
IOException
- thrown in case of I/O issues (e.g. a timeout) while sending
-
transmitSequence
Transmits aSequence
(and blocks this thread) till all it's data has been sent.- Specified by:
transmitSequence
in interfaceSerialTransmitter
- Parameters:
aSequence
- TheSequence
containing the data to be send.- Throws:
IOException
- thrown in case of I/O issues (e.g. a timeout) while sending
-
isClosable
public boolean isClosable()- Specified by:
isClosable
in interfaceorg.refcodes.component.Closable.CloseAutomaton
-
isClosed
public boolean isClosed()- Specified by:
isClosed
in interfaceorg.refcodes.component.ClosedAccessor
-
flushUnchecked
public void flushUnchecked()- Specified by:
flushUnchecked
in interfaceorg.refcodes.component.Flushable
-
isFlushable
public boolean isFlushable()- Specified by:
isFlushable
in interfaceorg.refcodes.component.Flushable
-
skipAvailable
- Specified by:
skipAvailable
in interfaceorg.refcodes.io.Skippable
- Throws:
IOException
-
skipAvailableWithin
- Specified by:
skipAvailableWithin
in interfaceorg.refcodes.io.Skippable
- Throws:
IOException
-
skipAvailableWithin
- Specified by:
skipAvailableWithin
in interfaceorg.refcodes.io.Skippable
- Throws:
IOException
-
skipAvailableTill
- Specified by:
skipAvailableTill
in interfaceorg.refcodes.io.Skippable
- Throws:
IOException
-
skipAvailableTillSilenceFor
- Specified by:
skipAvailableTillSilenceFor
in interfaceorg.refcodes.io.Skippable
- Throws:
IOException
-
skipAvailableTillSilenceFor
public void skipAvailableTillSilenceFor(long aSilenceTimeSpanInMs, long aTimeoutInMs) throws IOException, org.refcodes.exception.TimeoutIOException - Specified by:
skipAvailableTillSilenceFor
in interfaceorg.refcodes.io.Skippable
- Throws:
IOException
org.refcodes.exception.TimeoutIOException
-
skipAvailableExcept
- Specified by:
skipAvailableExcept
in interfaceorg.refcodes.io.Skippable
- Throws:
IOException
-
receiveByte
- Specified by:
receiveByte
in interfaceorg.refcodes.io.ByteDestination
- Specified by:
receiveByte
in interfaceorg.refcodes.io.BytesDestination
- Specified by:
receiveByte
in interfaceSerialReceiver
- Throws:
IOException
-
receiveBytes
- Specified by:
receiveBytes
in interfaceorg.refcodes.io.BytesDestination
- Throws:
IOException
-
isOpenable
public boolean isOpenable()- Specified by:
isOpenable
in interfaceorg.refcodes.component.Openable.OpenAutomaton
-
withOpen
- Specified by:
withOpen
in interfaceorg.refcodes.component.Openable.OpenBuilder<PM extends PortMetrics>
- Throws:
IOException
-
withOpenUnchecked
- Specified by:
withOpenUnchecked
in interfaceorg.refcodes.component.Openable.OpenBuilder<PM extends PortMetrics>
-
withOpen
- Specified by:
withOpen
in interfaceorg.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<PM extends PortMetrics,
Port<PM extends PortMetrics>> - Throws:
IOException
-
withOpenUnchecked
- Specified by:
withOpenUnchecked
in interfaceorg.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<PM extends PortMetrics,
Port<PM extends PortMetrics>>
-
open
- Specified by:
open
in interfaceorg.refcodes.component.ConnectionOpenable<PM extends PortMetrics>
- Throws:
IOException
-
openUnchecked
- Specified by:
openUnchecked
in interfaceorg.refcodes.component.ConnectionOpenable<PM extends PortMetrics>
-
isOpenable
- Specified by:
isOpenable
in interfaceorg.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<PM extends PortMetrics>
-