Examples of UncaughtExceptionHandler


Examples of java.lang.Thread.UncaughtExceptionHandler

                    final String msg = sm.getString(
                                    "threadPoolExecutor.threadStoppedToAvoidPotentialLeak",
                                    Thread.currentThread().getName());

                    Thread.currentThread().setUncaughtExceptionHandler(
                            new UncaughtExceptionHandler() {
                                @Override
                                public void uncaughtException(Thread t,
                                        Throwable e) {
                                    // yes, swallow the exception
                                    log.debug(msg);
View Full Code Here

Examples of java.lang.Thread.UncaughtExceptionHandler

   * Chore, it keeps its own internal stop mechanism so needs to be stopped
   * by this hosting server.  Worker logs the exception and exits.
   */
  private void startServiceThreads() throws IOException {
    String n = Thread.currentThread().getName();
    UncaughtExceptionHandler handler = new UncaughtExceptionHandler() {
      public void uncaughtException(Thread t, Throwable e) {
        abort();
        LOG.fatal("Set stop flag in " + t.getName(), e);
      }
    };
View Full Code Here

Examples of java.lang.Thread.UncaughtExceptionHandler

        isRunning = true;

        Thread recoveryThread = new Thread(this, "AsyncNodeRecoverer");
        recoveryThread.setDaemon(true);
        recoveryThread.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {

            public void uncaughtException(Thread t, Throwable e) {
                if(logger.isEnabledFor(Level.ERROR))
                    logger.error("Uncaught exception in failure detector recovery thread:", e);
            }
View Full Code Here

Examples of java.lang.Thread.UncaughtExceptionHandler

        if (interval == 0) {
            return this;
        }

        ThreadFactory threadFactory = new ThreadFactoryBuilder().setDaemon(true)
                .setUncaughtExceptionHandler(new UncaughtExceptionHandler() {

                    @Override
                    public void uncaughtException(Thread t, Throwable e) {
                        logger.error("Expection from timer thread", e);
                    }
View Full Code Here

Examples of java.lang.Thread.UncaughtExceptionHandler

                    this.getClass().getName(), id, String.valueOf(timerIntervalInMilliseconds) });
        }

        if (checkpointingConfig.mode == CheckpointingMode.TIME) {
            ThreadFactory threadFactory = new ThreadFactoryBuilder().setDaemon(true)
                    .setUncaughtExceptionHandler(new UncaughtExceptionHandler() {

                        @Override
                        public void uncaughtException(Thread t, Throwable e) {
                            logger.error("Expection from checkpointing thread", e);
                        }
View Full Code Here

Examples of java.lang.Thread.UncaughtExceptionHandler

    return timeout;
  }

  @Override
  protected UncaughtExceptionHandler getUncaughtExceptionHandler() {
    return new UncaughtExceptionHandler() {
      @Override
      public void uncaughtException(Thread t, Throwable e) {
        LOG.warn("Assigning entityGroups in " + t.getName(), e);
      }
    };
View Full Code Here

Examples of java.lang.Thread.UncaughtExceptionHandler

  protected String getThreadNamePrefix() {
    return this.server.getServerName() + "-" + this.getClass().getName();
  }

  protected UncaughtExceptionHandler getUncaughtExceptionHandler() {
    return new UncaughtExceptionHandler() {
      @Override
      public void uncaughtException(Thread t, Throwable e) {
        // Abort if exception of any kind.
        server.abort("Uncaught exception in " + t.getName(), e);
      }
View Full Code Here

Examples of java.lang.Thread.UncaughtExceptionHandler

      prefix = getInvoker(2);
    }
    t.setName(prefix + "-" + getSequence(prefix));
   
    //
    final UncaughtExceptionHandler handler = this.getUncaughtExceptionHandler();
    if(handler != null) {
      t.setUncaughtExceptionHandler(handler);
    } else {
      t.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
        public void uncaughtException(Thread t, Throwable e) {
          LOGGER.error("unhandled exception in thread: " + t.getId() + ":" + t.getName(), e);
        }
      });
    }
View Full Code Here

Examples of java.lang.Thread.UncaughtExceptionHandler

    // login the server principal (if using secure Hadoop)
    userProvider.login("hbase.regionserver.keytab.file",
      "hbase.regionserver.kerberos.principal", this.isa.getHostName());
    regionServerAccounting = new RegionServerAccounting();
    cacheConfig = new CacheConfig(conf);
    uncaughtExceptionHandler = new UncaughtExceptionHandler() {
      @Override
      public void uncaughtException(Thread t, Throwable e) {
        abort("Uncaught exception in service thread " + t.getName(), e);
      }
    };
View Full Code Here

Examples of java.lang.Thread.UncaughtExceptionHandler

   * Chore, it keeps its own internal stop mechanism so needs to be stopped
   * by this hosting server.  Worker logs the exception and exits.
   */
  private void startServiceThreads() throws IOException {
    String n = Thread.currentThread().getName();
    UncaughtExceptionHandler handler = new UncaughtExceptionHandler() {
      public void uncaughtException(Thread t, Throwable e) {
        abort();
        LOG.fatal("Set stop flag in " + t.getName(), e);
      }
    };
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.