public HandlerImpl(I2PAppContext context, int type) { _context = context; _type = type; _log = context.logManager().getLog(getClass()); }
public UpdateRunner(I2PAppContext ctx, UpdateManager umgr, SnarkManager smgr, UpdateType type, List<URI> uris, String newVersion) { _context = ctx; _log = ctx.logManager().getLog(getClass()); _umgr = umgr; _smgr = smgr; _type = type; _urls = uris; _newVersion = newVersion; }
public OutboundGatewayProcessor(I2PAppContext ctx, TunnelCreatorConfig cfg) { _context = ctx; _log = ctx.logManager().getLog(OutboundGatewayProcessor.class); _config = cfg; }
/** Creates a new instance of ConnectionHandler */ public ConnectionHandler(I2PAppContext context, ConnectionManager mgr, SimpleTimer2 timer) { _context = context; _log = context.logManager().getLog(ConnectionHandler.class); _manager = mgr; _timer = timer; _synQueue = new LinkedBlockingQueue<Packet>(MAX_QUEUE_SIZE); _acceptTimeout = DEFAULT_ACCEPT_TIMEOUT; }
public SAMStreamSink(I2PAppContext ctx, String samHost, String samPort, String destFile, String sinkDir) { _context = ctx; _log = ctx.logManager().getLog(SAMStreamSink.class); _samHost = samHost; _samPort = samPort; _destFile = destFile; _sinkDir = sinkDir; _conOptions = ""; _remotePeers = new HashMap<String, Sink>(); }
public PacketQueue(I2PAppContext context, SimpleTimer2 timer) { _context = context; _log = context.logManager().getLog(PacketQueue.class); _messageStatusMap = new ConcurrentHashMap<Long, Connection>(16); new RemoveExpired(timer); // all createRateStats in ConnectionManager }
public BuildMessageProcessor(I2PAppContext ctx) { this.ctx = ctx; log = ctx.logManager().getLog(getClass()); _filter = selectFilter(); // all createRateStat in TunnelDispatcher }
/** * Warning - not recommended. * Use I2PAppContext.getGlobalContext().logManager().getLog(cls) */ public Log(Class<?> cls) { this(I2PAppContext.getGlobalContext().logManager(), cls, null); _manager.addLog(this); }
/** @since 0.9.7 */ private static Log getLog() { return I2PAppContext.getGlobalContext().logManager().getLog(I2PSocketManagerFactory.class); } }
DHTTracker(I2PAppContext ctx) { _context = ctx; _torrents = new Torrents(); _expireTime = MAX_EXPIRE_TIME; _log = _context.logManager().getLog(DHTTracker.class); }
public DHTNodes(I2PAppContext ctx, NID me) { _context = ctx; _expireTime = MAX_EXPIRE_TIME; _log = _context.logManager().getLog(DHTNodes.class); _nodeMap = new ConcurrentHashMap<NID, NodeInfo>(); _kad = new KBucketSet<NID>(ctx, me, KAD_K, KAD_B, new KBTrimmer(ctx, KAD_K)); }
/** not bound to a connection */ public PacketLocal(I2PAppContext ctx, Destination to, I2PSession session) { super(session); _context = ctx; _createdOn = ctx.clock().now(); _log = ctx.logManager().getLog(PacketLocal.class); _to = to; _connection = null; _lastSend = -1; _cancelledOn = -1; }
private static void error(String s) { I2PAppContext ctx = I2PAppContext.getGlobalContext(); Log log = ctx.logManager().getLog(ConnectionOptions.class); log.error(s); }
public AsyncFortunaStandalone(I2PAppContext context) { super(); _bufferCount = Math.max(context.getProperty("prng.buffers", DEFAULT_BUFFERS), 2); _bufferSize = Math.max(context.getProperty("prng.bufferSize", DEFAULT_BUFSIZE), 16*1024); _emptyBuffers = new LinkedBlockingQueue<AsyncBuffer>(_bufferCount); _fullBuffers = new LinkedBlockingQueue<AsyncBuffer>(_bufferCount); _context = context; context.statManager().createRequiredRateStat("prng.bufferWaitTime", "Delay for random number buffer (ms)", "Encryption", new long[] { 60*1000, 10*60*1000, 60*60*1000 } ); context.statManager().createRequiredRateStat("prng.bufferFillTime", "Time to fill random number buffer (ms)", "Encryption", new long[] { 60*1000, 10*60*1000, 60*60*1000 } ); _log = context.logManager().getLog(AsyncFortunaStandalone.class); }
public FragmentedMessage(I2PAppContext ctx, long messageId) { _context = ctx; _log = ctx.logManager().getLog(FragmentedMessage.class); _messageId = messageId; _fragments = new ByteArray[MAX_FRAGMENTS]; _highFragmentNum = -1; _releasedAfter = -1; _createdOn = ctx.clock().now(); }
public I2CPMessageProducer(I2PAppContext context) { _context = context; _log = context.logManager().getLog(I2CPMessageProducer.class); _lock = new ReentrantLock(true); context.statManager().createRateStat("client.sendThrottled", "Times waited for bandwidth", "ClientMessages", new long[] { 60*1000 }); context.statManager().createRateStat("client.sendDropped", "Length of msg dropped waiting for bandwidth", "ClientMessages", new long[] { 60*1000 }); }
@Override protected void afterExecute(Runnable r, Throwable t) { super.afterExecute(r, t); if (t != null) { // shoudn't happen, caught in RunnableEvent.run() Log log = I2PAppContext.getGlobalContext().logManager().getLog(SimpleTimer2.class); log.log(Log.CRIT, "event borked: " + r, t); } } }
public I2PSocketFull(Connection con, I2PAppContext context) { log = context.logManager().getLog(I2PSocketFull.class); _connection = con; if (con != null) { _remotePeer = con.getRemotePeer(); _localPeer = con.getSession().getMyDestination(); } else _remotePeer = _localPeer = null; }
/** * Caller must schedule */ public IdleChecker(SnarkManager mgr, PeerCoordinatorSet pcs) { super(mgr.util().getContext().simpleTimer2()); _util = mgr.util(); _log = _util.getContext().logManager().getLog(IdleChecker.class); _mgr = mgr; _pcs = pcs; }
public UDPPacketReader(I2PAppContext ctx) { _context = ctx; _log = ctx.logManager().getLog(UDPPacketReader.class); _sessionRequestReader = new SessionRequestReader(); _sessionCreatedReader = new SessionCreatedReader(); _sessionConfirmedReader = new SessionConfirmedReader(); _dataReader = new DataReader(); _peerTestReader = new PeerTestReader(); _relayRequestReader = new RelayRequestReader(); _relayIntroReader = new RelayIntroReader(); _relayResponseReader = new RelayResponseReader(); }