Example usage for javax.resource.spi.work WorkException INTERNAL

List of usage examples for javax.resource.spi.work WorkException INTERNAL

Introduction

In this page you can find the example usage for javax.resource.spi.work WorkException INTERNAL.

Prototype

String INTERNAL

To view the source code for javax.resource.spi.work WorkException INTERNAL.

Click Source Link

Document

Indicates an internal error condition.

Usage

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

/**
 * Execute the specified Work.//w  w  w . j  av  a 2  s . c o  m
 *
 * @param work Work to be executed.
 * @exception WorkException Indicates that the Work execution has been
 *                unsuccessful.
 */
private void executeWork(WorkerContext work, WorkExecutor workExecutor) throws WorkException {
    if (!isStarted()) {
        throw new IllegalStateException("This MuleWorkManager '" + name + "' is stopped");
    }

    try {
        work.workAccepted(this);
        workExecutor.doExecute(work, workExecutorService);
        WorkException exception = work.getWorkException();
        if (null != exception) {
            throw exception;
        }
    } catch (InterruptedException e) {
        WorkCompletedException wcj = new WorkCompletedException(
                "The execution has been interrupted for WorkManager: " + name, e);
        wcj.setErrorCode(WorkException.INTERNAL);
        throw wcj;
    }
}