public void initialize()

in src/main/java/org/apache/sling/discovery/oak/pinger/OakViewChecker.java [163:201]


    public void initialize(final OakDiscoveryService discoveryService) {
        logger.info("initialize: initializing.");
        synchronized(lock) {
        	this.discoveryService = discoveryService;
            issueHeartbeat();
        }

        // start the (less frequent) periodic job that does the
        // connector pings and checks the connector/topology view
        try {
            final long interval = config.getConnectorPingInterval();
            logger.info("initialize: starting periodic connectorPing job for "+slingId+" with interval "+interval+" sec.");
            periodicPingJob = new PeriodicBackgroundJob(interval, NAME+".connectorPinger", this);
        } catch (Exception e) {
            logger.error("activate: Could not start heartbeat runner: " + e, e);
        }

        // start the (more frequent) periodic job that checks
        // the discoveryLite descriptor - that can be more frequent
        // since it is only reading an oak repository descriptor
        // which is designed to be read very frequently (it caches
        // the value and only updates it on change, so reading is very cheap)
        // and because doing this more frequently means that the
        // reaction time is faster
        try{
            final long interval = config.getDiscoveryLiteCheckInterval();
            logger.info("initialize: starting periodic discoveryLiteCheck job for "+slingId+" with interval "+interval+" sec.");
            periodicCheckViewJob = new PeriodicBackgroundJob(interval, NAME+".discoveryLiteCheck", new Runnable() {

                @Override
                public void run() {
                    discoveryLiteCheck();
                }

            });
        } catch (Exception e) {
            logger.error("activate: Could not start heartbeat runner: " + e, e);
        }
    }