org.apache.jetspeed.services.registry
Class DatabaseRegistryWatcher

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.apache.jetspeed.services.registry.DatabaseRegistryWatcher
All Implemented Interfaces:
java.lang.Runnable

public class DatabaseRegistryWatcher
extends java.lang.Thread

Registry watcher for Database Registry service. Keeps any cached registry entries refreshed with backend database.

Version:
$Id: DatabaseRegistryWatcher.java,v 1.2 2004/02/23 03:31:50 jford Exp $
Author:
Suchisubhra Sinha

Field Summary
static int SCAN_RATE
          Minimum scan rate for evaluating file refresh
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DatabaseRegistryWatcher()
          Creates a default RegistryWatcher
 
Method Summary
 void changeBase(java.util.Vector f)
          Change the base file to be monitored by this watcher
 long getRefreshRate()
           
 org.apache.jetspeed.services.registry.FileRegistry getSubscriber()
           
 void run()
          Main routine for the monitor which periodically checks whether the filex have been modified.
 void setDone()
          Mark that the watching thread should be stopped
 void setRefreshRate(long refresh)
          Sets the refresh rate for this watcher
 void setSubscriber(org.apache.jetspeed.services.registry.FileRegistry registry)
          Modifies the subscriber to this Watcher
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SCAN_RATE

public static final int SCAN_RATE
Minimum scan rate for evaluating file refresh

See Also:
Constant Field Values
Constructor Detail

DatabaseRegistryWatcher

public DatabaseRegistryWatcher()
Creates a default RegistryWatcher

Method Detail

setSubscriber

public void setSubscriber(org.apache.jetspeed.services.registry.FileRegistry registry)
Modifies the subscriber to this Watcher

Parameters:
registry - the new registry subscriber

getSubscriber

public org.apache.jetspeed.services.registry.FileRegistry getSubscriber()
Returns:
the subscriber to this watcher

setRefreshRate

public void setRefreshRate(long refresh)
Sets the refresh rate for this watcher

Parameters:
refresh - the refresh rate in seconds

getRefreshRate

public long getRefreshRate()
Returns:
the refresh rate, in seconds, of this watcher

changeBase

public void changeBase(java.util.Vector f)
Change the base file to be monitored by this watcher

Parameters:
f - the file to monitor

run

public void run()

Main routine for the monitor which periodically checks whether the filex have been modified.

The algorithm used does not guarantee a constant refresh rate between invocations.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

setDone

public void setDone()
Mark that the watching thread should be stopped



Copyright © 2000-2004 Apache Software Foundation. All Rights Reserved.