// Path: jashing/src/main/java/com/github/avarabyeu/jashing/core/eventsource/ScheduledEventSource.java
// public abstract class ScheduledEventSource<T extends JashingEvent> extends AbstractScheduledService {
// 
//     private static final Logger LOGGER = LoggerFactory.getLogger(ScheduledEventSource.class);
// 
//     /**
//      * Time period between sending events
//      */
//     @Frequency
//     @Inject
//     private Duration period;
// 
//     /**
//      * ID of event this event source bound to
//      */
//     @EventId
//     @Inject
//     private String eventId;
// 
//     /**
//      * EventBus to send events
//      */
//     @Inject
//     private EventBus eventBus;
// 
// 
//     /**
//      * Executes one iteration of {@link com.google.common.util.concurrent.AbstractScheduledService}
//      * Sends event to event bus
//      *
//      * @throws Exception
//      */
//     @Override
//     protected final void runOneIteration() throws Exception {
//         try {
//             sendEvent(produceEvent());
//         } catch (Exception e){
//             LOGGER.error(MessageFormatter.format("Cannot produce event with id {}", eventId).getMessage(), e);
//         }
// 
//     }
// 
// 
//     protected final void sendEvent(JashingEvent t) {
//         if (null != t) {
//             if (isNull(t.getId())) t.setId(eventId);
//             this.eventBus.post(t);
//         }
//     }
// 
//     @Override
//     protected final Scheduler scheduler() {
//         return AbstractScheduledService.Scheduler.newFixedDelaySchedule(3, period.toMillis(), TimeUnit.MILLISECONDS);
//     }
// 
//     @Override
//     protected final String serviceName() {
//         return "ScheduledEventSource[eventID=" + eventId + "]";
//     }
// 
//     protected abstract T produceEvent();
// }
// 
// Path: jashing/src/main/java/com/github/avarabyeu/jashing/events/NumberEvent.java
// public class NumberEvent extends JashingEvent {
// 
//     private final int current;
//     private final int last;
// 
//     public NumberEvent(int current, int last) {
//         this.current = current;
//         this.last = last;
//     }
// 
//     public int getCurrent() {
//         return current;
//     }
// 
//     public int getLast() {
//         return last;
//     }
// }


import com.github.avarabyeu.jashing.core.EventSource;
import com.github.avarabyeu.jashing.core.eventsource.ScheduledEventSource;
import com.github.avarabyeu.jashing.events.NumberEvent;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import javax.inject.Inject;
import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.concurrent.TimeUnit;
package com.github.avarabyeu.jashing.integration.vcs;



/**
 * @author Andrey Vorobyov
 */
@EventSource(value = "vcs-commits-progress-source", explicitConfiguration = AbstractVcsModule.class)
public class VCSCommitsProgressEventSource extends ScheduledEventSource<NumberEvent> {

// Path: jashing/src/main/java/com/github/avarabyeu/jashing/core/eventsource/ScheduledEventSource.java
// public abstract class ScheduledEventSource<T extends JashingEvent> extends AbstractScheduledService {
// 
//     private static final Logger LOGGER = LoggerFactory.getLogger(ScheduledEventSource.class);
// 
//     /**
//      * Time period between sending events
//      */
//     @Frequency
//     @Inject
//     private Duration period;
// 
//     /**
//      * ID of event this event source bound to
//      */
//     @EventId
//     @Inject
//     private String eventId;
// 
//     /**
//      * EventBus to send events
//      */
//     @Inject
//     private EventBus eventBus;
// 
// 
//     /**
//      * Executes one iteration of {@link com.google.common.util.concurrent.AbstractScheduledService}
//      * Sends event to event bus
//      *
//      * @throws Exception
//      */
//     @Override
//     protected final void runOneIteration() throws Exception {
//         try {
//             sendEvent(produceEvent());
//         } catch (Exception e){
//             LOGGER.error(MessageFormatter.format("Cannot produce event with id {}", eventId).getMessage(), e);
//         }
// 
//     }
// 
// 
//     protected final void sendEvent(JashingEvent t) {
//         if (null != t) {
//             if (isNull(t.getId())) t.setId(eventId);
//             this.eventBus.post(t);
//         }
//     }
// 
//     @Override
//     protected final Scheduler scheduler() {
//         return AbstractScheduledService.Scheduler.newFixedDelaySchedule(3, period.toMillis(), TimeUnit.MILLISECONDS);
//     }
// 
//     @Override
//     protected final String serviceName() {
//         return "ScheduledEventSource[eventID=" + eventId + "]";
//     }
// 
//     protected abstract T produceEvent();
// }
// 
// Path: jashing/src/main/java/com/github/avarabyeu/jashing/events/NumberEvent.java
// public class NumberEvent extends JashingEvent {
// 
//     private final int current;
//     private final int last;
// 
//     public NumberEvent(int current, int last) {
//         this.current = current;
//         this.last = last;
//     }
// 
//     public int getCurrent() {
//         return current;
//     }
// 
//     public int getLast() {
//         return last;
//     }
// }


// Path: extensions/jashing-cvs/src/main/java/com/github/avarabyeu/jashing/integration/vcs/VCSCommitsProgressEventSource.java
import com.github.avarabyeu.jashing.core.EventSource;
import com.github.avarabyeu.jashing.core.eventsource.ScheduledEventSource;
import com.github.avarabyeu.jashing.events.NumberEvent;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import javax.inject.Inject;
import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.concurrent.TimeUnit;

package com.github.avarabyeu.jashing.integration.vcs;



/**
 * @author Andrey Vorobyov
 */
@EventSource(value = "vcs-commits-progress-source", explicitConfiguration = AbstractVcsModule.class)
public class VCSCommitsProgressEventSource extends ScheduledEventSource<NumberEvent> {

    @Inject