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<LoopbackBytesTransmitter>
, org.refcodes.component.ConnectionComponent.ConnectionAutomaton<LoopbackBytesTransmitter>
, org.refcodes.component.ConnectionOpenable<LoopbackBytesTransmitter>
, org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackBytesTransmitter>
, org.refcodes.component.ConnectionStatusAccessor
, org.refcodes.component.OpenedAccessor
, Availability
, ByteDestination
, ByteReceiver
, BytesDestination
, BytesReceiver
, ConnectionBytesReceiver<LoopbackBytesTransmitter>
, Receivable
, Skippable
, TimeoutInputStreamAccessor
, org.refcodes.mixin.InputStreamAccessor
public class LoopbackBytesReceiver extends AbstractBytesReceiver implements ConnectionBytesReceiver<LoopbackBytesTransmitter>
LoopbackBytesReceiver
is a DatagramReceiver
connected
directly within the same JVM with a LoopbackBytesTransmitter
; a
"loopback" connection is used for establishing the connection which cannot be
accessed outside the JVM or the running machine.AbstractBytesReceiver.ConnectableAutomaton
BytesReceiver.ReceiverInputStream
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
org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<B extends org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<?>>, org.refcodes.mixin.InputStreamAccessor.InputStreamMutator, org.refcodes.mixin.InputStreamAccessor.InputStreamProperty
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<B extends TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<?>>, TimeoutInputStreamAccessor.TimeoutInputStreamMutator, TimeoutInputStreamAccessor.TimeoutInputStreamProperty
_datagramQueue, DATAGRAM_QUEUE_SIZE
_automaton
Constructor | Description |
---|---|
LoopbackBytesReceiver() |
Instantiates a new loopback byte receiver impl.
|
LoopbackBytesReceiver(int aCapacity) |
Instantiates a new loopback byte receiver impl.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
boolean |
isOpenable(LoopbackBytesTransmitter aLoopbackSender) |
|
void |
open(LoopbackBytesTransmitter aLoopbackSender) |
|
void |
pushDatagram(byte aDatagram) |
Pushes a datagram into the receiver and puts it into the blocking queue
containing the so far received datagrams.
|
void |
pushDatagrams(byte[] aDatagrams) |
Pushes datagrams into the receiver and puts them into the blocking queue
containing the so far received datagrams.
|
void |
pushDatagrams(byte[] aDatagrams,
int aOffset,
int aLength) |
Pushes datagrams into the receiver and puts them into the blocking queue
containing the so far received datagrams.
|
available, getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, receiveAllBytes, receiveByte, receiveBytes, setConnectionStatus
available, hasAvailable
receiveByte, receiveBytes
getInputStream, getInputStream, receiveAllBytes, receiveBytes, receiveBytesWithin, receiveBytesWithin, receiveByteWithin, skip
closeIn, closeQuietly, closeUnchecked
getConnectionStatus, isOpened
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 LoopbackBytesReceiver()
public LoopbackBytesReceiver(int aCapacity)
aCapacity
- the capacitypublic boolean isOpenable(LoopbackBytesTransmitter aLoopbackSender)
isOpenable
in interface org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackBytesTransmitter>
public void open(LoopbackBytesTransmitter aLoopbackSender) throws IOException
open
in interface org.refcodes.component.ConnectionOpenable<LoopbackBytesTransmitter>
IOException
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 pushDatagrams(byte[] aDatagrams) throws IOException
AbstractBytesDestination.receiveByte()
: Use AbstractBytesReceiver
extension's
AbstractBytesReceiver.available()
to test beforehand whether
there is a datagram available.pushDatagrams
in class AbstractBytesDestination
aDatagrams
- The datagrams to be pushed at the end of the blocking
queue; to be retrieved with the AbstractBytesDestination.receiveByte()
method.IOException
- the open exceptionpublic void pushDatagrams(byte[] aDatagrams, int aOffset, int aLength) throws IOException
AbstractBytesDestination.receiveByte()
: Use AbstractBytesReceiver
extension's
AbstractBytesReceiver.available()
to test beforehand whether
there is a datagram available.pushDatagrams
in class AbstractBytesDestination
aDatagrams
- The datagrams to be pushed at the end of the blocking
queue; to be retrieved with the AbstractBytesDestination.receiveByte()
method.aOffset
- The offset to start taking data from to be pushed.aLength
- The number of elements to be pushed from the offset
onwards.IOException
- the open exceptionpublic void close() throws IOException
close
in interface org.refcodes.component.Closable
close
in class AbstractBytesReceiver
IOException
Copyright © 2021. All rights reserved.