/** schedules itself */ public Cleaner() { super(SimpleTimer2.getInstance(), _checkPeriod); }
public Explorer(long delay) { super(SimpleTimer2.getInstance(), delay); }
/** * Either wait on this object with a timeout, or use non-null Runnables. * Any sent data to be remembered may be stored by setSentObject(). * Reply object may be in getReplyObject(). * @param onReply must be fast, otherwise set to null and wait on this UNUSED * @param onTimeout must be fast, otherwise set to null and wait on this UNUSED */ public ReplyWaiter(MsgID mID, NodeInfo nInfo, Runnable onReply, Runnable onTimeout) { super(SimpleTimer2.getInstance(), DEFAULT_QUERY_TIMEOUT); this.mid = mID; this.sentTo = nInfo; this.onReply = onReply; this.onTimeout = onTimeout; }
public Cleaner() { super(SimpleTimer2.getInstance(), 5 * CLEAN_TIME); }
public Cleaner() { super(SimpleTimer2.getInstance(), 2 * CLEAN_TIME); }
public Cleaner() { super(SimpleTimer2.getInstance(), 7 * CLEAN_TIME); }
public SocketTimeout(Socket socket, long delay) { super(SimpleTimer2.getInstance()); _inactivityDelay = delay; _targetSocket = socket; _cancelled = false; _lastActivity = _startTime = System.currentTimeMillis(); _totalTimeoutTime = -1; schedule(delay); }
/** * @param args the command line arguments, these are not used yet */ public static void main(String[] args) { // THINK THINK THINK THINK THINK THINK SimpleTimer2 Y2 = SimpleTimer2.getInstance(); BOB.main(args); Y2.stop(); } }
public IPThrottler(int max, long time) { _max = max; _counter = new ObjectCounter<Integer>(); SimpleTimer2.getInstance().addPeriodicEvent(new Cleaner(), time); }
LookupThrottler() { this.counter = new ObjectCounter<ReplyTunnel>(); SimpleTimer2.getInstance().addPeriodicEvent(new Cleaner(), CLEAN_TIME); }
FloodThrottler() { this.counter = new ObjectCounter<Hash>(); SimpleTimer2.getInstance().addPeriodicEvent(new Cleaner(), CLEAN_TIME); }
SimpleTimer2 Y2 = SimpleTimer2.getInstance(); i = Y2.hashCode();
public NegativeLookupCache(RouterContext context) { this.counter = new ObjectCounter<Hash>(); this.badDests = new LHMCache<Hash, Destination>(MAX_BAD_DESTS); this._maxFails = context.getProperty("netdb.negativeCache.maxFails",MAX_FAILS); final long cleanTime = context.getProperty("netdb.negativeCache.cleanupInterval", CLEAN_TIME); SimpleTimer2.getInstance().addPeriodicEvent(new Cleaner(), cleanTime); }
private ByteCache(int maxCachedEntries, int entrySize) { super(new ByteArrayFactory(entrySize), maxCachedEntries); _entrySize = entrySize; int stagger = SystemVersion.isAndroid() ? 0 : (entrySize % 777); SimpleTimer2.getInstance().addPeriodicEvent(new Cleanup(), CLEANUP_FREQUENCY + stagger); I2PAppContext.getGlobalContext().statManager().createRateStat("byteCache.memory." + entrySize, "Memory usage (B)", "Router", new long[] { 10*60*1000 }); }