All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ee.telekom.workflow.util.CallUtil Maven / Gradle / Ivy

Go to download

Telekom-workflow-engine core provides the runtime environment for workflow execution together with all the supporting services (clustering, persistence, error handling etc).

There is a newer version: 1.6.3
Show newest version
package ee.telekom.workflow.util;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import ee.telekom.workflow.graph.WorkflowException;

public class CallUtil{

    public static Object call( Object target, String methodName, Object[] arguments ){
        Method method = MethodUtil.findMethod( target.getClass(), methodName, MethodUtil.getArgumentClasses( arguments ) );
        try{
            return method.invoke( target, arguments );
        }
        catch( IllegalAccessException e ){
            throw new WorkflowException( "Invoking method '" + method.getName() + "' on class '" + target.getClass().getName() + "' failed", e );
        }
        catch( IllegalArgumentException e ){
            throw new WorkflowException( "Invoking method '" + method.getName() + "' on class '" + target.getClass().getName() + "' failed", e );
        }
        catch( InvocationTargetException e ){
            throw new WorkflowException( "Invoking method '" + method.getName() + "' on class '" + target.getClass().getName() + "' failed", e );
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy