Package java.util

Examples of java.util.TimerTask.cancel()


      try {
        Thread.sleep(100);
      } catch (InterruptedException ignored) {
      }
    }
    failTask.cancel();
    if (fail) fail("Test did not complete in a timely manner.");
    // Give sockets a chance to close before starting the next test.
    try {
      Thread.sleep(1000);
    } catch (InterruptedException ignored) {
View Full Code Here


            currentTimer.cancel();
          }

          TimerTask currentTask = siteInfo.getUserTask(individualId);
          if (currentTask != null) {
            currentTask.cancel();
          }

          Timer newTimer = new Timer(true);
          TimerTask userEmailCheck = new UserEmailCheck(individualId, session, dataSource, host);
          newTimer.schedule(userEmailCheck, 300000L, interval.longValue());
View Full Code Here

        // we have changed the interval at which it executes
        TimerTask supportEmailTask = settings.getSupportEmailTask();
        Timer supportEmailTimer = settings.getSupportEmailTimer();
        // cancel the existing timer.
        if (supportEmailTask != null) {
          supportEmailTask.cancel();
        }
        if (supportEmailTimer != null) {
          supportEmailTimer.cancel();
        }
        // only re-schedule the job if the interval is greater than zero
View Full Code Here

            synchronized (openTasks) {
                oldTask = openTasks.put(topic, task);
            }
           
            if (oldTask != null) {
                oldTask.cancel();
            }
           
            timer.schedule(task, 1000, 1000);
        }
       
View Full Code Here

            synchronized (openTasks) {
                task = openTasks.remove(topic);
            }
           
            if (task != null) {
                task.cancel();
            }
        }
    }

   
View Full Code Here

    {
        TimerTask task = (TimerTask) this.tasks.remove( item );

        if ( task != null )
        {
            task.cancel( );
        }
    }
   
    void setAsyncExceptionHandler(AsyncExceptionHandler handler)
    {
View Full Code Here

    {
        TimerTask task = (TimerTask) this.tasks.remove( item );

        if ( task != null )
        {
            task.cancel( );
        }
    }

    void setAsyncExceptionHandler(AsyncExceptionHandler handler)
    {
View Full Code Here

                calledMethods.clear();
                final ObjectPool pool = (ObjectPool)createProxy(ObjectPool.class, calledMethods);
                final TimerTask task = PoolUtils.checkMinIdle(pool, 1, CHECK_PERIOD); // checks minIdle immediately

                Thread.sleep(CHECK_SLEEP_PERIOD); // will check CHECK_COUNT more times.
                task.cancel();
                task.toString();

                final List expectedMethods = new ArrayList();
                for (int i=0; i < CHECK_COUNT; i++) {
                    expectedMethods.add("getNumIdle");
View Full Code Here

                calledMethods.clear();
                final KeyedObjectPool pool = (KeyedObjectPool)createProxy(KeyedObjectPool.class, calledMethods);
                final TimerTask task = PoolUtils.checkMinIdle(pool, key, 1, CHECK_PERIOD); // checks minIdle immediately

                Thread.sleep(CHECK_SLEEP_PERIOD); // will check CHECK_COUNT more times.
                task.cancel();
                task.toString();

                final List expectedMethods = new ArrayList();
                for (int i=0; i < CHECK_COUNT; i++) {
                    expectedMethods.add("getNumIdle");
View Full Code Here

                Thread.sleep(CHECK_SLEEP_PERIOD); // will check CHECK_COUNT more times.
                final Iterator iter = tasks.values().iterator();
                while (iter.hasNext()) {
                    final TimerTask task = (TimerTask)iter.next();
                    task.cancel();
                }

                final List expectedMethods = new ArrayList();
                for (int i=0; i < CHECK_COUNT * keys.size(); i++) {
                    expectedMethods.add("getNumIdle");
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.