DATA
- The type of the datagram to be operated with.public class LoopbackReceiverImpl<DATA extends Serializable> extends AbstractReceiver<DATA> implements LoopbackReceiver<DATA>
LoopbackReceiver
interface.org.refcodes.component.ConnectableComponent.ConnectableAutomaton
org.refcodes.component.mixins.Closable.CloseAutomaton
org.refcodes.component.mixins.ClosedAccessor.ClosedMutator, org.refcodes.component.mixins.ClosedAccessor.ClosedProperty
org.refcodes.component.mixins.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.mixins.ConnectionStatusAccessor.ConnectionStatusProperty
org.refcodes.component.ConnectionComponent.ConnectionAutomaton<CON>
Constructor and Description |
---|
LoopbackReceiverImpl() |
LoopbackReceiverImpl(int aCapacity) |
Modifier and Type | Method and 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.
|
hasDatagram, readDatagram, releaseAll
getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasDatagram, readDatagram
public LoopbackReceiverImpl()
public LoopbackReceiverImpl(int aCapacity)
public boolean isOpenable(LoopbackSender<DATA> aLoopbackSender)
isOpenable
in interface org.refcodes.component.mixins.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackSender<DATA extends Serializable>>
public void open(LoopbackSender<DATA> aLoopbackSender) throws org.refcodes.component.traps.OpenException
open
in interface org.refcodes.component.mixins.ConnectionOpenable<LoopbackSender<DATA extends Serializable>>
org.refcodes.component.traps.OpenException
public void pushDatagram(DATA aDatagram) throws org.refcodes.component.traps.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.traps.OpenException
public void close()
close
in interface org.refcodes.component.mixins.Closable
close
in class AbstractReceiver<DATA extends Serializable>
Copyright © 2015. All rights reserved.