Code example for ScheduledExecutorService

Methods: scheduleAtFixedRate

0
    static final Logger log = Logger.getLogger(FirstGroupByPerTimeOutputRateManager.class);
 
 
    public FirstGroupByPerTimeOutputRateManager(Long value, ScheduledExecutorService scheduledExecutorService) {
        this.value = value;
        scheduledExecutorService.scheduleAtFixedRate(new EventReSeter(), 0, value.longValue(), TimeUnit.MILLISECONDS);
    } 
 
    @Override 
    public synchronized void send(long timeStamp, StreamEvent currentEvent, StreamEvent expiredEvent, String groupByKey) {
 
        if (currentEvent != null) {
            if (currentEvent instanceof ListEvent) {
                for (int i = 0, size = ((ListEvent) currentEvent).getActiveEvents(); i < size; i++) {
                    if (!groupByKeys.contains(groupByKey)) {
                        groupByKeys.add(groupByKey);
                        StreamEvent event = ((ListEvent) currentEvent).getEvent(i);
                        sendToCallBacks(timeStamp, event, null, event);
                    } 
                } 
            } else {