DATA
- The type of the datagram to be operated with.public class LoopbackTransceiverImpl<DATA extends Serializable> extends AbstractReceiver<DATA> implements LoopbackTransceiver<DATA>
org.refcodes.component.ConnectableComponent.ConnectableAutomaton
org.refcodes.component.mixins.OpenedAccessor.OpenedMutator, org.refcodes.component.mixins.OpenedAccessor.OpenedProperty
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
Constructor and Description |
---|
LoopbackTransceiverImpl() |
LoopbackTransceiverImpl(int aCapacity) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
isOpenable(LoopbackTransceiver<DATA> aLoopbackTransceiver) |
void |
open(LoopbackTransceiver<DATA> aLoopbackTransceiver) |
void |
pushDatagram(DATA aDatagram)
Pushes a datagram into the receiver and puts it into the blocking queue
containing the so far received datagrams.
|
void |
writeDatagram(DATA aDatagram)
Writes (sends) a datagram to a listening
Receiver . |
hasDatagram, readDatagram, releaseAll
getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasDatagram, readDatagram
public LoopbackTransceiverImpl()
public LoopbackTransceiverImpl(int aCapacity)
public boolean isOpenable(LoopbackTransceiver<DATA> aLoopbackTransceiver)
isOpenable
in interface org.refcodes.component.mixins.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackTransceiver<DATA extends Serializable>>
public void open(LoopbackTransceiver<DATA> aLoopbackTransceiver) throws org.refcodes.component.traps.OpenException
open
in interface org.refcodes.component.mixins.ConnectionOpenable<LoopbackTransceiver<DATA extends Serializable>>
org.refcodes.component.traps.OpenException
public void writeDatagram(DATA aDatagram) throws org.refcodes.component.traps.OpenException
Receiver
.writeDatagram
in interface Sender<DATA extends Serializable>
aDatagram
- The datagram to be pushed to the receiving
Sender
.org.refcodes.component.traps.OpenException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.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 LoopbackTransceiver<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.