dain 2003/09/04 22:52:10
Modified: modules/core/src/java/org/apache/geronimo/deployment/scanner
DeploymentScanner.java
Log:
Fixed formatting.
Added debug messsage to show which URLs are being watched.
Revision Changes Path
1.16 +17 -20
incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/scanner/DeploymentScanner.java
Index: DeploymentScanner.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/scanner/DeploymentScanner.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- DeploymentScanner.java 3 Sep 2003 13:50:29 -0000 1.15
+++ DeploymentScanner.java 5 Sep 2003 05:52:10 -0000 1.16
@@ -89,10 +89,7 @@
*
* @version $Revision$ $Date$
*/
-public class DeploymentScanner
- extends AbstractManagedObject
- implements DeploymentScannerMBean
-{
+public class DeploymentScanner extends AbstractManagedObject implements
DeploymentScannerMBean {
private static final Log log =
LogFactory.getLog(DeploymentScanner.class);
private RelationServiceMBean relationService;
@@ -106,43 +103,42 @@
*/
public DeploymentScanner() {
}
-
+
/**
* @jmx:managed-constructor
*/
- public DeploymentScanner(final URL[] urls, final boolean recurse)
- {
- for (int i=0; i<urls.length; i++ ) {
+ public DeploymentScanner(final URL[] urls, final boolean recurse) {
+ for (int i = 0; i < urls.length; i++) {
addURL(urls[i], recurse);
}
}
-
+
public ObjectName preRegister(MBeanServer server, ObjectName objectName)
throws Exception {
relationService = JMXUtil.getRelationService(server);
return super.preRegister(server, objectName);
}
-
+
/**
* @jmx:managed-attribute
*/
public synchronized long getScanInterval() {
return scanInterval;
}
-
+
/**
* @jmx:managed-attribute
*/
public synchronized void setScanInterval(long scanInterval) {
this.scanInterval = scanInterval;
}
-
+
/**
* @jmx:managed-attribute
*/
public synchronized Set getWatchedURLs() {
return Collections.unmodifiableSet(new HashSet(scanners.keySet()));
}
-
+
/**
* @jmx:managed-operation
*/
@@ -152,17 +148,18 @@
//
addURL(URLFactory.create(url), recurse);
}
-
+
/**
* @jmx:managed-operation
*/
public synchronized void addURL(URL url, boolean recurse) {
if (!scanners.containsKey(url)) {
+ log.debug("Watching URL: " + url);
Scanner scanner = getScannerForURL(url, recurse);
scanners.put(url, scanner);
}
}
-
+
private Scanner getScannerForURL(URL url, boolean recurse) {
String protocol = url.getProtocol();
if ("file".equals(protocol)) {
@@ -173,7 +170,7 @@
throw new IllegalArgumentException("Unknown protocol " +
protocol);
}
}
-
+
/**
* @jmx:managed-operation
*/
@@ -183,14 +180,14 @@
//
removeURL(URLFactory.create(url));
}
-
+
/**
* @jmx:managed-operation
*/
public synchronized void removeURL(URL url) {
scanners.remove(url);
}
-
+
private synchronized boolean shouldScannerThreadRun() {
return run;
}
@@ -220,7 +217,7 @@
scanThread = null;
}
}
-
+
/**
* @jmx:managed-operation
*/