Example usage for javax.resource.spi.work WorkEvent getException

List of usage examples for javax.resource.spi.work WorkEvent getException

Introduction

In this page you can find the example usage for javax.resource.spi.work WorkEvent getException.

Prototype

public WorkException getException() 

Source Link

Document

Return the WorkException.

Usage

From source file:org.mule.processor.AsyncWorkListener.java

protected void handleWorkException(WorkEvent event, String type) {
    if (event == null) {
        return;/*from   w  ww .ja va  2s .  c  om*/
    }

    Throwable e = event.getException();

    if (e == null) {
        return;
    }

    if (e.getCause() != null) {
        e = e.getCause();
    }

    logger.error(
            "Work caused exception on '" + type + "'. Work being executed was: " + event.getWork().toString());
    throw new MuleRuntimeException(CoreMessages.errorInvokingMessageProcessorAsynchronously(target), e);
}

From source file:org.mule.transport.AbstractConnector.java

protected void handleWorkException(WorkEvent event, String type) {
    if (event == null) {
        return;//w ww  .j  a  v  a 2s.co m
    }

    Throwable e = event.getException();

    if (e == null) {
        return;
    }

    if (e.getCause() != null) {
        e = e.getCause();
    }

    logger.error(
            "Work caused exception on '" + type + "'. Work being executed was: " + event.getWork().toString());

    if (e instanceof MessagingException) {
        MuleEvent failedEvent = ((MessagingException) e).getEvent();
        failedEvent.getFlowConstruct().getExceptionListener().handleException((MessagingException) e,
                failedEvent);
    } else if (e instanceof Exception) {
        muleContext.getExceptionListener().handleException((Exception) e);
    } else {
        muleContext.getExceptionListener().handleException(
                new MuleRuntimeException(CoreMessages.connectorCausedError(this.getName()), e));
    }
}

From source file:org.mule.work.DefaultWorkListener.java

protected void handleWorkException(WorkEvent event, String type) {
    Throwable e;//from w  w  w  . j a  va2 s.co m

    if (event != null && event.getException() != null) {
        e = event.getException();
    } else {
        return;
    }

    if (event.getException().getCause() != null) {
        e = event.getException().getCause();
    }

    logger.error(
            "Work caused exception on '" + type + "'. Work being executed was: " + event.getWork().toString());
    logger.error(e);
}