donaldp 2002/09/07 17:02:45
Modified: monitor/src/java/org/apache/avalon/excalibur/monitor/impl
AbstractMonitor.java ActiveMonitor.java
Log:
Move scanning method into base class
Revision Changes Path
1.4 +14 -1
jakarta-avalon-excalibur/monitor/src/java/org/apache/avalon/excalibur/monitor/impl/AbstractMonitor.java
Index: AbstractMonitor.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/monitor/src/java/org/apache/avalon/excalibur/monitor/impl/AbstractMonitor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AbstractMonitor.java 7 Sep 2002 12:14:02 -0000 1.3
+++ AbstractMonitor.java 8 Sep 2002 00:02:45 -0000 1.4
@@ -107,4 +107,17 @@
final Collection collection = m_resources.values();
return (Resource[])collection.toArray( new Resource[ collection.size() ] );
}
+
+ /**
+ * Scan through all resources to determine if they have changed.
+ */
+ protected void scanAllResources()
+ {
+ final long currentTestTime = System.currentTimeMillis();
+ final Resource[] resources = getResources();
+ for( int i = 0; i < resources.length; i++ )
+ {
+ resources[ i ].testModifiedAfter( currentTestTime );
+ }
+ }
}
1.3 +2 -8
jakarta-avalon-excalibur/monitor/src/java/org/apache/avalon/excalibur/monitor/impl/ActiveMonitor.java
Index: ActiveMonitor.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/monitor/src/java/org/apache/avalon/excalibur/monitor/impl/ActiveMonitor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ActiveMonitor.java 7 Sep 2002 12:14:02 -0000 1.2
+++ ActiveMonitor.java 8 Sep 2002 00:02:45 -0000 1.3
@@ -7,8 +7,6 @@
*/
package org.apache.avalon.excalibur.monitor.impl;
-import org.apache.avalon.excalibur.monitor.Resource;
-
/**
* The ActiveMonitor is used to actively check a set of resources to see if they
have
* changed. It will poll the resources with a frequency as specified or if
@@ -97,11 +95,7 @@
delay( sleepTillTime - currentTestTime );
}
- final Resource[] resources = getResources();
- for( int i = 0; i < resources.length; i++ )
- {
- resources[ i ].testModifiedAfter( currentTestTime );
- }
+ scanAllResources();
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>