BeanContext beanContext = threadContext.getBeanContext();
EjbTimerService timerService = beanContext.getEjbTimerService();
if (timerService == null) {
throw new IllegalStateException("This ejb does not support timers " + beanContext.getDeploymentID());
}
return new TimerServiceImpl(timerService, threadContext.getPrimaryKey(), beanContext.getEjbTimeout());
}