DATA
- the generic typepublic class PrefetchBidirectionalStreamConnectionTransceiverImpl<DATA extends Serializable> extends AbstractPrefetchInputStreamReceiver<DATA> implements BidirectionalStreamConnectionTransceiver<DATA>
org.refcodes.component.Flushable.FlushBuilder<B extends org.refcodes.component.Flushable.FlushBuilder<B>>
org.refcodes.component.ConnectableComponent.ConnectableAutomaton
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
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.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
DATAGRAM_QUEUE_SIZE
Constructor and Description |
---|
PrefetchBidirectionalStreamConnectionTransceiverImpl()
Instantiates a new prefetch bidirectional stream connection transceiver
impl.
|
PrefetchBidirectionalStreamConnectionTransceiverImpl(ExecutorService aExecutorService)
Instantiates a new prefetch bidirectional stream connection transceiver
impl.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush()
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)
Write datagram.
|
isOpenable, open
hasDatagram, pushDatagram, pushDatagrams, pushDatagrams, readDatagram, readDatagrams, releaseAll
getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
writeDatagrams
writeDatagrams
readDatagrams, readDatagrams
readDatagram
hasDatagram
public PrefetchBidirectionalStreamConnectionTransceiverImpl()
public PrefetchBidirectionalStreamConnectionTransceiverImpl(ExecutorService aExecutorService)
aExecutorService
- the a executor servicepublic boolean isOpenable(InputStream aInputStream, OutputStream aOutputStream)
isOpenable
in interface org.refcodes.component.BidirectionalConnectionOpenable.BidirectionalConnectionOpenAutomaton<InputStream,OutputStream>
public void open(InputStream aInputStream, OutputStream aOutputStream) throws org.refcodes.component.OpenException
open
in interface org.refcodes.component.BidirectionalConnectionOpenable<InputStream,OutputStream>
org.refcodes.component.OpenException
public void writeDatagram(DATA aDatagram) throws org.refcodes.component.OpenException
Consumer
writeDatagram
in interface Consumer<DATA extends Serializable>
writeDatagram
in interface DatagramConsumer<DATA extends Serializable>
aDatagram
- the a datagramorg.refcodes.component.OpenException
- the open exceptionpublic void flush() throws org.refcodes.component.OpenException
Sender
public void close() throws org.refcodes.component.CloseException
close
in interface org.refcodes.component.Closable
close
in class AbstractPrefetchInputStreamReceiver<DATA extends Serializable>
org.refcodes.component.CloseException
protected 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
PrefetchInputStreamConnectionReceiverImpl
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.
-------------------------------------------------------------------------org.refcodes.component.OpenException
Copyright © 2017. All rights reserved.