@Override public void run() { try { startUp(); } catch(Exception e) { log.error("Failed while running desktopgui!", e); changeState(START_FAILED, "Failed while running desktopgui!", e); } }
/** * @throws IllegalStateException if released */ public ByteArray[] getFragments() { if (_released) { RuntimeException e = new IllegalStateException("Use after free: " + _messageId); _log.error("SSU IMS", e); throw e; } return _fragments; }
@Override public void streamDataReceived(String id, byte data[], int offset, int length) { Sink sink; synchronized (_remotePeers) { sink = _remotePeers.get(id); } if (sink != null) { sink.received(data, offset, length); } else { _log.error("not connected to " + id + " but we received " + length + "?"); } }
public void run() { try { run2(); } finally { // prevent OOM on thread death if (_alive) { _alive = false; _log.error("ACK Sender died"); } } }
protected boolean execDatagramMessage(String opcode, Properties props) { if (datagramSession == null) { _log.error("DATAGRAM message received, but no DATAGRAM session exists"); return false; } return execDgOrRawMessage(false, opcode, props); }
protected boolean execRawMessage(String opcode, Properties props) { if (rawSession == null) { _log.error("RAW message received, but no RAW session exists"); return false; } return execDgOrRawMessage(true, opcode, props); }
public void notifyStreamSendBufferFree( int id ) throws IOException { if ( streamSession == null ) { _log.error ( "BUG! Stream outgoing buffer is free, but session is null!" ); return; } if ( !writeString ( "STREAM READY_TO_SEND ID=" + id + "\n" ) ) { throw new IOException ( "Error notifying connection to SAM client" ); } }
/** * @param id the router's ID for this message * @param messageNonce the client's ID for this message * @param status see I2CP MessageStatusMessage for success/failure codes */ public void messageDeliveryStatusUpdate(Destination fromDest, MessageId id, long messageNonce, int status) { if (_manager != null) _manager.messageDeliveryStatusUpdate(fromDest, id, messageNonce, status); else _log.error("Null manager on messageDeliveryStatusUpdate!"); }
/** * Return the client's current manager or null if not connected * */ public SessionKeyManager getClientSessionKeyManager(Hash dest) { if (_manager != null) return _manager.getClientSessionKeyManager(dest); else { _log.error("Null manager on getClientSessionKeyManager!"); return null; } }
public void setTunnelPool(TunnelPool pool) { if (pool != null) { _pool = pool; } else { Log log = _context.logManager().getLog(getClass()); log.error("Null tunnel pool?", new Exception("foo")); } } public TunnelPool getTunnelPool() { return _pool; }
private synchronized void verifyNotReleased() { if (!CACHE) return; if (_released) { Log log = _context.logManager().getLog(UDPPacket.class); log.error("Already released", new Exception()); //log.log(Log.CRIT, "Released by: ", _releasedBy); //log.log(Log.CRIT, "Acquired by: ", _acquiredBy); } } }
/** * Files are served from here */ protected synchronized void setResourceBase(File base) throws UnavailableException { if (!base.isDirectory()) { _log.error("Configured i2psnark directory " + base + " does not exist"); //throw new UnavailableException("Resource base does not exist: " + base); } _resourceBase = base; if (_log.shouldLog(Log.INFO)) _log.info("Resource base is " + _resourceBase); }
public void notifyStreamIncomingConnection(int id, Destination d) throws IOException { if (streamSession == null) { _log.error("BUG! Received stream connection, but session is null!"); return; } if (!writeString("STREAM CONNECTED DESTINATION=" + d.toBase64() + " ID=" + id + "\n")) { throw new IOException("Error notifying connection to SAM client"); } }
public void registerConnection(ClientConnectionRunner runner) { try { runner.startRunning(); synchronized (_pendingRunners) { _pendingRunners.add(runner); } } catch (IOException ioe) { _log.error("Error starting up the runner", ioe); runner.stopRunning(); } }
public void runJob() { if (_log.shouldLog(Log.INFO)) _log.info("Removing key " + _key /* , getAddedBy() */); try { removeFile(_key, _dbDir); } catch (IOException ioe) { _log.error("Error removing key " + _key, ioe); } } }
/** * Call this whenever we lose touch with the router involuntarily (aka the router * is off / crashed / etc) * */ void routerDisconnected() { _log.error(getPrefix() + "Router disconnected - firing notification events"); for (ConnectionEventListener lsnr : listeners) { if (lsnr != null) lsnr.routerDisconnected(); } }
/** * Create (if necessary) and load the key store, then run. */ @Override protected void runServer() { File keyStore = new File(_context.getConfigDir(), "keystore/i2cp.ks"); if (verifyKeyStore(keyStore) && initializeFactory(keyStore)) { super.runServer(); } else { _log.error("SSL I2CP server error - Failed to create or open key store"); } }
protected final InetAddress getListenHost(Logging l) { try { return InetAddress.getByName(getTunnel().listenHost); } catch (UnknownHostException uhe) { l.log("Could not find listen host to bind to [" + getTunnel().host + "]"); _log.error("Error finding host to bind", uhe); notifyEvent("openBaseClientResult", "error"); return null; } }
private static void error(String s) { I2PAppContext ctx = I2PAppContext.getGlobalContext(); Log log = ctx.logManager().getLog(ConnectionOptions.class); log.error(s); }
public static void main(String args[]) { try { TestUtil.startupBridge(6000); runTest("localhost", 6000); } catch (Throwable t) { _log.error("Error running test", t); } try { Thread.sleep(5*1000); } catch (InterruptedException ie) {} System.exit(0); } }