本文整理汇总了Java中javax.resource.spi.work.WorkEvent.getException方法的典型用法代码示例。如果您正苦于以下问题:Java WorkEvent.getException方法的具体用法?Java WorkEvent.getException怎么用?Java WorkEvent.getException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.resource.spi.work.WorkEvent
的用法示例。
在下文中一共展示了WorkEvent.getException方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: workAccepted
import javax.resource.spi.work.WorkEvent; //导入方法依赖的package包/类
/**
* accept work
*
* @param e workEvent
*/
@Override
public void workAccepted(WorkEvent e)
{
if (e.getType() != WorkEvent.WORK_ACCEPTED)
fail("Wrong accepted type");
source = e.getSource();
work = e.getWork();
startDuration = e.getStartDuration();
exception = e.getException();
if (callbackCount != null)
{
synchronized (this)
{
callbackCount.setAcceptCount(callbackCount.getAcceptCount() + 1);
}
}
super.workAccepted(e);
}
示例2: workRejected
import javax.resource.spi.work.WorkEvent; //导入方法依赖的package包/类
/**
* start work
*
* @param e workEvent
*/
@Override
public void workRejected(WorkEvent e)
{
if (e.getType() != WorkEvent.WORK_REJECTED)
fail("Wrong rejected type");
source = e.getSource();
work = e.getWork();
startDuration = e.getStartDuration();
exception = e.getException();
if (callbackCount != null)
{
synchronized (this)
{
callbackCount.setRejectedCount(callbackCount.getRejectedCount() + 1);
}
}
super.workRejected(e);
}
示例3: workCompleted
import javax.resource.spi.work.WorkEvent; //导入方法依赖的package包/类
/**
* complete work
*
* @param e workEvent
*/
@Override
public void workCompleted(WorkEvent e)
{
if (e.getType() != WorkEvent.WORK_COMPLETED)
fail("Wrong completed type");
timeCompleted = System.currentTimeMillis();
super.workCompleted(e);
Work work = e.getWork();
if (work instanceof NestProviderWork)
{
NestProviderWork nw = (NestProviderWork) work;
done.append(nw.getName());
exception = e.getException();
}
}
示例4: workRejected
import javax.resource.spi.work.WorkEvent; //导入方法依赖的package包/类
public void workRejected(final WorkEvent event) {
// Don't log doWork or startWork since exception is propagated to caller
if (workType == WorkType.DO || workType == WorkType.START) {
return;
}
final WorkException exception = event.getException();
if (exception != null) {
if (WorkException.START_TIMED_OUT.equals(exception.getErrorCode())) {
logger.error(exception.getMessage());
}
}
}
示例5: workCompleted
import javax.resource.spi.work.WorkEvent; //导入方法依赖的package包/类
public void workCompleted(final WorkEvent event) {
// Don't log doWork since exception is propagated to caller
if (workType == WorkType.DO) {
return;
}
Throwable cause = event.getException();
if (cause != null && cause.getCause() != null) {
cause = cause.getCause();
}
if (cause != null) {
logger.error(event.getWork().toString(), cause);
}
}