Class AgentClient

    • Field Detail

      • MESSAGE_POLL_FREQUENCY

        public static final java.lang.String MESSAGE_POLL_FREQUENCY
        Time to wait for new incoming messages before checking if the client is still active
        See Also:
        Constant Field Values
      • authSocket

        private final java.lang.String authSocket
      • pool

        private final long pool
      • handle

        private final long handle
      • receiveBuffer

        private final Buffer receiveBuffer
      • messages

        private final java.util.Queue<Buffer> messages
      • pumper

        private java.util.concurrent.Future<?> pumper
      • open

        private final java.util.concurrent.atomic.AtomicBoolean open
    • Constructor Detail

      • AgentClient

        public AgentClient​(FactoryManager manager,
                           java.lang.String authSocket)
                    throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getAuthSocket

        public java.lang.String getAuthSocket()
      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface java.nio.channels.Channel
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • messageReceived

        protected void messageReceived​(Buffer buffer)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.nio.channels.Channel
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class AbstractAgentProxy
        Throws:
        java.io.IOException
      • waitForMessageBuffer

        protected Buffer waitForMessageBuffer()
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • throwException

        protected void throwException​(int code)
                               throws java.io.IOException
        transform an APR error number in a more fancy exception
        Parameters:
        code - APR error code
        Throws:
        java.io.IOException - the produced exception for the given APR error number
      • toString

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