org.apache.jackrabbit.core.observation
Class ObservationDispatcher

java.lang.Object
  extended by org.apache.jackrabbit.core.observation.ObservationDispatcher
All Implemented Interfaces:
Runnable

public final class ObservationDispatcher
extends Object
implements Runnable

Dispatcher for dispatching events to listeners within a single workspace.


Constructor Summary
ObservationDispatcher()
          Creates a new ObservationDispatcher instance and starts the notification thread daemon.
 
Method Summary
 void delayIfEventQueueOverloaded()
          Checks if the observation event queue contains more than the configured maximum number of events, and delays the current thread in such cases.
 void dispose()
          Disposes this ObservationManager.
 void run()
          Implements the run method of the background notification thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObservationDispatcher

public ObservationDispatcher()
Creates a new ObservationDispatcher instance and starts the notification thread daemon.

Method Detail

dispose

public void dispose()
Disposes this ObservationManager. This will effectively stop the background notification thread.


run

public void run()
Implements the run method of the background notification thread.

Specified by:
run in interface Runnable

delayIfEventQueueOverloaded

public void delayIfEventQueueOverloaded()
Checks if the observation event queue contains more than the configured maximum number of events, and delays the current thread in such cases. No delay is added if the current thread is the observation thread, for example if an observation listener writes to the repository.

This method should only be called outside the scope of internal repository access locks.



Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.