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<LoopbackBytesTransceiver>
, org.refcodes.component.ConnectionComponent.ConnectionAutomaton<LoopbackBytesTransceiver>
, org.refcodes.component.ConnectionOpenable<LoopbackBytesTransceiver>
, org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackBytesTransceiver>
, org.refcodes.component.ConnectionStatusAccessor
, org.refcodes.component.Flushable
, org.refcodes.component.OpenedAccessor
, Availability
, ByteDestination
, ByteReceiver
, BytesDestination
, ByteSource
, BytesReceiver
, BytesSource
, BytesTransceiver
, BytesTransmitter
, ByteTransceiver
, ByteTransmitter
, ConnectionBytesReceiver<LoopbackBytesTransceiver>
, ConnectionBytesTransceiver<LoopbackBytesTransceiver>
, ConnectionBytesTransmitter<LoopbackBytesTransceiver>
, Receivable
, Skippable
, TimeoutInputStreamAccessor
, Transmittable
, org.refcodes.mixin.InputStreamAccessor
, org.refcodes.mixin.OutputStreamAccessor
public class LoopbackBytesTransceiver extends AbstractBytesReceiver implements ConnectionBytesTransceiver<LoopbackBytesTransceiver>
LoopbackBytesTransceiver
is a DatagramTransceiver
connected
directly within the same JVM with another LoopbackBytesTransceiver
; a
"loopback" connection is used for establishing the connection which cannot be
accessed outside the JVM or the running machine.AbstractBytesReceiver.ConnectableAutomaton
BytesReceiver.ReceiverInputStream
BytesTransmitter.TransmitterOutputStream
org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
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.Flushable.FlushBuilder<B extends org.refcodes.component.Flushable.FlushBuilder<B>>
org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<B extends org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<?>>, org.refcodes.mixin.InputStreamAccessor.InputStreamMutator, org.refcodes.mixin.InputStreamAccessor.InputStreamProperty
org.refcodes.mixin.OutputStreamAccessor.OutputStreamBuilder<B extends org.refcodes.mixin.OutputStreamAccessor.OutputStreamBuilder<?>>, org.refcodes.mixin.OutputStreamAccessor.OutputStreamMutator, org.refcodes.mixin.OutputStreamAccessor.OutputStreamProperty
TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<B extends TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<?>>, TimeoutInputStreamAccessor.TimeoutInputStreamMutator, TimeoutInputStreamAccessor.TimeoutInputStreamProperty
_datagramQueue, DATAGRAM_QUEUE_SIZE
_automaton
Constructor | Description |
---|---|
LoopbackBytesTransceiver() |
Instantiates a new loopback byte transceiver impl.
|
LoopbackBytesTransceiver(int aCapacity) |
Instantiates a new loopback byte transceiver impl.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
void |
flush() |
|
boolean |
isOpenable(LoopbackBytesTransceiver aLoopbackTransceiver) |
|
void |
open(LoopbackBytesTransceiver 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 |
transmitByte(byte aByte) |
Writes (sends) a byte.
|
pushDatagrams, pushDatagrams
available, getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, receiveAllBytes, receiveByte, receiveBytes, setConnectionStatus
available, hasAvailable
receiveByte, receiveBytes
getInputStream, getInputStream, receiveAllBytes, receiveBytes, receiveBytesWithin, receiveBytesWithin, receiveByteWithin, skip
transmitAllBytes
getOutputStream, transmitBytes
closeIn, closeQuietly, closeUnchecked
alert, alert, critical, critical, debug, error, info, notice, panic, trace, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
available, skipAvailable, skipAvailableExcept, skipAvailableTill, skipAvailableTillSilenceFor, skipAvailableTillSilenceFor, skipAvailableWithin, skipAvailableWithin
public LoopbackBytesTransceiver()
public LoopbackBytesTransceiver(int aCapacity)
aCapacity
- the capacitypublic boolean isOpenable(LoopbackBytesTransceiver aLoopbackTransceiver)
isOpenable
in interface org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackBytesTransceiver>
public void open(LoopbackBytesTransceiver aLoopbackTransceiver) throws IOException
open
in interface org.refcodes.component.ConnectionOpenable<LoopbackBytesTransceiver>
IOException
public void transmitByte(byte aByte) throws IOException
transmitByte
in interface ByteSource
transmitByte
in interface BytesSource
aByte
- The byte to be pushed.IOException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public void pushDatagram(byte aDatagram) throws IOException
AbstractBytesDestination.receiveByte()
: Use AbstractBytesReceiver
extension's
AbstractBytesReceiver.available()
to test beforehand whether
there is a datagram available.pushDatagram
in class AbstractBytesDestination
aDatagram
- The datagram to be pushed at the end of the blocking
queue; to be retrieved with the AbstractBytesDestination.receiveByte()
method.IOException
- the open exceptionpublic void flush() throws IOException
flush
in interface ByteTransmitter
flush
in interface Flushable
flush
in interface org.refcodes.component.Flushable
IOException
public void close() throws IOException
close
in interface org.refcodes.component.Closable
close
in class AbstractBytesReceiver
IOException
Copyright © 2021. All rights reserved.