Package java.util

Examples of java.util.Timer


  }

  private class GarbageTask extends TimerTask {
    private GarbageTask() {
      if (NTransaction.this.timer == null)
        NTransaction.this.timer = new Timer();
      if (logFile.garbageTimeOut > 0) {
        try {
          NTransaction.this.timer.schedule(this, logFile.garbageTimeOut, logFile.garbageTimeOut);
        } catch (Exception exc) {
          logmon.log(BasicLevel.ERROR,
View Full Code Here


   */
  protected void startTimer() {
    if (mRefreshListTimer != null) {
      mRefreshListTimer.cancel();
    }
    mRefreshListTimer = new Timer("Refresh channel list");
    mRefreshListTimer.schedule(new TimerTask() {
      public void run() {
        if (!mListUpdating) {
          mListUpdating = true;
          fillAvailableChannelsListBox();
View Full Code Here

  /**
   * Returns a shared timer provided by the agent server.
   */
  public static synchronized final Timer getTimer() {
    if (timer == null) {
      timer = new Timer();
    }
    return timer;
  }
View Full Code Here

    if (AgentServer.isHAServer() && !AgentServer.isMasterHAServer())
      return;

    if (period > 0) {
      try {
        Timer timer = AgentServer.getTimer();
        if (!schedule) {
          timer.schedule(this, period, period);
          schedule = true;
        }
      } catch (Exception exc) {
        if (logger.isLoggable(BasicLevel.WARN))
          logger.log(BasicLevel.WARN, "--- " + this, exc);
View Full Code Here

    Log.set(Log.LEVEL_DEBUG);
  }

  protected void setUp () throws Exception {
    System.out.println("---- " + getClass().getSimpleName());
    timer = new Timer();
  }
View Full Code Here

    {
      HttpSession session = request.getSession();
      UserObject userObject = (UserObject)session.getAttribute("userobject");
     
      int individualID = userObject.getIndividualID();    // logged in user
      Timer userTimer = siteInfo.getUserTimer(individualID);
      if (userTimer != null)
      {
        userTimer.cancel();
      }
      if (session != null)
      {
        session.invalidate();
      }
View Full Code Here

          // minutes to seconds, then seconds to miliseconds...
          Integer interval = new Integer(userInterval * 60 * 1000);
         
          // make sure this job isn't already scheduled for some unknown reason...
          // .. by "make sure", I mean blindly cancel the job registered for this user.
          Timer currentTimer = siteInfo.getUserTimer(individualId);
          if (currentTimer != null) {
            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());
          siteInfo.setUserTimer(individualId, newTimer, userEmailCheck);
        }

        // code added for concurrent user maintinance
        session.setAttribute(SessionAlive.IS_ALIVE, new SessionAlive());
View Full Code Here

    public void start() throws ServiceException {
        if(perfmonIntervalnMills == -1 || !LOG.isInfoEnabled()) {
            return;
        }
        PerfmonTask task = new PerfmonTask();
        Timer timer = new Timer(SRV_NAME, true);
        timer.scheduleAtFixedRate(task, 1000, perfmonIntervalnMills);
        this._timer = timer;
        this._status = Status.started;
    }
View Full Code Here

    private final Timer _sweepTimer;

    public ConcurrentKeyedStackObjectPool(String sweepThreadName, PoolableObjectFactory<K, V> factory) {
        this._factory = factory;
        this._poolMap = ConcurrentCollectionProvider.createConcurrentMap(8);
        this._sweepTimer = new Timer("ObjPoolExpirer#" + sweepThreadName, true);
        _sweepTimer.scheduleAtFixedRate(new Expirer(factory.geTimeToLive()), 3000, factory.getSweepInterval());
    }
View Full Code Here

                public void run() {
                    System.err.println("Execution Timeout: " + sw.toString());
                    System.exit(1);
                }
            };
            Timer timer = new Timer();
            timer.schedule(cancel, timeout * 1000);
            try {
                execute(reader);
            } catch (XQueryException e) {
                timer.cancel();
                throw e;
            }
            timer.cancel();
        } else {
            execute(reader);
        }
        if(_timing) {
            if(_timing_in_msec) {
View Full Code Here

TOP

Related Classes of java.util.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.