protected void activate()

in src/main/java/org/apache/sling/xss/impl/XSSFilterImpl.java [263:277]


    protected void activate(ComponentContext componentContext, Configuration configuration) {
        invalidHrefs = metricsService.counter(COUNTER_INVALID_HREFS);
        // load default handler
        policyPath = configuration.policyPath();
        updatePolicy();
        if (serviceRegistration != null) {
            serviceRegistration.unregister();
        }
        Dictionary<String, Object> rclProperties = new Hashtable<>();
        rclProperties.put(ResourceChangeListener.CHANGES, new String[]{"ADDED", "CHANGED", "REMOVED"});
        rclProperties.put(ResourceChangeListener.PATHS, policyPath);
        serviceRegistration = componentContext.getBundleContext()
                .registerService(ResourceChangeListener.class, new PolicyChangeListener(), rclProperties);
        logger.info("Registered a resource change listener for file {}.", policyPath);
    }