void doHandleTopologyEvent()

in src/main/java/org/apache/sling/event/impl/jobs/config/JobManagerConfiguration.java [589:617]


    void doHandleTopologyEvent(final TopologyEvent event) {

        // check if there is a change of properties which doesn't affect us
        // but we need to use the new view !
        boolean stopProcessing = true;
        if ( event.getType() == Type.PROPERTIES_CHANGED ) {
            final Map<String, String> newAllInstances = TopologyCapabilities.getAllInstancesMap(event.getNewView());
            if ( this.topologyCapabilities != null && this.topologyCapabilities.isSame(newAllInstances) ) {
                logger.debug("No changes in capabilities - updating topology capabilities with new view");
                stopProcessing = false;
            }
        }

        final TopologyEvent.Type eventType = event.getType();

        if ( eventType == Type.TOPOLOGY_CHANGING ) {
           this.stopProcessing();

        } else if ( eventType == Type.TOPOLOGY_INIT
            || event.getType() == Type.TOPOLOGY_CHANGED
            || event.getType() == Type.PROPERTIES_CHANGED ) {

            if ( stopProcessing ) {
                this.stopProcessing();
            }

            this.startProcessing(eventType, new TopologyCapabilities(event.getNewView(), this));
        }
    }