Class BidirectionalStreamConnectionTransceiverImpl<DATA extends java.io.Serializable>

    • Nested Class Summary

      • 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
      • Nested classes/interfaces inherited from interface org.refcodes.component.Flushable

        org.refcodes.component.Flushable.FlushBuilder<B extends org.refcodes.component.Flushable.FlushBuilder<B>>
      • Nested classes/interfaces inherited from interface org.refcodes.component.OpenedAccessor

        org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close​()
      void flush​()
      boolean isOpenable​(java.io.InputStream aInputStream, java.io.OutputStream aOutputStream)
      void open​(java.io.InputStream aInputStream, java.io.OutputStream aOutputStream)
      protected void open​(java.io.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.
      • Methods inherited from class org.refcodes.component.AbstractConnectableAutomaton

        getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatus
      • Methods inherited from interface org.refcodes.component.Closable

        closeIn, closeQuietly, closeUnchecked
      • Methods inherited from interface org.refcodes.component.Closable.CloseAutomaton

        isClosable
      • Methods inherited from interface org.refcodes.component.ClosedAccessor

        isClosed
      • Methods inherited from interface org.refcodes.component.ConnectionStatusAccessor

        getConnectionStatus, isConnectionOpened
      • Methods inherited from interface org.refcodes.component.Flushable

        flushUnchecked, isFlushable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.refcodes.component.OpenedAccessor

        isOpened
      • Methods inherited from interface org.refcodes.mixin.Releaseable

        releaseAll
    • Constructor Detail

      • BidirectionalStreamConnectionTransceiverImpl

        public BidirectionalStreamConnectionTransceiverImpl​()
        Instantiates a new bidirectional stream connection transceiver impl.
    • Method Detail

      • isOpenable

        public boolean isOpenable​(java.io.InputStream aInputStream,
                                  java.io.OutputStream aOutputStream)
        Specified by:
        isOpenable in interface org.refcodes.component.BidirectionalConnectionOpenable.BidirectionalConnectionOpenAutomaton<DATA extends java.io.Serializable,INPUT>
      • open

        public void open​(java.io.InputStream aInputStream,
                         java.io.OutputStream aOutputStream)
                  throws org.refcodes.component.OpenException
        Specified by:
        open in interface org.refcodes.component.BidirectionalConnectionOpenable<DATA extends java.io.Serializable,INPUT>
        Throws:
        org.refcodes.component.OpenException
      • writeDatagram

        public void writeDatagram​(DATA aDatagram)
                           throws org.refcodes.component.OpenException
        Writes (sends) a datagram to a listening DatagramReceiver.
        Specified by:
        writeDatagram in interface Consumer<DATA extends java.io.Serializable>
        Specified by:
        writeDatagram in interface DatagramConsumer<DATA extends java.io.Serializable>
        Parameters:
        aDatagram - The datagram to be pushed to the receiving DatagramConsumer.
        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:
        flush in interface java.io.Flushable
        Specified by:
        flush in interface org.refcodes.component.Flushable
        Specified by:
        flush in interface Sender<DATA extends java.io.Serializable>
        Throws:
        org.refcodes.component.OpenException
      • close

        public void close​()
                   throws org.refcodes.component.CloseException
        Specified by:
        close in interface org.refcodes.component.Closable
        Overrides:
        close in class AbstractInputStreamReceiver<DATA extends java.io.Serializable>
        Throws:
        org.refcodes.component.CloseException
      • open

        protected void open​(java.io.OutputStream aOutputStream)
                     throws org.refcodes.component.OpenException
        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. 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.
        Parameters:
        aOutputStream - the output stream
        Throws:
        org.refcodes.component.OpenException - the open exception