Flushable
, 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<LoopbackByteTransceiver>
, org.refcodes.component.ConnectionComponent.ConnectionAutomaton<LoopbackByteTransceiver>
, org.refcodes.component.ConnectionOpenable<LoopbackByteTransceiver>
, org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackByteTransceiver>
, org.refcodes.component.ConnectionStatusAccessor
, org.refcodes.component.Flushable
, org.refcodes.component.OpenedAccessor
, ByteBlockConsumer
, ByteBlockProvider
, ByteBlockReceiver
, ByteBlockSender
, ByteConsumer
, ByteDatagramConsumer
, ByteDatagramProvider
, ByteDatagramReceiver
, ByteDatagramSender
, ByteProvider
, ByteReceiver
, ByteSender
, ByteTransceiver
, ConnectionByteReceiver<LoopbackByteTransceiver>
, ConnectionByteSender<LoopbackByteTransceiver>
, ConnectionByteTransceiver<LoopbackByteTransceiver>
, LoopbackByteTransceiver
, Receivable
, Sendable
, org.refcodes.mixin.Releaseable
public class LoopbackByteTransceiverImpl extends AbstractByteReceiver implements LoopbackByteTransceiver
LoopbackByteTransceiver
interface.AbstractByteReceiver.ConnectableAutomaton
org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
org.refcodes.component.ClosedAccessor.ClosedMutator, org.refcodes.component.ClosedAccessor.ClosedProperty
org.refcodes.component.ConnectableComponent.ConnectableAutomaton
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>>
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>>
org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
_datagramQueue, DATAGRAM_QUEUE_SIZE
_automaton
Constructor | Description |
---|---|
LoopbackByteTransceiverImpl() |
Instantiates a new loopback byte transceiver impl.
|
LoopbackByteTransceiverImpl(int aCapacity) |
Instantiates a new loopback byte transceiver impl.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
void |
flush() |
|
boolean |
isOpenable(LoopbackByteTransceiver aLoopbackTransceiver) |
|
void |
open(LoopbackByteTransceiver aLoopbackTransceiver) |
|
void |
pushDatagram(byte aDatagram) |
Pushes a datagram into the receiver and puts it into the blocking queue
containing the so far received datagrams.
|
void |
writeDatagram(byte aDatagram) |
Writes (sends) a byte.
|
pushDatagrams, pushDatagrams
getConnectionStatus, hasDatagram, isClosable, isClosed, isOpenable, isOpened, open, readDatagram, readDatagrams, readDatagrams, releaseAll, setConnectionStatus
writeDatagrams
readDatagram
readDatagrams, readDatagrams
writeDatagrams
closeIn, closeQuietly, closeUnchecked
getConnectionStatus, isConnectionOpened
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasDatagram
public LoopbackByteTransceiverImpl()
public LoopbackByteTransceiverImpl(int aCapacity)
aCapacity
- the capacitypublic boolean isOpenable(LoopbackByteTransceiver aLoopbackTransceiver)
isOpenable
in interface org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackByteTransceiver>
public void open(LoopbackByteTransceiver aLoopbackTransceiver) throws org.refcodes.component.OpenException
open
in interface org.refcodes.component.ConnectionOpenable<LoopbackByteTransceiver>
org.refcodes.component.OpenException
public void writeDatagram(byte aDatagram) throws org.refcodes.component.OpenException
writeDatagram
in interface ByteConsumer
writeDatagram
in interface ByteDatagramConsumer
aDatagram
- The byte to be pushed.org.refcodes.component.OpenException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public void pushDatagram(byte aDatagram) throws org.refcodes.component.OpenException
AbstractByteProvider.readDatagram()
:
Use AbstractByteReceiver
extension's
AbstractByteReceiver.hasDatagram()
to test beforehand whether
there is a datagram available.pushDatagram
in interface LoopbackByteTransceiver
pushDatagram
in class AbstractByteProvider
aDatagram
- The datagram to be pushed at the end of the blocking
queue; to be retrieved with the AbstractByteProvider.readDatagram()
method.org.refcodes.component.OpenException
- the open exceptionpublic void flush() throws org.refcodes.component.OpenException
flush
in interface ByteSender
flush
in interface Flushable
flush
in interface org.refcodes.component.Flushable
org.refcodes.component.OpenException
public void close() throws org.refcodes.component.CloseException
close
in interface org.refcodes.component.Closable
close
in class AbstractByteReceiver
org.refcodes.component.CloseException
Copyright © 2018. All rights reserved.