java.lang.Object
com.vuze.plugins.mlab.MLabRunner

public class MLabRunnerextends Object
As modified from BiglyBT MLabPlugin
  • Field Details

    • NS_URL_SSL

      private static final String NS_URL_SSL
      Name server URL for the bandwidth test, over https only.
      See Also:
    • NS_URL_SSL_SSL

      private static final String NS_URL_SSL_SSL
      Name server URL for the ndt_ssl test, used when SSL is selected.
      See Also:
    • PROP_SSL

      private static final String PROP_SSL
      Config key for using SSL in the bandwidth test.
      See Also:
    • DEFAULT_USE_SSL

      private static final boolean DEFAULT_USE_SSL
      Whether SSL is the default, SSL hangs far too often for it.
      See Also:
    • NS_TIMEOUT

      private static final long NS_TIMEOUT
      Time allowed for the name server lookup.
      See Also:
    • _context

      private final I2PAppContext _context
      The app context.
    • _log

      private final Log _log
      Logger for the bandwidth test runner.
    • _running

      private final AtomicBoolean _running
      True while a test is running.
    • _instance

      private static MLabRunner _instance
      The test running now, null if none.
  • Constructor Details

    • MLabRunner

      private MLabRunner(I2PAppContext ctx)
      Creates a new MLabRunner instance.
      Parameters:
      ctx - the application context
  • Method Details

    • getInstance

      public static MLabRunner getInstance(I2PAppContext ctx)
      Gets the runner instance, creating it if none exists.
      Parameters:
      ctx - the application context
      Returns:
      the runner for this context
    • isRunning

      public boolean isRunning()
      Check if a test is currently running.
      Returns:
      true if a test is in progress
    • runNDT

      public MLabRunner.ToolRun runNDT(MLabRunner.ToolListener listener)
      Non-blocking, spawns a thread and returns immediately.
      Parameters:
      listener - use to detect completion and get results
      Returns:
      a ToolRun object which may be used to cancel the test, or null if there was already a test in progress.
    • runNDT

      public MLabRunner.ToolRun runNDT(MLabRunner.ToolListener listener, boolean use_SSL, String serverHost)
      Non-blocking, spawns a thread and returns immediately.
      Parameters:
      listener - use to detect completion and get results
      use_SSL - whether to use SSL to talk to the servers
      serverHost - if non-null, bypass the name server and run test with this host
      Returns:
      a ToolRun object which may be used to cancel the test, or null if there was already a test in progress.
    • runTool

      private void runTool(Runnable target)
      Non-blocking, spawns a thread and returns immediately.
      Parameters:
      target - the task to run on the spawned thread
    • main

      public static void main(String[] args)
      Standalone test
      Parameters:
      args - command line arguments