Package java.util

Examples of java.util.TimerTask


        }
        final Map tasks = new HashMap(keys.size());
        final Iterator iter = keys.iterator();
        while (iter.hasNext()) {
            final Object key = iter.next();
            final TimerTask task = checkMinIdle(keyedPool, key, minIdle, period);
            tasks.put(key, task);
        }
        return tasks;
    }
View Full Code Here


    {
        Date now = new Date( );

        Date then = new Date( now.getTime( ) + (item.getRule( ).getDuration( ).getDuration( item.getTuple( ) ) * 1000) );

        TimerTask task = new AgendaItemFireListener( item,
                                                     workingMemory );

        this.scheduler.schedule( task,
                                 then );

View Full Code Here

     * @param item
     *            The item to cancle.
     */
    void cancelAgendaItem(AgendaItem item)
    {
        TimerTask task = (TimerTask) this.tasks.remove( item );

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

           
            @Override
              public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) {
              ctx.sendUpstream(e);
              System.out.println("channel closed wait to reconnect ...");
                  timer.schedule(new TimerTask() {
                      public void run() {
                        System.out.println("reconnecting...");
                         ChannelFuture f = _bootstrap.connect();
                         try
              {
View Full Code Here

 
    @Override
      public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) {
      ctx.sendUpstream(e);
      Constants.ahessianLogger.warn("channel closed wait to reconnect ...");
          timer.schedule(new TimerTask() {
              public void run() {
                Constants.ahessianLogger.warn("reconnecting...");
                  ChannelFuture f = _bootstrap.getBootstrap().connect();
                  try
        {
View Full Code Here

      final ObservableList<ServiceInfo> list = new ObservableList(servicesEventList, propertyNames, new String[]{"host", "name"});
      jTable.setModel(servicesTableModel);
      _selection = new EventSelectionModel<ObservableObject>(servicesEventList);
      jTable.setSelectionModel(_selection);
      TableComparatorChooser tableSorter = TableComparatorChooser.install(jTable, servicesEventList, TableComparatorChooser.SINGLE_COLUMN);
      new Timer("services table updated", true).schedule(new TimerTask()
      {

      @Override
      public void run()
      {
View Full Code Here

  {
      ExecutorService executor = Executors.newCachedThreadPool();
     
      loadData();
     
      new Timer("hosts updater", true).schedule(new TimerTask()
      {

      @Override
      public void run()
      {
View Full Code Here

  public void start()
  {
    _triggered = true;
    if (_period > 0)
      _timer.schedule(new TimerTask()
      {

        @Override
        public void run()
        {
          _script.execute();
        }

      }, new Date(), _period);
    else
      _timer.schedule(new TimerTask()
      {

        @Override
        public void run()
        {
View Full Code Here

      servicesTable = new ServicesTable(form._SERVICES_TABLE);
      hosts = new HostsTable(form._HOSTS_TABLE);
      hidden = new HiddenTable(form._HIDDEN_TABLE);
      loadData();
     
      new Timer("hosts updater", true).schedule(new TimerTask()
      {

      @Override
      public void run()
      {
View Full Code Here

                mcast.send((ChannelBuffer) e.getMessage());
            }
           
            @Override
              public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) {
                  timer.schedule(new TimerTask() {
                      public void run() {
                           bootstrap.connect();
                      }
                  }, RECONNECT_DELAY);
              }
View Full Code Here

TOP

Related Classes of java.util.TimerTask

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.