DATA - The type of the datagram to be operated with.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<DATA>, org.refcodes.component.ConnectionComponent.ConnectionAutomaton<DATA>, org.refcodes.component.ConnectionOpenable<DATA>, org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<DATA>, org.refcodes.component.ConnectionStatusAccessor, org.refcodes.component.Flushable, org.refcodes.component.OpenedAccessor, BlockConsumer<DATA>, BlockProvider<DATA>, BlockReceiver<DATA>, BlockSender<DATA>, ConnectionReceiver<DATA,CON>, ConnectionSender<DATA,CON>, ConnectionTransceiver<DATA,LoopbackTransceiver<DATA>>, Consumer<DATA>, DatagramConsumer<DATA>, DatagramProvider<DATA>, DatagramReceiver<DATA>, DatagramSender<DATA>, DatagramTransceiver<DATA>, LoopbackTransceiver<DATA>, Provider<DATA>, Receivable, Receiver<DATA>, Sendable, Sender<DATA>, Transceiver<DATA>, org.refcodes.mixin.Releaseablepublic class LoopbackTransceiverImpl<DATA extends Serializable> extends AbstractReceiver<DATA> implements LoopbackTransceiver<DATA>
LoopbackTransceiver 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.ClosedPropertyorg.refcodes.component.ConnectableComponent.ConnectableAutomatonorg.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.ConnectionStatusPropertyDATAGRAM_QUEUE_SIZE| Constructor | Description |
|---|---|
LoopbackTransceiverImpl() |
Instantiates a new loopback transceiver impl.
|
LoopbackTransceiverImpl(int aCapacity) |
Instantiates a new loopback transceiver impl.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
void |
flush() |
|
boolean |
isOpenable(LoopbackTransceiver<DATA> aLoopbackTransceiver) |
|
void |
open(LoopbackTransceiver<DATA> aLoopbackTransceiver) |
|
void |
pushDatagram(DATA aDatagram) |
Pushes a datagram into the receiver and puts it into the blocking queue
containing the so far received datagrams.
|
void |
writeDatagram(DATA aDatagram) |
Writes (sends) a datagram to a listening
DatagramReceiver. |
getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatushasDatagram, pushDatagrams, pushDatagrams, readDatagram, readDatagrams, releaseAllcloseIn, closeQuietly, closeUncheckedgetConnectionStatus, isConnectionOpenedwriteDatagramsreadDatagramclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasDatagramreadDatagrams, readDatagramswriteDatagramspublic LoopbackTransceiverImpl()
public LoopbackTransceiverImpl(int aCapacity)
aCapacity - the capacitypublic boolean isOpenable(LoopbackTransceiver<DATA> aLoopbackTransceiver)
isOpenable in interface org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<DATA extends Serializable>public void open(LoopbackTransceiver<DATA> aLoopbackTransceiver) throws org.refcodes.component.OpenException
open in interface org.refcodes.component.ConnectionOpenable<DATA extends Serializable>org.refcodes.component.OpenExceptionpublic void writeDatagram(DATA aDatagram) throws org.refcodes.component.OpenException
DatagramReceiver.writeDatagram in interface Consumer<DATA extends Serializable>writeDatagram in interface DatagramConsumer<DATA extends Serializable>aDatagram - The datagram to be pushed to the receiving
DatagramConsumer.org.refcodes.component.OpenException - Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public void pushDatagram(DATA aDatagram) throws org.refcodes.component.OpenException
AbstractReceiver.readDatagram(): use AbstractReceiver.hasDatagram() to test
beforehand whether there is a datagram available.pushDatagram in interface LoopbackTransceiver<DATA extends Serializable>pushDatagram in class AbstractReceiver<DATA extends Serializable>aDatagram - The datagram to be pushed at the end of the blocking
queue; to be retrieved with the AbstractReceiver.readDatagram() method.org.refcodes.component.OpenException - the open exceptionpublic void flush()
throws org.refcodes.component.OpenException
public void close()
throws org.refcodes.component.CloseException
close in interface org.refcodes.component.Closableclose in class AbstractReceiver<DATA extends Serializable>org.refcodes.component.CloseExceptionCopyright © 2018. All rights reserved.