Example usage for org.springframework.batch.integration.chunk AsynchronousFailureException AsynchronousFailureException

List of usage examples for org.springframework.batch.integration.chunk AsynchronousFailureException AsynchronousFailureException

Introduction

In this page you can find the example usage for org.springframework.batch.integration.chunk AsynchronousFailureException AsynchronousFailureException.

Prototype

public AsynchronousFailureException(String message, Throwable cause) 

Source Link

Document

Create a new AsynchronousFailureException based on a message and another exception.

Usage

From source file:es.fcs.batch.integration.chunk.MyChunkMessageChannelItemWriter.java

/**
 * Re-throws the original throwable if it is unchecked, wraps checked exceptions into
 * {@link AsynchronousFailureException}.
 *///from   w w  w .  j  av a 2s .  c o m
private static AsynchronousFailureException wrapIfNecessary(Throwable throwable) {
    if (throwable instanceof Error) {
        throw (Error) throwable;
    } else if (throwable instanceof AsynchronousFailureException) {
        return (AsynchronousFailureException) throwable;
    } else {
        return new AsynchronousFailureException("Exception in remote process", throwable);
    }
}