public class Elg2KeyFactory extends I2PThread implements KeyFactory
I2PThread.OOMEventListenerThread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
Elg2KeyFactory(RouterContext ctx)Creates factory and starts background key precomputation thread. |
| Modifier and Type | Method and Description |
|---|---|
static Elg2KeyFactory | getInstance()Returns the last created instance. |
Elg2KeyPair | getKeys()Pulls a prebuilt keypair from the queue,
or if not available, construct a new one. |
int | getMaxSize()Returns the current maximum precalc queue size. |
int | getMinSize()Returns the current minimum precalc queue size. |
int | getSize()Returns the current number of precalc keys queued. |
void | refreshPoolSize()Called by the Tuner every 30 seconds. |
void | returnUnused(Elg2KeyPair kp)Return an unused DH key builder
to be put back onto the queue for reuse. |
void | run()Execute the task |
void | setMaxSize(int max)Sets the maximum precalc queue size. |
void | setMinSize(int min)Sets the minimum precalc queue size. |
void | shutdown()Note that this stops the singleton precalc thread. |
addOOMEventListener, fireOOM, removeOOMEventListener, startactiveCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yieldpublic Elg2KeyFactory(RouterContext ctx)
public static Elg2KeyFactory getInstance()
public Elg2KeyPair getKeys()
getKeys in interface KeyFactorypublic int getMaxSize()
public int getMinSize()
public int getSize()
public void refreshPoolSize()
public void returnUnused(Elg2KeyPair kp)
public void run()
public void setMaxSize(int max)
public void setMinSize(int min)
public void shutdown()