Package javax.ejb

Examples of javax.ejb.Timer.cancel()


            }
            Assert.assertTrue(SuspendTimerServiceBean.awaitTimerServiceCount() > 0);
        } finally {
            if (timer != null) {
                timer.cancel();
                Thread.sleep(100);
            }
        }
    }
View Full Code Here


            Thread.sleep(300); //if they were backed up we give them some time to run
            int timerServiceCount = SuspendTimerServiceBean.getTimerServiceCount();
            Assert.assertTrue("Interval " + (System.currentTimeMillis() - start) + " count " + timerServiceCount, timerServiceCount < 40);
        } finally {
            if (timer != null) {
                timer.cancel();
                Thread.sleep(100);
            }
        }
    }
View Full Code Here

            }
            Assert.assertEquals(1, SuspendTimerServiceBean.awaitTimerServiceCount());
        } finally {
            if (timer != null) {
                try {
                    timer.cancel();
                    Thread.sleep(100);
                } catch(Exception e) {
                    //as the timer has already expired this may throw an exception
                }
            }
View Full Code Here

        Collection<Timer> timers = timer.getTimers();
        // stop all timers
        boolean cancelled = false;
        for(Iterator<Timer> it = timers.iterator(); it.hasNext(); ) {
            Timer t = it.next();
            t.cancel();
            cancelled = true;
            log.info("Stopped snapshot timer...");
        }
        return cancelled;
    }
View Full Code Here

  @PreDestroy
  public void initClear() {
    LOG.info("Clear Timers ");
    for (Object obj : timerService.getTimers()) {
      Timer t = (Timer) obj;
      t.cancel();
    }
  }

  public void createTimers() {
    // create timer
View Full Code Here

    LOG.info("Clear Timers ");
    if (timerService.getTimers() != null) {
      LOG.info("Size: {}", timerService.getTimers().size());
      for (Object obj : timerService.getTimers()) {
        Timer t = (Timer) obj;
        t.cancel();
      }
    }
  }
 
  public void createTimers() {
View Full Code Here

  @PreDestroy
  public void initClear() {
    LOG.info("Clear Timers ");
    for (Object obj : timerService.getTimers()) {
      Timer t = (Timer) obj;
      t.cancel();
    }
  }
 
  public void createTimers() {
    /**
 
View Full Code Here

        Collection<Timer> timers = timer.getTimers();
        // stop all timers
        boolean cancelled = false;
        for(Iterator<Timer> it = timers.iterator(); it.hasNext(); ) {
            Timer t = it.next();
            t.cancel();
            cancelled = true;
            log.info("Stopped snapshot timer...");
        }
        return cancelled;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.