java.lang.Object
com.vuze.plugins.mlab.MLabRunner
As modified from BiglyBT MLabPlugin
Nested Class Summary
Modifier and TypeClassDescriptionprivate static classStandalone teststatic interfaceThe parameter forrunNDT(MLabRunner.ToolListener)static interfaceReturned from runNDTprivate classReturned from runNDTstatic interfaceThe listener for ToolRunField Summary
FieldsModifier and TypeFieldDescriptionprivate final I2PAppContextThe app context.private static MLabRunnerThe test running now, null if none.private final LogLogger for the bandwidth test runner.private final AtomicBooleanTrue while a test is running.private static final booleanWhether SSL is the default, SSL hangs far too often for it.private static final longTime allowed for the name server lookup.private static final StringName server URL for the bandwidth test, over https only.private static final StringName server URL for the ndt_ssl test, used when SSL is selected.private static final StringConfig key for using SSL in the bandwidth test.Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMLabRunner(I2PAppContext ctx) Creates a new MLabRunner instance.Method Summary
Modifier and TypeMethodDescriptionstatic MLabRunnergetInstance(I2PAppContext ctx) Gets the runner instance, creating it if none exists.booleanCheck if a test is currently running.static voidStandalone testrunNDT(MLabRunner.ToolListener listener) Non-blocking, spawns a thread and returns immediately.runNDT(MLabRunner.ToolListener listener, boolean use_SSL, String serverHost) Non-blocking, spawns a thread and returns immediately.private voidNon-blocking, spawns a thread and returns immediately.
Field Details
NS_URL_SSL
Name server URL for the bandwidth test, over https only.- See Also:
NS_URL_SSL_SSL
Name server URL for the ndt_ssl test, used when SSL is selected.- See Also:
PROP_SSL
Config key for using SSL in the bandwidth test.- See Also:
DEFAULT_USE_SSL
private static final boolean DEFAULT_USE_SSLWhether SSL is the default, SSL hangs far too often for it.- See Also:
NS_TIMEOUT
private static final long NS_TIMEOUTTime allowed for the name server lookup.- See Also:
_context
The app context._log
Logger for the bandwidth test runner._running
True while a test is running._instance
The test running now, null if none.
Constructor Details
MLabRunner
Creates a new MLabRunner instance.- Parameters:
ctx- the application context
Method Details
getInstance
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
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 resultsuse_SSL- whether to use SSL to talk to the serversserverHost- 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
Non-blocking, spawns a thread and returns immediately.- Parameters:
target- the task to run on the spawned thread
main