Class ControllableConnectionFactory


  • public class ControllableConnectionFactory
    extends NIOServerCnxnFactory
    Extension of NIOServerCnxnFactory which can inject changes per controller commands. Similar extensions can implement on top of NettyServerCnxnFactory as well.
    • Constructor Detail

      • ControllableConnectionFactory

        public ControllableConnectionFactory()
    • Method Detail

      • delayRequestIfNeeded

        public void delayRequestIfNeeded()
        Called by the connection to delay processing requests from the client.
      • shouldFailNextRequest

        public boolean shouldFailNextRequest()
        Check if we should fail the next incoming request. If so, decrement the remaining requests to fail.
      • shouldSendResponse

        public boolean shouldSendResponse()
        Check if we should send a response to the latest processed request (true), or eat the response to mess with the client (false). If so, decrement the remaining requests to eat.
      • delayResponses

        public void delayResponses​(long delayInMs)
      • resetBadBehavior

        public void resetBadBehavior()
      • failAllFutureRequests

        public void failAllFutureRequests()
      • failFutureRequests

        public void failFutureRequests​(long requestsToFail)
      • holdAllFutureResponses

        public void holdAllFutureResponses()
      • holdFutureResponses

        public void holdFutureResponses​(long requestsToHold)