DATA
- The type of the datagram to be operated with.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<LoopbackSender<DATA>>
, org.refcodes.component.ConnectionComponent.ConnectionAutomaton<LoopbackSender<DATA>>
, org.refcodes.component.ConnectionOpenable<LoopbackSender<DATA>>
, org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackSender<DATA>>
, org.refcodes.component.ConnectionStatusAccessor
, org.refcodes.component.OpenedAccessor
, BlockProvider<DATA>
, BlockReceiver<DATA>
, ConnectionReceiver<DATA,LoopbackSender<DATA>>
, DatagramProvider<DATA>
, DatagramReceiver<DATA>
, LoopbackReceiver<DATA>
, Provider<DATA>
, Receivable
, Receiver<DATA>
, org.refcodes.mixin.Loggable
, org.refcodes.mixin.Releaseable
public class LoopbackReceiverImpl<DATA extends Serializable> extends AbstractReceiver<DATA> implements LoopbackReceiver<DATA>
LoopbackReceiver
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>>
DATAGRAM_QUEUE_SIZE
Constructor | Description |
---|---|
LoopbackReceiverImpl() |
Instantiates a new loopback receiver impl.
|
LoopbackReceiverImpl(int aCapacity) |
Instantiates a new loopback receiver impl.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
boolean |
isOpenable(LoopbackSender<DATA> aLoopbackSender) |
|
void |
open(LoopbackSender<DATA> aLoopbackSender) |
|
void |
pushDatagram(DATA aDatagram) |
Pushes a datagram into the receiver and puts it into the blocking queue
containing the so far received datagrams.
|
void |
pushDatagrams(DATA[] aDatagrams) |
Pushes datagrams into the receiver and puts them into the blocking queue
containing the so far received datagrams.
|
void |
pushDatagrams(DATA[] aDatagrams,
int aOffset,
int aLength) |
Pushes datagrams into the receiver and puts them into the blocking queue
containing the so far received datagrams.
|
getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatus
hasDatagram, readDatagram, readDatagrams, releaseAll
closeIn, closeQuietly, closeUnchecked
getConnectionStatus, isConnectionOpened
readDatagram
alert, alert, critical, critical, debug, error, info, notice, panic, trace, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasDatagram
readDatagrams, readDatagrams
public LoopbackReceiverImpl()
public LoopbackReceiverImpl(int aCapacity)
aCapacity
- the capacitypublic boolean isOpenable(LoopbackSender<DATA> aLoopbackSender)
isOpenable
in interface org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<DATA extends Serializable>
public void open(LoopbackSender<DATA> aLoopbackSender) throws org.refcodes.component.OpenException
open
in interface org.refcodes.component.ConnectionOpenable<DATA extends Serializable>
org.refcodes.component.OpenException
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 LoopbackReceiver<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 pushDatagrams(DATA[] aDatagrams) throws org.refcodes.component.OpenException
AbstractReceiver.readDatagram()
: use AbstractReceiver.hasDatagram()
to test
beforehand whether there is a datagram available.pushDatagrams
in interface LoopbackReceiver<DATA extends Serializable>
pushDatagrams
in class AbstractReceiver<DATA extends Serializable>
aDatagrams
- The datagrams 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 pushDatagrams(DATA[] aDatagrams, int aOffset, int aLength) throws org.refcodes.component.OpenException
AbstractReceiver.readDatagram()
: use AbstractReceiver.hasDatagram()
to test
beforehand whether there is a datagram available.pushDatagrams
in interface LoopbackReceiver<DATA extends Serializable>
pushDatagrams
in class AbstractReceiver<DATA extends Serializable>
aDatagrams
- The datagrams to be pushed at the end of the blocking
queue; to be retrieved with the AbstractReceiver.readDatagram()
method.aOffset
- The offset to start taking data from to be pushed.aLength
- The number of elements to be pushed from the offset
onwards.org.refcodes.component.OpenException
- the open exceptionpublic void close() throws org.refcodes.component.CloseException
close
in interface org.refcodes.component.Closable
close
in class AbstractReceiver<DATA extends Serializable>
org.refcodes.component.CloseException
Copyright © 2018. All rights reserved.