java.lang.Object
java.lang.Thread
org.apache.jmeter.protocol.http.proxy.Daemon
All Implemented Interfaces:
Runnable, Stoppable

public class Daemon extends Thread implements Stoppable
Web daemon thread. Creates main socket on port configured port (8888 by default) and listens on it forever. For each client request, creates a Proxy thread to handle the request.
  • Constructor Details

    • Daemon

      public Daemon(int port, ProxyControl target) throws IOException
      Create a new Daemon with the specified port and target.
      Parameters:
      port - the port to listen on.
      target - the target which will receive the generated JMeter test components.
      Throws:
      IOException - if an I/O error occurs opening the socket
      IllegalArgumentException - if port is outside the allowed range from 0 to 65535
      SocketException - when something is wrong on the underlying protocol layer
    • Daemon

      public Daemon(int port, ProxyControl target, Class<? extends Proxy> proxyClass) throws IOException
      Create a new Daemon with the specified port and target, using the specified class to handle individual requests.
      Parameters:
      port - the port to listen on.
      target - the target which will receive the generated JMeter test components.
      proxyClass - the proxy class to use to handle individual requests. This class must be the Proxy class or a subclass.
      Throws:
      IOException - if an I/O error occurs opening the socket
      IllegalArgumentException - if port is outside the allowed range from 0 to 65535
      SocketException - when something is wrong on the underlying protocol layer
  • Method Details

    • run

      public void run()
      Listen on the daemon port and handle incoming requests. This method will not exit until stopServer() is called or an error occurs.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • stopServer

      public void stopServer()
      Stop the proxy daemon. The daemon may not stop immediately. see #ACCEPT_TIMEOUT
      Specified by:
      stopServer in interface Stoppable