org.apache.shale.clay.config.beans
Class ComponentConfigBean.WatchDog

java.lang.Object
  extended by org.apache.shale.clay.config.beans.ComponentConfigBean.WatchDog
Enclosing class:
ComponentConfigBean

protected class ComponentConfigBean.WatchDog
extends Object

This inner class watches for changes in a array of ConfigBean.ConfigDefinition's. This collection defines the configuration files that the Clay component uses.


Constructor Summary
ComponentConfigBean.WatchDog(ConfigBean.ConfigDefinition[] configDefs, String name)
          Overloaded constructor that is passed the configuration file definitions as a parameter.
 
Method Summary
 void destroy()
          This method is invoked to dereference the private array of config file definitions.
 String getName()
          Returns the name of the resource watcher.
 boolean refresh(boolean forceReload)
          This method is the watch dog timmer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentConfigBean.WatchDog

public ComponentConfigBean.WatchDog(ConfigBean.ConfigDefinition[] configDefs,
                                    String name)

Overloaded constructor that is passed the configuration file definitions as a parameter. The name associated with the resource watcher is also passed as a parameter.

Parameters:
configDefs - files in the watch group
name - the watch group name
Method Detail

getName

public String getName()

Returns the name of the resource watcher.

Returns:
the watched resource

destroy

public void destroy()

This method is invoked to dereference the private array of config file definitions.


refresh

public boolean refresh(boolean forceReload)

This method is the watch dog timmer. It's invoked to determine if any of the files have changed since the last time they were loaded. If a change has occured on any of the configDefs or the forceReload param is true, all the files are reloaded and the last modified date is reset in the ConfigBean.ConfigDefinition. A true value is returned if the files were refreshed.

Parameters:
forceReload - reload the group of config files
Returns:
true if the group was reloaded


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