Class LoadBalancer.ResponseHandler

All Implemented Interfaces:
Guardable, Runnable
Enclosing class:
LoadBalancer

public class LoadBalancer.ResponseHandler extends LoadBalancer.SocketHandler
A ResponseHandler is a daemon thread that processes an outgoing response from a destination server.
  • Field Details

    • m_daemonRequest

      protected LoadBalancer.RequestHandler m_daemonRequest
      The RequestHandler that this ResponseHandler belongs to.
    • m_socketServer

      protected Socket m_socketServer
      The Socket to read the response from.
    • m_socketClient

      protected Socket m_socketClient
      The Socket to write the response to.
  • Constructor Details

    • ResponseHandler

      public ResponseHandler(LoadBalancer.RequestHandler daemonRequest)
      Construct a ResponseHandler that belongs to the specified RequestHandler.
      Parameters:
      daemonRequest - the RequestHandler that this ResponseHandler belongs to
  • Method Details

    • run

      public void run()
      Processing loop for the ResponseHandler daemon.
      Specified by:
      run in interface Runnable
      Specified by:
      run in class LoadBalancer.SocketHandler
    • relayResponse

      public void relayResponse(Socket socketServer, Socket socketClient)
      This method is used to assign a task to the ResponseHandler thread from the RequestHandler thread.
      Parameters:
      socketServer - the socket to copy from
      socketClient - the socket to copy to