本文整理汇总了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;
}