public DistStageAck executeOnSlave() {
   if (!log.isTraceEnabled()) {
     log.warn("Trace is not enabled, nothing to do.");
     return successfulResponse();
   }
   synchronized (StackTraceWatchdogStage.class) {
     if (watchDogThread != null) {
       log.warn("Watchdog already running");
     } else {
       watchDogThread = new WatchDogThread();
       watchDogThread.setName(WATCHDOG);
       watchDogThread.setDaemon(true);
       watchDogThread.start();
       log.trace("Started watchdog");
     }
     if (asyncLogging) {
       if (loggingThread != null) {
         log.warn("Logging thread already running");
       } else {
         loggingThread = new LoggingThread();
         loggingThread.setName(WATCHDOG_LOGGING);
         loggingThread.setDaemon(true);
         loggingThread.start();
         log.trace("Started logging thread");
       }
     }
   }
   return successfulResponse();
 }
Ejemplo n.º 2
0
 /**
  * Finalizes this object. This method calls {@link #dispose()} and then calls <code>
  * super.finalize()</code>.
  *
  * @throws Throwable in case of an error.
  */
 protected final void finalize() throws Throwable {
   dispose();
   super.finalize();
 }