Examples of scheduleAtFixedRate()


Examples of com.hazelcast.spi.ExecutionService.scheduleAtFixedRate()

        int partitionTableSendInterval = node.groupProperties.PARTITION_TABLE_SEND_INTERVAL.getInteger();
        if (partitionTableSendInterval <= 0) {
            partitionTableSendInterval = 1;
        }
        ExecutionService executionService = nodeEngine.getExecutionService();
        executionService.scheduleAtFixedRate(new SendClusterStateTask(),
                partitionTableSendInterval, partitionTableSendInterval, TimeUnit.SECONDS);


        int backupSyncCheckInterval = node.groupProperties.PARTITION_BACKUP_SYNC_INTERVAL.getInteger();
        if (backupSyncCheckInterval <= 0) {
View Full Code Here

Examples of com.packtpub.java7.concurrency.chapter7.recipe05.task.MyScheduledThreadPoolExecutor.scheduleAtFixedRate()

   
    /*
     * Send to the executor a delayed task. It will begin its execution after 1 second of dealy
     * and then it will be executed every three seconds
     */
    executor.scheduleAtFixedRate(task, 1, 3, TimeUnit.SECONDS);
   
    /*
     * Sleep the thread during ten seconds
     */
    TimeUnit.SECONDS.sleep(10);
 
View Full Code Here

Examples of commonj.timers.TimerManager.scheduleAtFixedRate()

        if (scheduledTask.isOneTimeTask()) {
          timer = timerManager.schedule(scheduledTask.getTimerListener(), scheduledTask.getDelay());
        }
        else {
          if (scheduledTask.isFixedRate()) {
            timer = timerManager.scheduleAtFixedRate(
                scheduledTask.getTimerListener(), scheduledTask.getDelay(), scheduledTask.getPeriod());
          }
          else {
            timer = timerManager.schedule(
                scheduledTask.getTimerListener(), scheduledTask.getDelay(), scheduledTask.getPeriod());
View Full Code Here

Examples of io.netty.channel.EventLoop.scheduleAtFixedRate()

      this.handler = runnable;
      this.periodic = periodic;
      EventLoop el = context.getEventLoop();
      Runnable toRun = () -> context.runOnContext(this);
      if (periodic) {
        future = el.scheduleAtFixedRate(toRun, delay, delay, TimeUnit.MILLISECONDS);
      } else {
        future = el.schedule(toRun, delay, TimeUnit.MILLISECONDS);
      }
      metrics.timerCreated(timerID);
    }
View Full Code Here

Examples of io.netty.util.concurrent.EventExecutor.scheduleAtFixedRate()

    @SuppressWarnings( { "rawtypes", "unchecked" })
    private ChannelHandlerContext channelHandlerContext() {
        final ChannelHandlerContext ctx = mock(ChannelHandlerContext.class);
        final EventExecutor eventExecutor = mock(EventExecutor.class);
        final ScheduledFuture future = mock(ScheduledFuture.class);
        when(eventExecutor.scheduleAtFixedRate(any(Runnable.class), anyLong(), anyLong(), any(TimeUnit.class))).thenReturn(future);
        when(ctx.executor()).thenReturn(eventExecutor);
        when(ctx.pipeline()).thenReturn(mock(ChannelPipeline.class));
        return ctx;
    }
View Full Code Here

Examples of java.util.Timer.scheduleAtFixedRate()

        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;
    }

    public void stop() throws ServiceException {
View Full Code Here

Examples of java.util.Timer.scheduleAtFixedRate()

        return this.activeMembers;
    }

    public void startApplicationMembershipTimer(){
        Timer timer = new Timer();
        timer.scheduleAtFixedRate(new MemberActivatorTask(), 1000, 500);
    }

    /**
     * The task which checks whther inactive members have become available again
     */
 
View Full Code Here

Examples of java.util.Timer.scheduleAtFixedRate()

                lng.set(System.currentTimeMillis());
            }
        });

        final Timer timer = new Timer();
        timer.scheduleAtFixedRate(new TimerTask() {

            @Override
            public void run() {

                // Check how old the last event is. If it's too old, warn
View Full Code Here

Examples of java.util.Timer.scheduleAtFixedRate()

                listenerThread.start();

                Broadcaster broadcaster = new Broadcaster();

                Timer timer = new Timer("MulticastDiscovery: Broadcaster", true);
                timer.scheduleAtFixedRate(broadcaster, 0, heartRate);
            }
        } catch (Exception e) {
            throw new ServiceException(e);
        }
    }
View Full Code Here

Examples of java.util.Timer.scheduleAtFixedRate()

        };

        Timer result = new Timer(endpoint.getTimerName(), endpoint.isDaemon());
        if (endpoint.isFixedRate()) {
            if (endpoint.getTime() != null) {
                result.scheduleAtFixedRate(task, endpoint.getTime(), endpoint.getPeriod());
            } else {
                result.scheduleAtFixedRate(task, endpoint.getDelay(), endpoint.getPeriod());
            }
        } else {
            if (endpoint.getTime() != null) {
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.