}
public Timer getTimer() {
ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
if (containerSystem == null) {
throw new NoSuchObjectLocalException("OpenEJb container system is not running");
}
DeploymentInfo deploymentInfo = containerSystem.getDeploymentInfo(deploymentId);
if (deploymentInfo == null) {
throw new NoSuchObjectLocalException("Deployment info not found " + deploymentId);
}
EjbTimerService timerService = deploymentInfo.getEjbTimerService();
if (timerService == null) {
throw new NoSuchObjectLocalException("Deployment no longer supports ejbTimout " + deploymentId + ". Has this ejb been redeployed?");
}
Timer timer = timerService.getTimer(id);
if (timer == null) {
throw new NoSuchObjectLocalException("Timer not found for ejb " + deploymentId);
}
return timer;
}