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<LoopbackShortsTransmitter>
, org.refcodes.component.ConnectionComponent.ConnectionAutomaton<LoopbackShortsTransmitter>
, org.refcodes.component.ConnectionOpenable<LoopbackShortsTransmitter>
, org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackShortsTransmitter>
, org.refcodes.component.ConnectionStatusAccessor
, org.refcodes.component.OpenedAccessor
, Availability
, ConnectionShortsReceiver<LoopbackShortsTransmitter>
, Receivable
, ShortDestination
, ShortReceiver
, ShortsDestination
, ShortsReceiver
public class LoopbackShortsReceiver extends AbstractShortsReceiver implements ConnectionShortsReceiver<LoopbackShortsTransmitter>
LoopbackShortsReceiver
is a DatagramReceiver
connected
directly within the same JVM with a LoopbackShortsTransmitter
; a
"loopback" connection is used for establishing the connection which cannot be
accessed outside the JVM or the running machine.AbstractShortsReceiver.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>>
_datagramQueue, DATAGRAM_QUEUE_SIZE
_automaton
Constructor | Description |
---|---|
LoopbackShortsReceiver() |
Instantiates a new loopback short receiver impl.
|
LoopbackShortsReceiver(int aCapacity) |
Instantiates a new loopback short receiver impl.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
boolean |
isOpenable(LoopbackShortsTransmitter aLoopbackSender) |
|
void |
open(LoopbackShortsTransmitter aLoopbackSender) |
|
void |
pushDatagram(short aDatagram) |
Pushes a datagram into the receiver and puts it into the blocking queue
containing the so far received datagrams.
|
void |
pushDatagrams(short[] aDatagrams) |
Pushes datagrams into the receiver and puts them into the blocking queue
containing the so far received datagrams.
|
void |
pushDatagrams(short[] 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, receiveAllShorts, receiveShort, receiveShorts, setConnectionStatus
available, hasAvailable
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
receiveShort, receiveShorts
receiveAllShorts, receiveShorts
public LoopbackShortsReceiver()
public LoopbackShortsReceiver(int aCapacity)
aCapacity
- the capacitypublic boolean isOpenable(LoopbackShortsTransmitter aLoopbackSender)
isOpenable
in interface org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackShortsTransmitter>
public void open(LoopbackShortsTransmitter aLoopbackSender) throws IOException
open
in interface org.refcodes.component.ConnectionOpenable<LoopbackShortsTransmitter>
IOException
public void pushDatagram(short aDatagram) throws IOException
AbstractShortsDestination.receiveShort()
: Use AbstractBytesReceiver
extension's AbstractBytesReceiver.available()
to test beforehand
whether there is a datagram available.pushDatagram
in class AbstractShortsDestination
aDatagram
- The datagram to be pushed at the end of the blocking
queue; to be retrieved with the AbstractShortsDestination.receiveShort()
method.IOException
- the open exceptionpublic void pushDatagrams(short[] aDatagrams) throws IOException
AbstractShortsDestination.receiveShort()
: Use AbstractBytesReceiver
extension's AbstractBytesReceiver.available()
to test beforehand
whether there is a datagram available.pushDatagrams
in class AbstractShortsDestination
aDatagrams
- The datagrams to be pushed at the end of the blocking
queue; to be retrieved with the AbstractShortsDestination.receiveShort()
method.IOException
- the open exceptionpublic void pushDatagrams(short[] aDatagrams, int aOffset, int aLength) throws IOException
AbstractShortsDestination.receiveShort()
: Use AbstractBytesReceiver
extension's AbstractBytesReceiver.available()
to test beforehand
whether there is a datagram available.pushDatagrams
in class AbstractShortsDestination
aDatagrams
- The datagrams to be pushed at the end of the blocking
queue; to be retrieved with the AbstractShortsDestination.receiveShort()
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 AbstractShortsReceiver
IOException
Copyright © 2021. All rights reserved.