}
timerServiceRequired = true;
}
for (Iterator<Map.Entry<Method, MethodContext>> it = beanContext.iteratorMethodContext(); it.hasNext(); ) {
Map.Entry<Method, MethodContext> entry = it.next();
MethodContext methodContext = entry.getValue();
if (methodContext.getSchedules().size() > 0) {
timerServiceRequired = true;
Method method = entry.getKey();
//TODO Need ?
if (beanContext.getTransactionType(method) == TransactionType.RequiresNew) {
beanContext.setMethodTransactionAttribute(method, TransactionType.Required);
}
}
}
if (timerServiceRequired) {
// Create the timer
EjbTimerServiceImpl timerService = new EjbTimerServiceImpl(beanContext);
//Load auto-start timers
TimerStore timerStore = timerService.getTimerStore();
for (Iterator<Map.Entry<Method, MethodContext>> it = beanContext.iteratorMethodContext(); it.hasNext(); ) {
Map.Entry<Method, MethodContext> entry = it.next();
MethodContext methodContext = entry.getValue();
for (ScheduleData scheduleData : methodContext.getSchedules()) {
timerStore.createCalendarTimer(timerService, (String) beanContext.getDeploymentID(), null, entry.getKey(), scheduleData.getExpression(), scheduleData.getConfig());
}
}
beanContext.setEjbTimerService(timerService);
} else {