Package com.day.cq.commons.jcr
Class JcrObservationThrottle
- java.lang.Object
-
- com.day.cq.commons.jcr.JcrObservationThrottle
-
- All Implemented Interfaces:
javax.jcr.observation.EventListener
@Deprecated public class JcrObservationThrottle extends java.lang.Object implements javax.jcr.observation.EventListenerDeprecated.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
Constructors Constructor Description JcrObservationThrottle(javax.jcr.Node tempNodeFolder)Deprecated.Create a JcrObservationThrottle
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Deprecated.MUST be called to clean up, DELETES the temp folder node that was passed to constructorvoidonEvent(javax.jcr.observation.EventIterator events)Deprecated.voidopen()Deprecated.Setup temporary node to detect events, must be called before {link #waitForEvents}longwaitForEvents()Deprecated.Block until all pending observation events have been delivered.
-
-
-
Method Detail
-
open
public void open() throws javax.jcr.RepositoryExceptionDeprecated.Setup temporary node to detect events, must be called before {link #waitForEvents}- Throws:
javax.jcr.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
public void onEvent(javax.jcr.observation.EventIterator events)
Deprecated.- Specified by:
onEventin interfacejavax.jcr.observation.EventListener
-
waitForEvents
public long waitForEvents() throws javax.jcr.RepositoryExceptionDeprecated.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:
javax.jcr.RepositoryException- if some error occurs
-
-