log.debug("ejb timer "+ejbTimer+" fires");
String localCommandServiceJndiName = "java:comp/env/ejb/LocalCommandServiceBean";
try {
Context initial = new InitialContext();
LocalCommandServiceHome localCommandServiceHome = (LocalCommandServiceHome) initial.lookup(localCommandServiceJndiName);
LocalCommandService localCommandService = localCommandServiceHome.create();
Serializable info = ejbTimer.getInfo();
if (! (info instanceof TimerInfo)) {
if (info ==null) {
throw new NullPointerException("timer info is null");
} else {
throw new ClassCastException("timer info ("+info.getClass().getName()+") is not of the expected class "+TimerInfo.class.getName());
}
}
TimerInfo timerInfo = (TimerInfo) info;
localCommandService.execute(new ExecuteTimerCommand(timerInfo.getTimerId()));
} catch (Exception e) {
JbpmException jbpmException = new JbpmException("couldn't execute timer", e);
log.error(jbpmException);
throw jbpmException;
}