Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,32 @@ public static JobRunner build(final Object targetObject, final Method targetMeth
return new JobRunner() {
@Override
public Result run(JobContext jobContext) throws Throwable {
Object resultObj;
if (pTypes == null || pTypes.length == 0) {
return (Result) targetMethod.invoke(targetObject);
}
Object[] pTypeValues = new Object[pTypes.length];

for (int i = 0; i < pTypes.length; i++) {
if (pTypes[i] == Job.class) {
pTypeValues[i] = jobContext.getJob();
} else if (pTypes[i] == JobContext.class) {
pTypeValues[i] = jobContext;
} else {
pTypeValues[i] = null;
resultObj = targetMethod.invoke(targetObject);
}else{

Object[] pTypeValues = new Object[pTypes.length];

for (int i = 0; i < pTypes.length; i++) {
if (pTypes[i] == Job.class) {
pTypeValues[i] = jobContext.getJob();
} else if (pTypes[i] == JobContext.class) {
pTypeValues[i] = jobContext;
} else {
pTypeValues[i] = null;
}
}

resultObj = targetMethod.invoke(targetObject, pTypeValues);
}

Class<?> returnType = targetMethod.getReturnType();
if (returnType != Result.class) {
return new Result(Action.EXECUTE_SUCCESS);
}
return (Result) targetMethod.invoke(targetObject, pTypeValues);

return (Result) resultObj;
}
};
}
Expand Down