org.apache.avalon.excalibur.monitor
Class PassiveMonitor

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.avalon.excalibur.monitor.PassiveMonitor
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.Loggable, Monitor, org.apache.avalon.framework.thread.ThreadSafe

public final class PassiveMonitor
extends org.apache.avalon.framework.logger.AbstractLoggable
implements Monitor, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.thread.ThreadSafe, org.apache.avalon.framework.configuration.Configurable

The PassiveMonitor is used to passively check a set of resources to see if they have changed. It will be implemented as a Component, that can be retrieved from the ComponentManager. It defaults to checking every 1 minute. The configuration looks like this:

   <monitor>
     <init-resources>
       <-- This entry can be repeated for every resource you want to register immediately -->

       <resource key="file:./myfile.html" class="org.apache.avalon.excalibur.monitor.FileMonitor"/>
     </init-resources>
   </monitor>
 

Version:
$Id: PassiveMonitor.java,v 1.3 2001/12/11 09:53:30 jefft Exp $
Author:
Berin Loritsch

Fields inherited from interface org.apache.avalon.excalibur.monitor.Monitor
ROLE
 
Constructor Summary
PassiveMonitor()
           
 
Method Summary
 void addResource(Resource resource)
          Add a resource to monitor.
 void configure(org.apache.avalon.framework.configuration.Configuration conf)
           
 Resource getResource(java.lang.String key)
          Find a monitored resource.
 void removeResource(Resource resource)
          Remove a monitored resource by reference.
 void removeResource(java.lang.String key)
          Remove a monitored resource by key.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PassiveMonitor

public PassiveMonitor()
Method Detail

configure

public final void configure(org.apache.avalon.framework.configuration.Configuration conf)
                     throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable

addResource

public final void addResource(Resource resource)
Add a resource to monitor. The resource key referenced in the other interfaces is derived from the resource object.
Specified by:
addResource in interface Monitor

getResource

public final Resource getResource(java.lang.String key)
Find a monitored resource. If no resource is available, return null
Specified by:
getResource in interface Monitor

removeResource

public final void removeResource(java.lang.String key)
Remove a monitored resource by key.
Specified by:
removeResource in interface Monitor

removeResource

public final void removeResource(Resource resource)
Remove a monitored resource by reference.
Specified by:
removeResource in interface Monitor


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.