java.lang.Object
java.lang.Thread
net.i2p.util.I2PThread
net.i2p.util.I2PAppThread
net.i2p.router.update.UpdateRunner
net.i2p.router.update.DummyHandler.DummyRunner
- All Implemented Interfaces:
Runnable, UpdateTask, EepGet.StatusListener
- Enclosing class:
DummyHandler
Use for both check and update.
Nested Class Summary
Nested classes/interfaces inherited from class I2PThread
I2PThread.OOMEventListenerModifier and TypeClassDescriptionstatic interfaceListener for out-of-memory events.Nested classes/interfaces inherited from class Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandlerField Summary
FieldsModifier and TypeFieldDescriptionprivate final longHow long the dummy update should run, in ms.Fields inherited from class UpdateRunner
_baos, _context, _currentURI, _get, _isPartial, _isRunning, _log, _method, _mgr, _newVersion, _type, _updateFile, _urls, CONNECT_TIMEOUT, done, INACTIVITY_TIMEOUT, NOPROXY_INACTIVITY_TIMEOUTModifier and TypeFieldDescriptionprotected final ByteArrayOutputStream56 byte header, only used for suds.protected final RouterContextRouter context.protected URICurrent URI being fetched.protected EepGetThe current EepGet instance.protected booleanTells the listeners what mode we are in - set to true in extending classes for checks.protected booleanWhether the runner is currently running.protected final LogClass logger.protected final UpdateMethodUpdate method.protected final ConsoleUpdateManagerUpdate manager.protected StringSet by the listeners on completion.protected final UpdateTypeUpdate type.protected final StringTemporary file for the update download.List of update URIs.protected static final longConnect timeout in ms.protected booleanWhether the update completed.protected static final longInactivity timeout with proxy in ms.protected static final longInactivity timeout without proxy in ms.Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITYConstructor Summary
ConstructorsConstructorDescriptionDummyRunner(RouterContext ctx, ConsoleUpdateManager mgr, long maxTime) Creates a runner that sleeps for the requested time, then reports failure.Method Summary
Public MethodsModifier and TypeMethodDescriptionAlways DUMMY.protected voidupdate()Sleeps for the configured delay, then reports the run as failed.Methods inherited from class UpdateRunner
_t, _t, attemptFailed, attempting, bytesTransferred, getID, getType, getURI, headerReceived, isRunning, linkify, run, shutdown, toString, transferComplete, transferFailed, updateStatusModifier and TypeMethodDescriptionprotected StringTranslate a string.protected StringTranslate a string with a parameter.voidattemptFailed(String url, long bytesTransferred, long bytesRemaining, int currentAttempt, int numRetries, Exception cause) An attempt failed.voidattempting(String url) A retry is starting.voidbytesTransferred(long alreadyTransferred, int currentWrite, long bytesTransferred, long bytesRemaining, String url) Subclasses should override.getID()I d.getType()Returns what kind of update this runner handles.getURI()U r i.voidheaderReceived(String url, int attemptNum, String key, String val) HTTP response headers are not used to determine the update version.booleanWhether running.protected static StringWrap a URL in an anchor tag for display.voidrun()Runs the update, reporting any failure to the update manager.voidshutdown()Clears the running flag and interrupts any update in progress.toString()Handler summary for log messages.voidtransferComplete(long alreadyTransferred, long bytesTransferred, long bytesRemaining, String url, String outputFile, boolean notModified) Subclasses should override.voidtransferFailed(String url, long bytesTransferred, long bytesRemaining, int currentAttempt) Subclasses should override.protected voidReport progress to the user.Methods inherited from class I2PAppThread
addOOMEventThreadListener, fireOOM, removeOOMEventThreadListenerModifier and TypeMethodDescriptionvoidRegister a new component that wants notification of OOM events.protected voidfireOOM(OutOfMemoryError oom) Notify listeners that an OutOfMemoryError occurred.voidUnregister a component that wants notification of OOM events.Methods inherited from class I2PThread
addOOMEventListener, removeOOMEventListener, startModifier and TypeMethodDescriptionstatic voidRegister a new component that wants notification of OOM events.static voidUnregister a component that wants notification of OOM events.voidstart()Overridden to provide useful info to users on OOM, and to prevent shutting down the whole JVM for what is most likely not a heap issue.Methods inherited from class Thread
activeCount, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, startVirtualThread, threadId, yieldMethods inherited from interface UpdateTask
start
Field Details
_delay
private final long _delayHow long the dummy update should run, in ms.
Constructor Details
DummyRunner
Creates a runner that sleeps for the requested time, then reports failure.- Parameters:
ctx- the router contextmgr- the update manager to report tomaxTime- how long to sleep, in milliseconds
Method Details
getMethod
Always DUMMY.- Specified by:
getMethodin interfaceUpdateTask- Overrides:
getMethodin classUpdateRunner- Returns:
- METHOD_DUMMY, which never downloads anything
update
protected void update()Sleeps for the configured delay, then reports the run as failed.- Overrides:
updatein classUpdateRunner