DATA
- The type of the datagram to be operated with.public class OutputStreamConnectionSenderImpl<DATA extends Serializable> extends AbstractSender<DATA> implements OutputStreamConnectionSender<DATA>
OutputStreamConnectionSender
interface.ConnectableComponent.ConnectableAutomaton
OpenedAccessor.OpenedMutator, OpenedAccessor.OpenedProperty
Closable.CloseAutomaton
ClosedAccessor.ClosedMutator, ClosedAccessor.ClosedProperty
ConnectionStatusAccessor.ConnectionStatusMutator, ConnectionStatusAccessor.ConnectionStatusProperty
ConnectionComponent.ConnectionAutomaton<CON>
ConnectionOpenable.ConnectionOpenAutomaton<CON>
Constructor and Description |
---|
OutputStreamConnectionSenderImpl() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
boolean |
isOpenable(OutputStream aOutputStream) |
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, setConnectionStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
writeDatagrams, writeDatagrams
isOpened
isClosable
isClosed
getConnectionStatus
public void open(OutputStream aOutputStream) throws 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
PrefetchBidirectionalStreamConnectionTransceiverImpl.open(java.io.OutputStream)
.open
in interface ConnectionOpenable<OutputStream>
OpenException
public boolean isOpenable(OutputStream aOutputStream)
isOpenable
in interface ConnectionOpenable.ConnectionOpenAutomaton<OutputStream>
public void flush() throws OpenException
flush
in interface Flushable
OpenException
public void close() throws CloseException
close
in interface Closable
close
in class AbstractConnectableAutomaton
CloseException
public void writeDatagram(DATA aDatagram) throws OpenException
DatagramReceiver
.
-------------------------------------------------------------------------
ATTENTION: For maintainers, please keep the below code in sync with the
code from
PrefetchBidirectionalStreamConnectionTransceiverImpl.writeDatagram(Serializable)
.writeDatagram
in interface DatagramSender<DATA extends Serializable>
aDatagram
- The datagram to be pushed to the receiving
DatagramSender
.OpenException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.Copyright © 2016. All rights reserved.