You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by do...@apache.org on 2003/04/08 11:47:27 UTC
cvs commit: avalon-phoenix/src/java/org/apache/avalon/phoenix/components/monitor DefaultDeploymentMonitor.java
donaldp 2003/04/08 02:47:27
Modified: src/java/org/apache/avalon/phoenix/components/monitor
DefaultDeploymentMonitor.java
Log:
Allow this block to have a configurable monitor frequency.
Revision Changes Path
1.4 +13 -3 avalon-phoenix/src/java/org/apache/avalon/phoenix/components/monitor/DefaultDeploymentMonitor.java
Index: DefaultDeploymentMonitor.java
===================================================================
RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/components/monitor/DefaultDeploymentMonitor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DefaultDeploymentMonitor.java 22 Mar 2003 12:07:11 -0000 1.3
+++ DefaultDeploymentMonitor.java 8 Apr 2003 09:47:27 -0000 1.4
@@ -70,6 +70,9 @@
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.service.Serviceable;
+import org.apache.avalon.framework.configuration.Configurable;
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.phoenix.interfaces.Deployer;
/**
@@ -82,7 +85,7 @@
*/
public class DefaultDeploymentMonitor
extends AbstractLogEnabled
- implements LogEnabled, Parameterizable, Serviceable, Startable, PropertyChangeListener
+ implements LogEnabled, Parameterizable, Configurable, Serviceable, Startable, PropertyChangeListener
{
private final static Resources REZ =
ResourceManager.getPackageResources( DefaultDeploymentMonitor.class );
@@ -90,6 +93,7 @@
private String m_appsDir;
private ActiveMonitor m_monitor;
private Deployer m_deployer;
+ private long m_frequency;
/**
* requires parameter "phoenix.apps.dir" to be set to directory
@@ -101,6 +105,12 @@
m_appsDir = parameters.getParameter( "phoenix.apps.dir" );
}
+ public void configure( Configuration configuration )
+ throws ConfigurationException
+ {
+ m_frequency = configuration.getChild("monitor-frequency").getValueAsLong( 1000L );
+ }
+
/**
* Aquire Deployer service for dpeloyment
*/
@@ -120,7 +130,7 @@
new DirectoryResource( m_appsDir );
resource.addPropertyChangeListener( this );
m_monitor = new ActiveMonitor();
- m_monitor.setFrequency( 1000L );
+ m_monitor.setFrequency( m_frequency );
m_monitor.addResource( resource );
m_monitor.start();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org