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<LoopbackShortTransceiver>
, org.refcodes.component.ConnectionComponent.ConnectionAutomaton<LoopbackShortTransceiver>
, org.refcodes.component.ConnectionOpenable<LoopbackShortTransceiver>
, org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackShortTransceiver>
, org.refcodes.component.ConnectionStatusAccessor
, org.refcodes.component.Flushable
, org.refcodes.component.OpenedAccessor
, ConnectionShortReceiver<LoopbackShortTransceiver>
, ConnectionShortSender<LoopbackShortTransceiver>
, ConnectionShortTransceiver<LoopbackShortTransceiver>
, LoopbackShortTransceiver
, Receivable
, Sendable
, ShortBlockConsumer
, ShortBlockProvider
, ShortBlockReceiver
, ShortBlockSender
, ShortConsumer
, ShortDatagramConsumer
, ShortDatagramProvider
, ShortDatagramReceiver
, ShortDatagramSender
, ShortProvider
, ShortReceiver
, ShortSender
, ShortTransceiver
, org.refcodes.mixin.Releaseable
public class LoopbackShortTransceiverImpl extends AbstractShortReceiver implements LoopbackShortTransceiver
LoopbackShortTransceiver
interface.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
Constructor | Description |
---|---|
LoopbackShortTransceiverImpl() |
Instantiates a new loopback short transceiver impl.
|
LoopbackShortTransceiverImpl(int aCapacity) |
Instantiates a new loopback short transceiver impl.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
void |
flush() |
|
boolean |
isOpenable(LoopbackShortTransceiver aLoopbackTransceiver) |
|
void |
open(LoopbackShortTransceiver aLoopbackTransceiver) |
|
void |
pushDatagram(short aDatagram) |
Pushes a datagram into the receiver and puts it into the blocking queue
containing the so far received datagrams.
|
void |
writeDatagram(short aDatagram) |
Writes (sends) a short.
|
getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatus
hasDatagram, pushDatagrams, pushDatagrams, readDatagram, readDatagrams, readDatagrams, releaseAll
closeIn, closeQuietly, closeUnchecked
getConnectionStatus, isConnectionOpened
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasDatagram
writeDatagrams
readDatagram
readDatagrams, readDatagrams
writeDatagrams
public LoopbackShortTransceiverImpl()
public LoopbackShortTransceiverImpl(int aCapacity)
aCapacity
- the capacitypublic boolean isOpenable(LoopbackShortTransceiver aLoopbackTransceiver)
isOpenable
in interface org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackShortTransceiver>
public void open(LoopbackShortTransceiver aLoopbackTransceiver) throws org.refcodes.component.OpenException
open
in interface org.refcodes.component.ConnectionOpenable<LoopbackShortTransceiver>
org.refcodes.component.OpenException
public void writeDatagram(short aDatagram) throws org.refcodes.component.OpenException
writeDatagram
in interface ShortConsumer
writeDatagram
in interface ShortDatagramConsumer
aDatagram
- The short to be pushed.org.refcodes.component.OpenException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public void pushDatagram(short aDatagram) throws org.refcodes.component.OpenException
AbstractShortReceiver.readDatagram()
: use AbstractShortReceiver.hasDatagram()
to test
beforehand whether there is a datagram available.pushDatagram
in interface LoopbackShortTransceiver
pushDatagram
in class AbstractShortReceiver
aDatagram
- The datagram to be pushed at the end of the blocking
queue; to be retrieved with the AbstractShortReceiver.readDatagram()
method.org.refcodes.component.OpenException
- the open exceptionpublic void flush() throws org.refcodes.component.OpenException
flush
in interface Flushable
flush
in interface org.refcodes.component.Flushable
flush
in interface ShortSender
org.refcodes.component.OpenException
public void close() throws org.refcodes.component.CloseException
close
in interface org.refcodes.component.Closable
close
in class AbstractShortReceiver
org.refcodes.component.CloseException
Copyright © 2018. All rights reserved.