FileDocCategorySizeDatePackage
PersistentTimer.javaAPI DocJBoss 4.2.13375Fri Jul 13 20:53:54 BST 2007org.jboss.ejb3.timerservice.quartz

PersistentTimer

public class PersistentTimer extends Object implements Serializable, javax.ejb.TimerHandle
This class contains all the info for find a persistent timer.
author
Carlo de Wolf
version
$Revision: 60233 $

Fields Summary
private static final Logger
log
private static final long
serialVersionUID
private String
triggerName
private String
triggerGroup
private ObjectName
objectName
private Serializable
info
Constructors Summary
protected PersistentTimer(org.quartz.Trigger trigger, ObjectName objectName, Serializable info)

   
         
   
      assert trigger != null;
      assert objectName != null;
      
      this.triggerName = trigger.getName();
      this.triggerGroup = trigger.getGroup();
      this.objectName = objectName;
      this.info = info;
   
Methods Summary
protected org.jboss.ejb3.timerservice.TimedObjectInvokergetTimedObjectInvoker()

      // TODO: a hack to get back the container. This needs thinking.
      TimedObjectInvoker invoker = (TimedObjectInvoker) Ejb3Registry.getContainer(objectName.getCanonicalName());
      assert invoker != null;
      return invoker;
   
public javax.ejb.TimergetTimer()

      // TODO: check state
      try
      {
         Scheduler scheduler = QuartzTimerServiceFactory.getScheduler();
         Trigger trigger = scheduler.getTrigger(triggerName, triggerGroup);
         if(trigger == null)
            throw new NoSuchObjectLocalException("can't find trigger '" + triggerName + "' in group '" + triggerGroup + "'");
         return new TimerImpl(scheduler, trigger, info);
      }
      catch(SchedulerException e)
      {
         log.error("getTimer failed", e);
         throw new EJBException(e);
      }