public class InitDelayingTopologyEventListener extends Object implements org.apache.sling.discovery.TopologyEventListener
What happens aFter the startup time depends on what was received during the delay:
Constructor and Description |
---|
InitDelayingTopologyEventListener(long startupDelay,
org.apache.sling.discovery.TopologyEventListener delegate)
Creates a new init-delaying listener with the given delay, delegate and scheduler.
|
InitDelayingTopologyEventListener(long startupDelay,
org.apache.sling.discovery.TopologyEventListener delegate,
org.slf4j.Logger loggerOrNull)
Creates a new init-delaying listener with the given delay, delegate, scheduler and optinoal logger.
|
InitDelayingTopologyEventListener(long startupDelay,
org.apache.sling.discovery.TopologyEventListener delegate,
org.apache.sling.commons.scheduler.Scheduler scheduler)
Deprecated.
|
InitDelayingTopologyEventListener(long startupDelay,
org.apache.sling.discovery.TopologyEventListener delegate,
org.apache.sling.commons.scheduler.Scheduler scheduler,
org.slf4j.Logger loggerOrNull)
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Marks this listener as no longer active - ensures that it doesn't call the delegate
via any potentially pending scheduler callback.
|
void |
handleTopologyEvent(org.apache.sling.discovery.TopologyEvent event) |
public InitDelayingTopologyEventListener(long startupDelay, org.apache.sling.discovery.TopologyEventListener delegate)
For properly disposing the caller should use the dispose method!
startupDelay
- The startup delay in secondsdelegate
- The topology event listenerdispose()
public InitDelayingTopologyEventListener(long startupDelay, org.apache.sling.discovery.TopologyEventListener delegate, org.slf4j.Logger loggerOrNull)
For properly disposing the caller should use the dispose method!
startupDelay
- The startup delay in secondsdelegate
- The topology event listenerloggerOrNull
- Optional logger instancedispose()
@Deprecated public InitDelayingTopologyEventListener(long startupDelay, org.apache.sling.discovery.TopologyEventListener delegate, org.apache.sling.commons.scheduler.Scheduler scheduler)
InitDelayingTopologyEventListener(long, TopologyEventListener)
For properly disposing the caller should use the dispose method!
startupDelay
- The startup delay in secondsdelegate
- The topology event listenerscheduler
- Scheduler to schedule the delay (not used)dispose()
@Deprecated public InitDelayingTopologyEventListener(long startupDelay, org.apache.sling.discovery.TopologyEventListener delegate, org.apache.sling.commons.scheduler.Scheduler scheduler, org.slf4j.Logger loggerOrNull)
For properly disposing the caller should use the dispose method!
startupDelay
- The startup delay in secondsdelegate
- The topology event listenerscheduler
- Scheduler to schedule the delay (not used)loggerOrNull
- Optional logger instancedispose()
public void handleTopologyEvent(org.apache.sling.discovery.TopologyEvent event)
handleTopologyEvent
in interface org.apache.sling.discovery.TopologyEventListener
public void dispose()
Note that after dispose you can *still* call handleTopologyEvent and the events are passed to the delegate - but those are expected to be 'late' events and not really part of the normal game. Hence, the caller must also ensure that the handleTopologyEvent method isn't called anymore (which typically is automatically guaranteed since the caller is typically an osgi service that gets unregistered anyway)
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.