本文整理匯總了Java中com.sleepycat.je.ExceptionListener類的典型用法代碼示例。如果您正苦於以下問題:Java ExceptionListener類的具體用法?Java ExceptionListener怎麽用?Java ExceptionListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ExceptionListener類屬於com.sleepycat.je包,在下文中一共展示了ExceptionListener類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: notifyExceptionListener
import com.sleepycat.je.ExceptionListener; //導入依賴的package包/類
private void notifyExceptionListener(Exception e) {
if (envImpl == null) {
return;
}
final ExceptionListener listener = envImpl.getExceptionListener();
if (listener == null) {
return;
}
listener.exceptionThrown(DbInternal.makeExceptionEvent(e, name));
}
示例2: getExceptionListener
import com.sleepycat.je.ExceptionListener; //導入依賴的package包/類
public ExceptionListener getExceptionListener() {
return exceptionListener;
}
示例3: getExceptionListener
import com.sleepycat.je.ExceptionListener; //導入依賴的package包/類
public ExceptionListener getExceptionListener() {
return exceptionListener;
}
示例4: uncaughtException
import com.sleepycat.je.ExceptionListener; //導入依賴的package包/類
/**
* When an uncaught exception occurs, log it, publish it to the
* exception handler, and invalidate the environment.
*/
public void uncaughtException(Thread t, Throwable e) {
Logger useLogger = getLogger();
if (useLogger != null) {
String envName = (envImpl == null)? "" : envImpl.getName();
String message = envName + ":" + t.getName() +
" exited unexpectedly with exception " + e;
if (e != null) {
message += LoggerUtils.getStackTrace(e);
}
if (envImpl != null) {
/*
* If we have an environment, log this to all three
* handlers.
*/
LoggerUtils.severe(useLogger, envImpl, message);
} else {
/*
* We don't have an environment, but at least log this
* to the console.
*/
useLogger.log(Level.SEVERE, message);
}
}
if (envImpl == null) {
return;
}
final ExceptionListener exceptionListener =
envImpl.getExceptionListener();
if ((exceptionListener != null) && (e instanceof Exception)) {
exceptionListener.exceptionThrown
(DbInternal.makeExceptionEvent((Exception) e,
t.getName()));
}
/*
* If not already invalid, invalidate environment by creating an
* EnvironmentFailureException.
*/
if (envImpl.isValid()) {
/*
* Create the exception to invalidate the environment, but do
* not throw it since the handle is invoked in some internal
* JVM thread and the exception is not meaningful to the
* invoker.
*/
new EnvironmentFailureException
(envImpl, EnvironmentFailureReason.UNCAUGHT_EXCEPTION, e);
}
}
示例5: setExceptionListener
import com.sleepycat.je.ExceptionListener; //導入依賴的package包/類
public void setExceptionListener(ExceptionListener exceptionListener) {
this.exceptionListener = exceptionListener;
}