for (AnnotationInstance annotationInstance : annotations) {
if (enabled) {
AnnotationTarget target = annotationInstance.target();
if (target instanceof MethodInfo) {
final MethodIdentifier identifier = getMethodIdentifier(target);
final AutoTimer timer = new AutoTimer();
for (ScheduleValues schedulePart : ScheduleValues.values()) {
schedulePart.set(timer, annotationInstance);
}
componentDescription.addScheduleMethodIdentifier(identifier, timer);
}
} else {
logger.warn("@Schedule annotation found on " + annotationInstance.target() + " but timer service is not enabled");
}
}
}
List<AnnotationInstance> schedules = classAnnotations.get(SCHEDULES_ANNOTATION);
if (schedules != null) {
for (AnnotationInstance annotationInstance : schedules) {
AnnotationTarget target = annotationInstance.target();
if (enabled) {
if (target instanceof MethodInfo) {
final MethodIdentifier identifier = getMethodIdentifier(target);
final AnnotationInstance[] values = annotationInstance.value().asNestedArray();
for (AnnotationInstance schedule : values) {
final AutoTimer timer = new AutoTimer();
for (ScheduleValues schedulePart : ScheduleValues.values()) {
schedulePart.set(timer, schedule);
}
componentDescription.addScheduleMethodIdentifier(identifier, timer);
}