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