ee.telekom.workflow.util.CallUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of workflow-engine Show documentation
Show all versions of workflow-engine Show documentation
Telekom-workflow-engine core provides the runtime environment for workflow execution together with all the supporting services (clustering, persistence, error handling etc).
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 );
}
}
}