Class TopologyHandler
java.lang.Object
org.apache.sling.event.impl.jobs.config.TopologyHandler
- All Implemented Interfaces:
Runnable,TopologyEventListener
This topology handler is handling the topology change events asynchronously
and processes them by queuing them.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classWe need a holder class to be able to put something into the queue to stop it. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactivate()protected voidvoidhandleTopologyEvent(TopologyEvent event) Inform the service about an event in the topology - or in the discovery of the topology.voidrun()
-
Constructor Details
-
TopologyHandler
public TopologyHandler()
-
-
Method Details
-
activate
protected void activate() -
deactivate
protected void deactivate() -
handleTopologyEvent
Description copied from interface:TopologyEventListenerInform the service about an event in the topology - or in the discovery of the topology.Implementors of this method must ensure that this method returns quickly and that no locks are being acquired that could cause deadlocks (ie the framework might call this method holding locks).
The
TopologyEventcontains details about what changed. The supported event types are:TOPOLOGY_INITsent when theTopologyEventListenerwas first bound to the discovery service - represents the initial state of the topology at that time.TOPOLOGY_CHANGINGsent when the discovery service discovered a change in the topology and has started to settle the change. This event is sent beforeTOPOLOGY_CHANGEDbut is optionalTOPOLOGY_CHANGEDsent when the discovery service discovered a change in the topology and has settled it.PROPERTIES_CHANGEDsent when the one or many properties have changed in an instance in the current topology
- Specified by:
handleTopologyEventin interfaceTopologyEventListener- Parameters:
event- The topology event
-
run
public void run()
-