protected void activate()

in src/main/java/org/apache/sling/xss/impl/XSSFilterImpl.java [287:301]


    protected void activate(ComponentContext componentContext, Configuration configuration) {
        // load default handler
        policyPath = configuration.policyPath();
        updateActivePolicy();
        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);
    }