Package javax.ejb

Examples of javax.ejb.TimerService


 
  public void ejbCreate() {
  }

  public void createTimer(Timer timer) {
    TimerService timerService = sessionContext.getTimerService();
    log.debug("creating timer "+timer+" in the ejb timer service");
    timerService.createTimer(timer.getDueDate(), new TimerInfo(timer));
  }
View Full Code Here


    // TODO make the scanning of timers for cancellation optional by only deleting the timerjobs in the db.
    // of course, the corresponding ejb timer notifications have to be ignored.

    log.debug("cancelling timers with name "+timerName+" from the ejb timer service");

    TimerService timerService = sessionContext.getTimerService();
    Iterator iter = timerService.getTimers().iterator();
    while (iter.hasNext()) {
      javax.ejb.Timer ejbTimer = (javax.ejb.Timer) iter.next();
      if (ejbTimer.getInfo() instanceof TimerInfo) {
        TimerInfo timerInfo = (TimerInfo) ejbTimer.getInfo();
        if (timerInfo.matchesName(timerName, token)) {
View Full Code Here

    // TODO make the scanning of timers for cancellation optional by only deleting the timerjobs in the db.
    // of course, the corresponding ejb timer notifications have to be ignored.

    log.debug("deleting timers for process instance "+processInstance+" from the ejb timer service");

    TimerService timerService = sessionContext.getTimerService();
    Iterator iter = timerService.getTimers().iterator();
    while (iter.hasNext()) {
      javax.ejb.Timer ejbTimer = (javax.ejb.Timer) iter.next();
      if (ejbTimer.getInfo() instanceof TimerInfo) {
        TimerInfo timerInfo = (TimerInfo) ejbTimer.getInfo();
        if (timerInfo.matchesProcessInstance(processInstance)) {
View Full Code Here

    log.debug("creating timer "+id+" in the ejb timer service");
    createTimer(dueDate);
  }

  public void createTimer(String duration) {
    TimerService timerService = entityContext.getTimerService();
    BusinessCalendar businessCalendar = new BusinessCalendar();
    Date dueDateTime = businessCalendar.add(new Date(), new Duration(duration));
    timerService.createTimer(dueDateTime, null);
  }
View Full Code Here

 
  public void ejbCreate() {
  }

  public void createTimer(Timer timer) {
    TimerService timerService = sessionContext.getTimerService();
    log.debug("creating timer "+timer+" in the ejb timer service");
    timerService.createTimer(timer.getDueDate(), new TimerInfo(timer));
  }
View Full Code Here

    // TODO make the scanning of timers for cancellation optional by only deleting the timerjobs in the db.
    // of course, the corresponding ejb timer notifications have to be ignored.

    log.debug("cancelling timers with name "+timerName+" from the ejb timer service");

    TimerService timerService = sessionContext.getTimerService();
    Iterator iter = timerService.getTimers().iterator();
    while (iter.hasNext()) {
      javax.ejb.Timer ejbTimer = (javax.ejb.Timer) iter.next();
      if (ejbTimer.getInfo() instanceof TimerInfo) {
        TimerInfo timerInfo = (TimerInfo) ejbTimer.getInfo();
        if (timerInfo.matchesName(timerName, token)) {
View Full Code Here

    // TODO make the scanning of timers for cancellation optional by only deleting the timerjobs in the db.
    // of course, the corresponding ejb timer notifications have to be ignored.

    log.debug("deleting timers for process instance "+processInstance+" from the ejb timer service");

    TimerService timerService = sessionContext.getTimerService();
    Iterator iter = timerService.getTimers().iterator();
    while (iter.hasNext()) {
      javax.ejb.Timer ejbTimer = (javax.ejb.Timer) iter.next();
      if (ejbTimer.getInfo() instanceof TimerInfo) {
        TimerInfo timerInfo = (TimerInfo) ejbTimer.getInfo();
        if (timerInfo.matchesProcessInstance(processInstance)) {
View Full Code Here

    }

    public static void addTimers(final EJBComponent ejb, final ModelNode response) {
        response.setEmptyList();
        final String name = ejb.getComponentName();
        TimerService ts = ejb.getTimerService();
        if (ts != null) {
            for (Timer timer : ts.getTimers()) {
                ModelNode timerNode = response.add();
                addTimeRemaining(timer, timerNode, name);
                addNextTimeout(timer, timerNode, name);
                addCalendarTimer(timer, timerNode, name);
                addPersistent(timer, timerNode, name);
View Full Code Here

    * @see org.jboss.ejb3.timerservice.TimerServiceFactory#createTimerService(javax.management.ObjectName, org.jboss.ejb3.timerservice.TimedObjectInvoker)
    */
   @Override
   public TimerService createTimerService(Container container, TimedObjectInvoker invoker)
   {
      TimerService timerService = null;
      try
      {
         EJBTimerService service = getEJBTimerService();
         TimerService delegate = service.createTimerService(container.getObjectName(), null, invoker);
         timerService = new TimerServiceFacade(container, delegate);
      }
      catch (Exception e)
      {
         //throw new EJBException("Could not create timer service", e);
View Full Code Here

    }

    public static void addTimers(final EJBComponent ejb, final ModelNode response) {
        response.setEmptyList();
        final String name = ejb.getComponentName();
        TimerService ts = ejb.getTimerService();
        if (ts != null) {
            for (Timer timer : ts.getTimers()) {
                ModelNode timerNode = response.add();
                addTimeRemaining(timer, timerNode, name);
                addNextTimeout(timer, timerNode, name);
                addCalendarTimer(timer, timerNode, name);
                addPersistent(timer, timerNode, name);
View Full Code Here

TOP

Related Classes of javax.ejb.TimerService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.