2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.logging.bridge.internal;
10 import org.slf4j.Logger;
11 import org.slf4j.LoggerFactory;
13 enum UncaughtExceptionPolicy implements Thread.UncaughtExceptionHandler {
15 public static final int EXIT_CODE = 1;
18 public void uncaughtException(final Thread t, final Throwable e) {
19 log.error("Thread {} died because of an uncaught exception, forcing virtual machine shutdown", t, e);
20 System.exit(EXIT_CODE);
25 public void uncaughtException(final Thread t, final Throwable e) {
26 log.error("Thread {} died because of an uncaught exception", t, e);
30 private static final Logger log = LoggerFactory.getLogger(UncaughtExceptionPolicy.class);