void onStart()

in geronimo-microprofile-reporter/src/main/java/org/apache/geronimo/microprofile/reporter/storage/plugins/Poller.java [48:67]


    void onStart(@Observes @Initialized(ApplicationScoped.class) final Object start,
                 @ConfigProperty(name = "geronimo.microprofile.reporter.polling.interval", defaultValue = "5000") final Long pollingInterval) {
        if (pollingInterval <= 0) {
            return;
        }

        final ClassLoader appLoader = Thread.currentThread().getContextClassLoader();
        scheduler = Executors.newSingleThreadScheduledExecutor(r -> {
            final Thread thread = new Thread(r, "geronimo-microprofile-reporter-poller-" + name(start));
            thread.setContextClassLoader(appLoader);
            if (thread.isDaemon()) {
                thread.setDaemon(false);
            }
            if (thread.getPriority() != NORM_PRIORITY) {
                thread.setPriority(NORM_PRIORITY);
            }
            return thread;
        });
        pollFuture = scheduler.scheduleAtFixedRate(() -> tickEvent.fire(TICK), pollingInterval, pollingInterval, MILLISECONDS);
    }