java.lang.Object
net.i2p.util.SimpleTimer2.TimedEvent
net.i2p.router.startup.LoadClientAppsJob.DelayedRunClient
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
LoadClientAppsJob.WaitForRunningClient, PluginStarter.TrackedDelayedClient
- Enclosing class:
LoadClientAppsJob
Public for router console only, not for use by others, subject to change.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String[]Arguments passed to the app.private final ClassLoaderClass loader for the app's classes.private final StringClass name of the app to load.private final StringName of the client from the config.protected final RouterContextThe router context used to start the app when this event fires.private final LogLogger for the app loading.private final ThreadGroupThread group for the app's threads.Fields inherited from class SimpleTimer2.TimedEvent
_state, DEFAULT_FUZZModifier and TypeFieldDescriptionprotected SimpleTimer2.TimedEventStateState of the current event.protected static final intDefault fuzz threshold in milliseconds.Constructor Summary
ConstructorsConstructorDescriptionDelayedRunClient(SimpleTimer2 pool, RouterContext enclosingContext, String className, String clientName, String[] args) Caller must call schedule() before this event fires.DelayedRunClient(SimpleTimer2 pool, RouterContext enclosingContext, String className, String clientName, String[] args, ThreadGroup threadGroup, ClassLoader cl) Caller must call schedule() before this event fires.Method Summary
All MethodsMethods inherited from class SimpleTimer2.TimedEvent
cancel, forceReschedule, reschedule, reschedule, run, schedule, setFuzz, setPool, toStringModifier and TypeMethodDescriptionbooleancancel()Cancel the timed event.voidforceReschedule(long timeoutMs) Always use the new time - ignores fuzz.voidreschedule(long timeoutMs) Use the earliest of the new time and the old time May be called from within timeReached(), but schedule() is better there.voidreschedule(long timeoutMs, boolean useEarliestTime) May be called from within timeReached(), but schedule() is better there.voidrun()voidschedule(long timeoutMs) Schedule this event.voidsetFuzz(int fuzz) Reschedule threshold in ms.voidsetPool(SimpleTimer2 pool) Timer pool for this event.toString()Timer summary for log messages.
Field Details
_ctx
The router context used to start the app when this event fires._className
Class name of the app to load._clientName
Name of the client from the config._args
Arguments passed to the app._log
Logger for the app loading._threadGroup
Thread group for the app's threads._cl
Class loader for the app's classes.
Constructor Details
DelayedRunClient
public DelayedRunClient(SimpleTimer2 pool, RouterContext enclosingContext, String className, String clientName, String[] args) Caller must call schedule() before this event fires.- Parameters:
pool- the timer this event is scheduled onenclosingContext- the router context handed to the client applicationclassName- the client class to run, which must declare a static main(String[])clientName- the name given to the client thread, may be nullargs- the arguments passed to main(), may be null for none
DelayedRunClient
public DelayedRunClient(SimpleTimer2 pool, RouterContext enclosingContext, String className, String clientName, String[] args, ThreadGroup threadGroup, ClassLoader cl) Caller must call schedule() before this event fires.- Parameters:
pool- the timer this event is scheduled onenclosingContext- the router context handed to the client applicationclassName- the client class to run, which must declare a static main(String[])clientName- the name given to the client thread, may be nullargs- the arguments passed to main(), may be null for nonethreadGroup- the group the client thread joins, null for the default groupcl- the loader used to resolve the class, null for the system loader
Method Details
timeReached
public void timeReached()Run the configured client application.- Specified by:
timeReachedin classSimpleTimer2.TimedEvent