public void stopService() { log.info("Stopping SystemMonitor"); if (me != null) me.interrupt(); }
public void run() { while (running()) { log.info(this); frozenDump = null; try { long expected = System.currentTimeMillis() + sleepTime; Thread.sleep(sleepTime); delay = System.currentTimeMillis() - expected; } catch (InterruptedException ignored) { } } log.info(this); } public void dump (PrintStream p, String indent) {
@Override public void info(String msg) { if (isInfoEnabled()) { log.info(msg); } }
@Override public void info(String msg, Throwable t) { if (isInfoEnabled()) { log.info(msg, t); } }
public void destroyService() { getLog().info ("Cancelling timer"); timer.cancel(); } private void close() {
public void startService() { try { log.info("Starting SystemMonitor"); me = new Thread(this,"SystemMonitor"); me.start(); } catch (Exception e) { log.warn("error starting service", e); } }
@Override public void info(String format, Object... arguments) { if (isInfoEnabled()) { FormattingTuple ft = MessageFormatter.arrayFormat(format, arguments); log.info(ft.getMessage()); } }
private void deleteFile (File f, String iuuid) { f.delete(); getLog().info(String.format("Deleted transient descriptor %s (%s)", f.getAbsolutePath(), iuuid)); }
@Override protected void stopService() throws Exception { log.info("Stopping SSHD"); if(sshd!=null) { new Thread() { public void run() { try { sshd.stop(true); } catch (IOException ignored) { } sshd=null; } }.start(); } }
public void shutdown (boolean join) { shutdown = true; if (q2Thread != null) { log.info ("shutting down"); q2Thread.interrupt (); if (join) { try { q2Thread.join(); log.info ("shutdown done"); } catch (InterruptedException e) { log.warn (e); } } } q2Thread = null; stopOSGIFramework(); } public QClassLoader getLoader () {
@Override public void info(String format, Object arg1, Object arg2) { if (isInfoEnabled()) { FormattingTuple ft = MessageFormatter.format(format, arg1, arg2); log.info(ft.getMessage()); } }
@Override public void channelActive(ChannelHandlerContext ctx) throws Exception { super.channelActive(ctx); server.getLog().info("accepted: " + ctx.channel()); }
@Override public void info(String format, Object arg) { if (isInfoEnabled()) { FormattingTuple ft = MessageFormatter.format(format, arg); log.info(ft.getMessage()); } }
@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { super.channelActive(ctx); server.getLog().info("closed: " + ctx.channel()); }
private void checkAuthorizedKeys (String s) throws IOException { String OS = System.getProperty("os.name").toLowerCase(); if((OS.indexOf("win") >= 0)){ log.info("Windows Detected, ignoring file permissions check: "+OS); return; } Path file = Paths.get(s); PosixFileAttributes attrs = Files.getFileAttributeView(file, PosixFileAttributeView.class) .readAttributes(); Set<PosixFilePermission> perms = attrs.permissions(); if (perms.size() != 1 || !perms.contains(PosixFilePermission.OWNER_READ)) throw new IllegalArgumentException( String.format ("Invalid permissions '%s' for file '%s'", PosixFilePermissions.toString(perms), s) ); }
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { if (evt instanceof IdleStateEvent) { IdleState e = ((IdleStateEvent) evt).state(); if (e == IdleState.READER_IDLE) { server.getLog().info("timeout " + ctx.channel()); ctx.fireChannelInactive(); ctx.close(); } } } }
public void run() { getLog().info(cfg.get ("message")); } }
private void initSystemLogger () { File loggerConfig = new File (deployDir, LOGGER_CONFIG); if (loggerConfig.canRead()) { hasSystemLogger = true; try { register (loggerConfig); deploy (); } catch (Exception e) { getLog().warn ("init-system-logger", e); } } getLog().info("Q2 started, deployDir=" + deployDir.getAbsolutePath()); } public Log getLog () {
protected void recover () { if (doRecover) { if (tail < head) { getLog().info ("recover - tail=" +tail+", head="+head); } while (tail < head) { recover (0, tail++); } } else tail = head; syncTail (); } protected void recover (int session, long id) {
private void undeploy (File f) { QEntry qentry = (QEntry) dirMap.get (f); try { if (log != null) log.trace ("undeploying:" + f.getCanonicalPath()); if (qentry.isQBean()) { Object obj = qentry.getObject (); ObjectName name = qentry.getObjectName (); factory.destroyQBean (this, name, obj); } else if (qentry.isOSGIBundle()) { getLog().warn("OSGI bundle " + f.getName() + " no longer available in deploy directory"); } if (log != null) log.info ("undeployed:" + f.getCanonicalPath()); } catch (Exception e) { getLog().warn ("undeploy", e); } }