Package javax.ejb

Examples of javax.ejb.Timer


    public boolean stopSnapshot() {
        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


        }
        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;
    }
View Full Code Here

        checkState();

        Collection<Timer> timers = new ArrayList<Timer>();
        for (Iterator iterator = timerStore.getTimers((String)deployment.getDeploymentID()).iterator(); iterator.hasNext();) {
            TimerData timerData = (TimerData) iterator.next();
            Timer timer = timerData.getTimer();
            timers.add(timer);
        }
        return timers;
    }
View Full Code Here

     *
     * @param timerData the timer to call.
     */
    private void ejbTimeout(TimerData timerData) {
        try {
            Timer timer = getTimer(timerData.getId());
            if (timer == null) {
                return;
            }

            for (int tries = 0; tries < (1 + retryAttempts); tries++) {
View Full Code Here

    @SuppressWarnings("ReturnInsideFinallyBlock")
    public void ejbTimeout(final TimerData timerData) {
        final Thread thread = Thread.currentThread();
        final ClassLoader loader = thread.getContextClassLoader(); // container loader
        try {
            Timer timer = getTimer(timerData.getId());
            // quartz can be backed by some advanced config (jdbc for instance)
            if (timer == null && timerStore instanceof MemoryTimerStore && timerData.getTimer() != null) {
                try {
                    timerStore.addTimerData(timerData);
                    timer = timerData.getTimer(); // TODO: replace memoryjobstore by the db one?
View Full Code Here

        public Timer getTimer()
            throws IllegalStateException,
                   NoSuchObjectLocalException,
                   EJBException
        {
            Timer timer = (Timer) instance().call(new Callable() {
                public Object call()
                {
                    try
                    {
                        return handle.getTimer();
View Full Code Here

     * @param timerData the timer to call.
     */
    @SuppressWarnings("ReturnInsideFinallyBlock")
    public void ejbTimeout(final TimerData timerData) {
        try {
            Timer timer = getTimer(timerData.getId());
            // quartz can be backed by some advanced config (jdbc for instance)
            if (timer == null && timerStore instanceof MemoryTimerStore && timerData.getTimer() != null) {
                try {
                    timerStore.addTimerData(timerData);
                    timer = timerData.getTimer(); // TODO: replace memoryjobstore by the db one?
View Full Code Here

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

  public void initClear() {
    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();
      }
    }
  }
View Full Code Here

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

TOP

Related Classes of javax.ejb.Timer

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.