DATA - the generic typeFlushable, org.refcodes.component.BidirectionalConnectionComponent<DATA,INPUT>, org.refcodes.component.BidirectionalConnectionComponent.BidirectionalConnectionAutomaton<INPUT,OUTPUT>, org.refcodes.component.BidirectionalConnectionOpenable<DATA,INPUT>, org.refcodes.component.BidirectionalConnectionOpenable.BidirectionalConnectionOpenAutomaton<DATA,INPUT>, 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.ConnectionStatusAccessor, org.refcodes.component.Flushable, org.refcodes.component.OpenedAccessor, BidirectionalConnectionTransceiver<DATA,InputStream,OutputStream>, BidirectionalStreamConnectionTransceiver<DATA>, BlockConsumer<DATA>, BlockProvider<DATA>, BlockReceiver<DATA>, BlockSender<DATA>, Consumer<DATA>, DatagramConsumer<DATA>, DatagramProvider<DATA>, DatagramReceiver<DATA>, DatagramSender<DATA>, DatagramTransceiver<DATA>, Provider<DATA>, Receivable, Receiver<DATA>, Sendable, Sender<DATA>, Transceiver<DATA>, org.refcodes.mixin.Releaseablepublic class BidirectionalStreamConnectionTransceiverImpl<DATA extends Serializable> extends AbstractInputStreamReceiver<DATA> implements BidirectionalStreamConnectionTransceiver<DATA>
org.refcodes.component.BidirectionalConnectionComponent.BidirectionalConnectionAutomaton<INPUT extends Object,OUTPUT extends Object>org.refcodes.component.BidirectionalConnectionOpenable.BidirectionalConnectionOpenAutomaton<INPUT extends Object,OUTPUT extends Object>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.ClosedPropertyorg.refcodes.component.ConnectableComponent.ConnectableAutomatonorg.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty| Constructor | Description |
|---|---|
BidirectionalStreamConnectionTransceiverImpl() |
Instantiates a new bidirectional stream connection transceiver impl.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
void |
flush() |
|
boolean |
isOpenable(InputStream aInputStream,
OutputStream aOutputStream) |
|
void |
open(InputStream aInputStream,
OutputStream aOutputStream) |
|
protected void |
open(OutputStream aOutputStream) |
HINT: For testing purposes you can pass an already flushed
ObjectOutputStream (via ObjectOutputStream.flush())
encapsulating a PipedOutputStream which in turn encapsulates a
PipedInputStream to this open(OutputStream) method. |
void |
writeDatagram(DATA aDatagram) |
Writes (sends) a datagram to a listening
DatagramReceiver. |
getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatushasDatagram, isOpenable, open, readDatagram, releaseAllcloseIn, closeQuietly, closeUncheckedgetConnectionStatus, isConnectionOpenedwriteDatagramsreadDatagramclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasDatagramreadDatagrams, readDatagramswriteDatagramspublic BidirectionalStreamConnectionTransceiverImpl()
public boolean isOpenable(InputStream aInputStream, OutputStream aOutputStream)
isOpenable in interface org.refcodes.component.BidirectionalConnectionOpenable.BidirectionalConnectionOpenAutomaton<DATA extends Serializable,INPUT>public void open(InputStream aInputStream, OutputStream aOutputStream) throws org.refcodes.component.OpenException
open in interface org.refcodes.component.BidirectionalConnectionOpenable<DATA extends Serializable,INPUT>org.refcodes.component.OpenExceptionpublic void writeDatagram(DATA aDatagram) throws org.refcodes.component.OpenException
DatagramReceiver.writeDatagram in interface Consumer<DATA extends Serializable>writeDatagram in interface DatagramConsumer<DATA extends Serializable>aDatagram - The datagram to be pushed to the receiving
DatagramConsumer.org.refcodes.component.OpenException - Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public void flush()
throws org.refcodes.component.OpenException
public void close()
throws org.refcodes.component.CloseException
close in interface org.refcodes.component.Closableclose in class AbstractInputStreamReceiver<DATA extends Serializable>org.refcodes.component.CloseExceptionprotected void open(OutputStream aOutputStream) throws org.refcodes.component.OpenException
ObjectOutputStream (via ObjectOutputStream.flush())
encapsulating a PipedOutputStream which in turn encapsulates a
PipedInputStream to this open(OutputStream) method. This
enables you a non-blocking test of the
OutputStreamConnectionSenderImpl connected with the
InputStreamConnectionReceiverImpl counterpart which is being
opened with the PipedInputStream.
ATTENTION: For maintainers, please keep the below code in sync with the
code from OutputStreamConnectionSenderImpl.open(java.io.OutputStream);
except do not set the connection status here, make it protected and do
not @Override anything.aOutputStream - the output streamorg.refcodes.component.OpenException - the open exceptionCopyright © 2018. All rights reserved.