Class BlockingConnection

    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void chunkCompleted​(byte[] b, int offset, int len)
      Called from a ProtocolInputHandler when a protocol-chunk has been completed.
      void close()  
      protected ProtocolInputHandler createInputHandler()  
      protected ProtocolOutputHandler createOutputHandler​(int outputBufferSize, int outputExtendSize)  
      java.lang.String getHostname()  
      java.lang.String getLocalHostname()  
      java.io.OutputStream getOutputStream()  
      int getPort()  
      int performWrite​(byte[] b, int offset, int len)
      Performs the write to the network.
      void run()  
      void setExceptionHandler​(ExceptionHandler exceptionHandler)  
      void setInboundHandler​(InboundHandler inboundHandler)  
      void setInputActiveIndicator​(java.util.concurrent.atomic.AtomicBoolean inputActiveIndicator)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • BlockingConnection

        public BlockingConnection​(java.net.Socket socket,
                                  InboundHandler inboundHandler,
                                  ExceptionHandler exceptionHandler)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • BlockingConnection

        public BlockingConnection​(java.net.Socket socket,
                                  int inputBufferSize,
                                  int inputExtendSize,
                                  int outputBufferSize,
                                  int outputExtendSize)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • createOutputHandler

        protected ProtocolOutputHandler createOutputHandler​(int outputBufferSize,
                                                            int outputExtendSize)
      • setInputActiveIndicator

        public void setInputActiveIndicator​(java.util.concurrent.atomic.AtomicBoolean inputActiveIndicator)
        Specified by:
        setInputActiveIndicator in interface Connection
      • chunkCompleted

        public void chunkCompleted​(byte[] b,
                                   int offset,
                                   int len)
        Description copied from interface: ChunkListener
        Called from a ProtocolInputHandler when a protocol-chunk has been completed.
        Specified by:
        chunkCompleted in interface ChunkListener
        Parameters:
        b - byte array.
        offset - offset
        len - length
      • performWrite

        public int performWrite​(byte[] b,
                                int offset,
                                int len)
                         throws java.io.IOException
        Description copied from interface: OutputListener
        Performs the write to the network.
        Specified by:
        performWrite in interface OutputListener
        Parameters:
        b - byte array.
        offset - offset.
        len - length.
        Returns:
        number of bytes written.
        Throws:
        java.io.IOException - on error.
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • getHostname

        public java.lang.String getHostname()
        Specified by:
        getHostname in interface Connection
      • close

        public void close()
        Specified by:
        close in interface Connection
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Thread