Example usage for org.springframework.batch.item.adapter DynamicMethodInvocationException DynamicMethodInvocationException

List of usage examples for org.springframework.batch.item.adapter DynamicMethodInvocationException DynamicMethodInvocationException

Introduction

In this page you can find the example usage for org.springframework.batch.item.adapter DynamicMethodInvocationException DynamicMethodInvocationException.

Prototype

public DynamicMethodInvocationException(Throwable cause) 

Source Link

Usage

From source file:org.springframework.batch.item.data.RepositoryItemReader.java

private Object doInvoke(MethodInvoker invoker) throws Exception {
    try {//from   ww  w. j av  a2s. co m
        invoker.prepare();
    } catch (ClassNotFoundException e) {
        throw new DynamicMethodInvocationException(e);
    } catch (NoSuchMethodException e) {
        throw new DynamicMethodInvocationException(e);
    }

    try {
        return invoker.invoke();
    } catch (InvocationTargetException e) {
        if (e.getCause() instanceof Exception) {
            throw (Exception) e.getCause();
        } else {
            throw new InvocationTargetThrowableWrapper(e.getCause());
        }
    } catch (IllegalAccessException e) {
        throw new DynamicMethodInvocationException(e);
    }
}