Package org.refcodes.io
Class PrefetchBidirectionalStreamConnectionByteTransceiverImpl
- java.lang.Object
-
- org.refcodes.io.AbstractByteProvider
-
- org.refcodes.io.AbstractByteReceiver
-
- org.refcodes.io.AbstractPrefetchInputStreamByteReceiver
-
- org.refcodes.io.PrefetchBidirectionalStreamConnectionByteTransceiverImpl
-
- All Implemented Interfaces:
java.io.Flushable,org.refcodes.component.BidirectionalConnectionComponent<java.io.InputStream,java.io.OutputStream>,org.refcodes.component.BidirectionalConnectionComponent.BidirectionalConnectionAutomaton<java.io.InputStream,java.io.OutputStream>,org.refcodes.component.BidirectionalConnectionOpenable<java.io.InputStream,java.io.OutputStream>,org.refcodes.component.BidirectionalConnectionOpenable.BidirectionalConnectionOpenAutomaton<java.io.InputStream,java.io.OutputStream>,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,BidirectionalConnectionByteTransceiver<java.io.InputStream,java.io.OutputStream>,BidirectionalStreamConnectionByteTransceiver,ByteBlockConsumer,ByteBlockProvider,ByteBlockReceiver,ByteBlockSender,ByteConsumer,ByteDatagramConsumer,ByteDatagramProvider,ByteDatagramReceiver,ByteDatagramSender,ByteProvider,ByteReceiver,ByteSender,ByteTransceiver,Receivable,Sendable,org.refcodes.mixin.Releaseable
public class PrefetchBidirectionalStreamConnectionByteTransceiverImpl extends AbstractPrefetchInputStreamByteReceiver implements BidirectionalStreamConnectionByteTransceiver
The Class PrefetchBidirectionalStreamConnectionByteTransceiverImpl.- Author:
- steiner
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.refcodes.io.AbstractByteReceiver
AbstractByteReceiver.ConnectableAutomaton
-
Nested classes/interfaces inherited from interface org.refcodes.component.BidirectionalConnectionComponent
org.refcodes.component.BidirectionalConnectionComponent.BidirectionalConnectionAutomaton<INPUT extends java.lang.Object,OUTPUT extends java.lang.Object>
-
Nested classes/interfaces inherited from interface org.refcodes.component.BidirectionalConnectionOpenable
org.refcodes.component.BidirectionalConnectionOpenable.BidirectionalConnectionOpenAutomaton<INPUT extends java.lang.Object,OUTPUT extends java.lang.Object>
-
Nested classes/interfaces inherited from interface org.refcodes.component.Closable
org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
-
Nested classes/interfaces inherited from interface org.refcodes.component.ClosedAccessor
org.refcodes.component.ClosedAccessor.ClosedMutator, org.refcodes.component.ClosedAccessor.ClosedProperty
-
Nested classes/interfaces inherited from interface org.refcodes.component.ConnectableComponent
org.refcodes.component.ConnectableComponent.ConnectableAutomaton
-
Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionStatusAccessor
org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
-
-
Field Summary
-
Fields inherited from class org.refcodes.io.AbstractByteProvider
_datagramQueue, DATAGRAM_QUEUE_SIZE
-
Fields inherited from class org.refcodes.io.AbstractByteReceiver
_automaton
-
-
Constructor Summary
Constructors Constructor Description PrefetchBidirectionalStreamConnectionByteTransceiverImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()booleanisOpenable(java.io.InputStream aInputStream, java.io.OutputStream aOutputStream)voidopen(java.io.InputStream aInputStream, java.io.OutputStream aOutputStream)protected voidopen(java.io.OutputStream aOutputStream)HINT: For testing purposes you can pass an already flushedObjectOutputStream(viaObjectOutputStream.flush()) encapsulating aPipedOutputStreamwhich in turn encapsulates aPipedInputStreamto thisopen(OutputStream)method.voidwriteDatagram(byte aDatagram)Writes (sends) a byte.-
Methods inherited from class org.refcodes.io.AbstractByteProvider
pushDatagram, pushDatagrams, pushDatagrams
-
Methods inherited from class org.refcodes.io.AbstractByteReceiver
getConnectionStatus, hasDatagram, isClosable, isClosed, isOpenable, isOpened, open, readDatagram, readDatagrams, readDatagrams, releaseAll, setConnectionStatus
-
Methods inherited from class org.refcodes.io.AbstractPrefetchInputStreamByteReceiver
isOpenable, open
-
Methods inherited from interface org.refcodes.io.ByteConsumer
writeDatagrams
-
Methods inherited from interface org.refcodes.io.ByteDatagramProvider
readDatagram
-
Methods inherited from interface org.refcodes.io.ByteReceiver
readDatagrams, readDatagrams
-
Methods inherited from interface org.refcodes.io.ByteSender
writeDatagrams
-
Methods inherited from interface org.refcodes.component.Closable
closeIn, closeQuietly, closeUnchecked
-
Methods inherited from interface org.refcodes.component.ConnectionStatusAccessor
getConnectionStatus, isConnectionOpened
-
Methods inherited from interface org.refcodes.mixin.Loggable
alert, alert, critical, critical, debug, error, info, notice, panic, trace, warn, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.refcodes.io.Receivable
hasDatagram
-
-
-
-
Method Detail
-
isOpenable
public boolean isOpenable(java.io.InputStream aInputStream, java.io.OutputStream aOutputStream)- Specified by:
isOpenablein interfaceorg.refcodes.component.BidirectionalConnectionOpenable.BidirectionalConnectionOpenAutomaton<java.io.InputStream,java.io.OutputStream>
-
open
public void open(java.io.InputStream aInputStream, java.io.OutputStream aOutputStream) throws org.refcodes.component.OpenException- Specified by:
openin interfaceorg.refcodes.component.BidirectionalConnectionOpenable<java.io.InputStream,java.io.OutputStream>- Throws:
org.refcodes.component.OpenException
-
writeDatagram
public void writeDatagram(byte aDatagram) throws org.refcodes.component.OpenExceptionWrites (sends) a byte.- Specified by:
writeDatagramin interfaceByteConsumer- Specified by:
writeDatagramin interfaceByteDatagramConsumer- Parameters:
aDatagram- The byte to be pushed.- Throws:
org.refcodes.component.OpenException- Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
-
flush
public void flush() throws org.refcodes.component.OpenException- Specified by:
flushin interfaceByteSender- Specified by:
flushin interfacejava.io.Flushable- Specified by:
flushin interfaceorg.refcodes.component.Flushable- Throws:
org.refcodes.component.OpenException
-
close
public void close() throws org.refcodes.component.CloseException- Specified by:
closein interfaceorg.refcodes.component.Closable- Overrides:
closein classAbstractPrefetchInputStreamByteReceiver- Throws:
org.refcodes.component.CloseException
-
open
protected void open(java.io.OutputStream aOutputStream) throws org.refcodes.component.OpenExceptionHINT: For testing purposes you can pass an already flushedObjectOutputStream(viaObjectOutputStream.flush()) encapsulating aPipedOutputStreamwhich in turn encapsulates aPipedInputStreamto thisopen(OutputStream)method. This enables you a non-blocking test of theOutputStreamConnectionSenderImplconnected with thePrefetchInputStreamConnectionReceiverImplcounterpart which is being opened with thePipedInputStream. ATTENTION: For maintainers, please keep the below code in sync with the code fromOutputStreamConnectionSenderImpl.open(java.io.OutputStream); except do not set the connection status here, make it protected and do not @Override anything.- Parameters:
aOutputStream- the output stream- Throws:
org.refcodes.component.OpenException- the open exception
-
-