in src/main/java/org/apache/sling/jobs/impl/JobSubsystem.java [182:201]
public Set<Types.JobType> getJobTypes(ServiceReference<JobConsumer> ref) {
Object types = ref.getProperty(JobConsumer.JOB_TYPES);
if (types instanceof String) {
return Types.jobType(new String[]{(String) types});
} else if (types instanceof String[]) {
return Types.jobType((String[]) types);
} else if (types instanceof Iterable) {
List<String> l = new ArrayList<String>();
for (Object o : (Iterable<?>) types) {
l.add(String.valueOf(o));
}
return Types.jobType(l.toArray(new String[l.size()]));
}
throw new IllegalArgumentException("For the JobConsumer to work, the job consumer must either " +
"implement a JobTypeValve or define a list of JobTypes, neither were specified. " +
"Please check the implementation or OSGi configuration, was expecting " +
JobConsumer.JOB_TYPES + " property to be set to a String[]");
}