Class ParseTimeoutUpdater

    • Constructor Summary

      Constructors 
      Constructor Description
      ParseTimeoutUpdater​(org.xnio.channels.ConnectedChannel channel, long requestParseTimeout, long requestIdleTimeout)
      Creates new instance of ParseTimeoutSourceConduit.
      ParseTimeoutUpdater​(org.xnio.channels.ConnectedChannel channel, long requestParseTimeout, long requestIdleTimeout, java.lang.Runnable closeTask)
      Creates new instance of ParseTimeoutSourceConduit.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void closed​(ServerConnection connection)  
      void connectionIdle()
      Called when the connection goes idle
      void failedParse()
      Called when a request is received, however it is not parsed in a single read() call.
      void requestStarted()
      Cancels timeout countdown.
      void run()  
      • Methods inherited from class java.lang.Object

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

      • ParseTimeoutUpdater

        public ParseTimeoutUpdater​(org.xnio.channels.ConnectedChannel channel,
                                   long requestParseTimeout,
                                   long requestIdleTimeout)
        Creates new instance of ParseTimeoutSourceConduit.
        Parameters:
        channel - Channel which will be closed in case of timeout.
        requestParseTimeout - Timeout value. Negative value will indicate that this updated is disabled.
        requestIdleTimeout -
      • ParseTimeoutUpdater

        public ParseTimeoutUpdater​(org.xnio.channels.ConnectedChannel channel,
                                   long requestParseTimeout,
                                   long requestIdleTimeout,
                                   java.lang.Runnable closeTask)
        Creates new instance of ParseTimeoutSourceConduit.
        Parameters:
        channel - Channel which will be closed in case of timeout.
        requestParseTimeout - Timeout value. Negative value will indicate that this updated is disabled.
        requestIdleTimeout -
    • Method Detail

      • connectionIdle

        public void connectionIdle()
        Called when the connection goes idle
      • failedParse

        public void failedParse()
        Called when a request is received, however it is not parsed in a single read() call. This starts a timer, and if the request is not parsed within this time then the connection is closed.
      • requestStarted

        public void requestStarted()
        Cancels timeout countdown.

        Should be called after parsing is complete (to avoid closing connection during other activities).

      • run

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

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable