Package com.day.cq.commons.jcr
Class JcrObservationThrottle
java.lang.Object
com.day.cq.commons.jcr.JcrObservationThrottle
- All Implemented Interfaces:
EventListener
Deprecated.
This was written for CRX single-threaded observation
semantics but does not work with Oak which uses multiple threads
for observation.
Used to wait until all queued observation events
have been delivered, useful to throttle down
operations that modify lots of nodes.
-
Constructor Summary
ConstructorsConstructorDescriptionJcrObservationThrottle
(Node tempNodeFolder) Deprecated.Create a JcrObservationThrottle -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Deprecated.MUST be called to clean up, DELETES the temp folder node that was passed to constructorvoid
onEvent
(EventIterator events) Deprecated.This method is called when a bundle of events is dispatched.void
open()
Deprecated.Setup temporary node to detect events, must be called before {link #waitForEvents}long
Deprecated.Block until all pending observation events have been delivered.
-
Constructor Details
-
JcrObservationThrottle
Deprecated.Create a JcrObservationThrottle- Parameters:
tempNodeFolder
- a node with a unique name is created in that folder to detect observation events.
-
-
Method Details
-
open
Deprecated.Setup temporary node to detect events, must be called before {link #waitForEvents}- Throws:
RepositoryException
- if some error occurs
-
close
public void close()Deprecated.MUST be called to clean up, DELETES the temp folder node that was passed to constructor -
onEvent
Deprecated.Description copied from interface:EventListener
This method is called when a bundle of events is dispatched.- Specified by:
onEvent
in interfaceEventListener
- Parameters:
events
- The event set received.
-
waitForEvents
Deprecated.Block until all pending observation events have been delivered. As JCR events are delivered in order of their creation, simply creates a new temp node and waits for the corresponding event to be delivered. Note that the Session of the temporary folder node passed to the constructor is saved by this method, in order to create temporary nodes and detect their observation events.- Returns:
- the elapsed time in msec for this method call.
- Throws:
RepositoryException
- if some error occurs
-