in src/main/groovy/grails/plugins/quartz/GrailsJobFactory.java [68:101]
public GrailsJob(Object job) {
this.job = job;
// Finds an execute method with zero or one parameter.
this.executeMethod = ReflectionUtils.findMethod(
job.getClass(), GrailsJobClassConstants.EXECUTE, (Class<?>[]) null
);
if (executeMethod == null) {
throw new IllegalArgumentException(
MessageFormat.format(
"{0} should declare #{1}() method",
job.getClass().getName(), GrailsJobClassConstants.EXECUTE
)
);
}
switch (executeMethod.getParameterTypes().length) {
case 0:
passExecutionContext = false;
break;
case 1:
passExecutionContext = true;
break;
default:
throw new IllegalArgumentException(
MessageFormat.format(
"{0}#{1}() method should take either no arguments or one argument of type JobExecutionContext",
job.getClass().getName(), GrailsJobClassConstants.EXECUTE
)
);
}
// Find interrupt method
this.interruptMethod = ReflectionUtils.findMethod(job.getClass(), GrailsJobClassConstants.INTERRUPT);
}