commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcu...@apache.org
Subject svn commit: r231541 - in /jakarta/commons/sandbox/jci/trunk/src: java/org/apache/commons/jci/ java/org/apache/commons/jci/listeners/ java/org/apache/commons/jci/monitor/ test/org/apache/commons/jci/ test/org/apache/commons/jci/monitor/
Date Thu, 11 Aug 2005 23:39:47 GMT
Author: tcurdt
Date: Thu Aug 11 16:39:34 2005
New Revision: 231541

URL: http://svn.apache.org/viewcvs?rev=231541&view=rev
Log:
separate class loading from monitoring


Added:
    jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/ReloadingClassLoaderListener.java
      - copied, changed from r231504, jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/ReloadingListener.java
    jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/listeners/
    jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/listeners/CompilingListener.java
    jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/listeners/ReloadingListener.java
Removed:
    jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/ReloadingListener.java
Modified:
    jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/CompilingClassLoader.java
    jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/ReloadingClassLoader.java
    jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/monitor/FilesystemAlterationListener.java
    jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.java
    jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/CompilingClassLoaderTestCase.java
    jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/monitor/FilesystemAlterationMonitorTestCase.java

Modified: jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/CompilingClassLoader.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/CompilingClassLoader.java?rev=231541&r1=231540&r2=231541&view=diff
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/CompilingClassLoader.java
(original)
+++ jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/CompilingClassLoader.java
Thu Aug 11 16:39:34 2005
@@ -16,13 +16,10 @@
 package org.apache.commons.jci;
 
 import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
 import org.apache.commons.jci.compilers.JavaCompiler;
 import org.apache.commons.jci.compilers.eclipse.EclipseJavaCompiler;
-import org.apache.commons.jci.monitor.FilesystemAlterationListener;
-import org.apache.commons.jci.problems.ConsoleCompilationProblemHandler;
+import org.apache.commons.jci.listeners.CompilingListener;
+import org.apache.commons.jci.monitor.FilesystemAlterationMonitor;
 import org.apache.commons.jci.stores.MemoryResourceStore;
 import org.apache.commons.jci.stores.TransactionalResourceStore;
 import org.apache.commons.logging.Log;
@@ -61,105 +58,16 @@
         compiler = pCompiler;                
     }
 
-    protected FilesystemAlterationListener createListener( final File pRepository ) {
-
-        return new FilesystemAlterationListener() {
-            private final Collection created = new ArrayList();
-            private final Collection changed = new ArrayList();
-            private final Collection deleted = new ArrayList();
-            
-            public void onStart() {
-                created.clear();
-                changed.clear();
-                deleted.clear();
-                transactionalStore.onStart();
-            }
-            public void onStop() {
-                log.debug("resources " +
-                        created.size() + " created, " + 
-                        changed.size() + " changed, " + 
-                        deleted.size() + " deleted");
-    
-                boolean reload = false;
-                
-                if (deleted.size() > 0) {
-                    for (Iterator it = deleted.iterator(); it.hasNext();) {
-                        final File file = (File) it.next();
-                        transactionalStore.remove(clazzName(repository, file));
-                    }
-                    reload = true;
-                }
-                                
-                final Collection compileables = new ArrayList();
-                compileables.addAll(created);
-                compileables.addAll(changed);
-    
-                final String[] clazzes = new String[compileables.size()];
-                
-                if (compileables.size() > 0) {
-                    
-                    int i = 0;
-                    for (Iterator it = compileables.iterator(); it.hasNext();) {
-                        final File file = (File) it.next();
-                        clazzes[i] = clazzName(repository,file);
-                        //log.debug(clazzes[i]);
-                        i++;
-                    }
-                    
-                    final ConsoleCompilationProblemHandler problemHandler = new ConsoleCompilationProblemHandler();
-    
-                    compiler.compile(
-                            clazzes,
-                            reader,
-                            transactionalStore,
-                            problemHandler
-                            );
-                    
-                    
-                    log.debug(
-                            problemHandler.getErrorCount() + " errors, " +
-                            problemHandler.getWarningCount() + " warnings"
-                            );
-                
-                    if (problemHandler.getErrorCount() > 0) {
-                        for (int j = 0; j < clazzes.length; j++) {
-                            transactionalStore.remove(clazzes[j]);
-                        }
-                    }
-                    
-                    reload = true;                    
-    
-                }
-    
-                transactionalStore.onStop();
-    
-                if (reload) {
-                    reload();
-                }                
-            }
-    
-            public void onCreateFile( final File file ) {
-                if (file.getName().endsWith(".java")) {
-                    created.add(file);
-                }
-            }
-            public void onChangeFile( final File file ) {                
-                if (file.getName().endsWith(".java")) {
-                    changed.add(file);
-                }
-            }
-            public void onDeleteFile( final File file ) {
-                if (file.getName().endsWith(".java")) {
-                    deleted.add(file);
-                }
-            }
-    
-            public void onCreateDirectory( final File file ) {                
-            }
-            public void onChangeDirectory( final File file ) {                
-            }
-            public void onDeleteDirectory( final File file ) {
-            }
-        };
+    public void start() {
+        fam = new FilesystemAlterationMonitor(); 
+        fam.addListener(new CompilingListener(reader,compiler,transactionalStore) {
+            public void reload() {
+                CompilingClassLoader.this.reload();
+            }
+        }, repository);
+        thread = new Thread(fam);         
+        thread.start();
+        reload();        
+        
     }
 }

Modified: jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/ReloadingClassLoader.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/ReloadingClassLoader.java?rev=231541&r1=231540&r2=231541&view=diff
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/ReloadingClassLoader.java
(original)
+++ jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/ReloadingClassLoader.java
Thu Aug 11 16:39:34 2005
@@ -16,15 +16,12 @@
 package org.apache.commons.jci;
 
 import java.io.File;
-import java.io.FileReader;
 import java.io.InputStream;
 import java.net.URL;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.jci.monitor.FilesystemAlterationListener;
+import org.apache.commons.jci.listeners.ReloadingListener;
 import org.apache.commons.jci.monitor.FilesystemAlterationMonitor;
 import org.apache.commons.jci.readers.FileResourceReader;
 import org.apache.commons.jci.readers.ResourceReader;
@@ -44,14 +41,15 @@
     
     private final ClassLoader parent;
     private final ResourceStore store;
-    private final FilesystemAlterationMonitor fam;
     private final Collection reloadingListeners = new HashSet();
-    private Thread thread;
+
     private ClassLoader delegate;
 
     protected final ResourceReader reader;
     protected final File repository;
 
+    protected FilesystemAlterationMonitor fam;
+    protected Thread thread;
     
     public ReloadingClassLoader(final ClassLoader pParent, final File pRepository) {
         this(pParent, pRepository, new MemoryResourceStore());
@@ -65,13 +63,16 @@
         reader = new FileResourceReader(repository);
         store = pStore;
                 
-        fam = new FilesystemAlterationMonitor(); 
-        fam.addListener(createListener(repository), repository);
-
         delegate = new ResourceStoreClassLoader(parent, store);
     }
     
     public void start() {
+        fam = new FilesystemAlterationMonitor(); 
+        fam.addListener(new ReloadingListener(store) {
+            public void reload() {
+                ReloadingClassLoader.this.reload();
+            }            
+        }, repository);
         thread = new Thread(fam);         
         thread.start();
         reload();        
@@ -85,84 +86,14 @@
             ;
         }
     }
-    protected FilesystemAlterationListener createListener(final File pRepository) {
-        return new FilesystemAlterationListener() {
-
-            private final Collection created = new ArrayList();
-            private final Collection changed = new ArrayList();
-            private final Collection deleted = new ArrayList();
-            
-            public void onStart() {
-                created.clear();
-                changed.clear();
-                deleted.clear();
-            }
-            public void onStop() {
-
-                boolean reload = false;
-                
-                if (deleted.size() > 0) {
-                    for (Iterator it = deleted.iterator(); it.hasNext();) {
-                        final File file = (File) it.next();
-                        store.remove(clazzName(repository, file));
-                    }
-                    reload = true;
-                }
-
-                if (created.size() > 0) {
-                    for (Iterator it = created.iterator(); it.hasNext();) {
-                        final File file = (File) it.next();
-                        try {
-                            final byte[] bytes = IOUtils.toByteArray(new FileReader(file));
-                            store.write(clazzName(repository, file), bytes);
-                        } catch(final Exception e) {
-                            log.error("could not load " + file, e);
-                        }
-                    }
-                }
-
-                if (changed.size() > 0) {
-                    reload = true;
-                }
-
-                if (reload) {
-                    reload();
-                }                
-            }
-
-            public void onCreateFile( final File file ) {
-                if (file.getName().endsWith(".class")) {
-                    created.add(file);
-                }
-            }
-            public void onChangeFile( final File file ) {                
-                if (file.getName().endsWith(".class")) {
-                    changed.add(file);
-                }
-            }
-            public void onDeleteFile( final File file ) {
-                if (file.getName().endsWith(".class")) {
-                    deleted.add(file);
-                }
-            }
-
-            public void onCreateDirectory( final File file ) {                
-            }
-            public void onChangeDirectory( final File file ) {                
-            }
-            public void onDeleteDirectory( final File file ) {
-            }
-            
-        };
-    }
 
-    public void addListener(final ReloadingListener pListener) {
+    public void addListener(final ReloadingClassLoaderListener pListener) {
         synchronized (reloadingListeners) {
             reloadingListeners.add(pListener);
         }                
     }
     
-    public boolean removeListener(final ReloadingListener pListener) {
+    public boolean removeListener(final ReloadingClassLoaderListener pListener) {
         synchronized (reloadingListeners) {
             return reloadingListeners.remove(pListener);
         }        
@@ -173,7 +104,7 @@
         delegate = new ResourceStoreClassLoader(parent, store);
         synchronized (reloadingListeners) {
             for (final Iterator it = reloadingListeners.iterator(); it.hasNext();) {
-                final ReloadingListener listener = (ReloadingListener) it.next();
+                final ReloadingClassLoaderListener listener = (ReloadingClassLoaderListener)
it.next();
                 listener.reload();
             }            
         }

Copied: jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/ReloadingClassLoaderListener.java
(from r231504, jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/ReloadingListener.java)
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/ReloadingClassLoaderListener.java?p2=jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/ReloadingClassLoaderListener.java&p1=jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/ReloadingListener.java&r1=231504&r2=231541&rev=231541&view=diff
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/ReloadingListener.java
(original)
+++ jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/ReloadingClassLoaderListener.java
Thu Aug 11 16:39:34 2005
@@ -19,6 +19,6 @@
 /**
  * @author tcurdt
  */
-public interface ReloadingListener {
+public interface ReloadingClassLoaderListener {
     void reload();
 }

Added: jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/listeners/CompilingListener.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/listeners/CompilingListener.java?rev=231541&view=auto
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/listeners/CompilingListener.java
(added)
+++ jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/listeners/CompilingListener.java
Thu Aug 11 16:39:34 2005
@@ -0,0 +1,134 @@
+package org.apache.commons.jci.listeners;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import org.apache.commons.jci.ReloadingClassLoader;
+import org.apache.commons.jci.compilers.JavaCompiler;
+import org.apache.commons.jci.monitor.FilesystemAlterationListener;
+import org.apache.commons.jci.problems.ConsoleCompilationProblemHandler;
+import org.apache.commons.jci.readers.ResourceReader;
+import org.apache.commons.jci.stores.TransactionalResourceStore;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+
+public class CompilingListener implements FilesystemAlterationListener {
+
+    private final static Log log = LogFactory.getLog(CompilingListener.class);
+    
+    private final Collection created = new ArrayList();
+    private final Collection changed = new ArrayList();
+    private final Collection deleted = new ArrayList();
+    
+    private final JavaCompiler compiler;
+    private final ResourceReader reader;
+    private final TransactionalResourceStore transactionalStore;
+    
+    public CompilingListener(
+            final ResourceReader pReader,
+            final JavaCompiler pCompiler,
+            final TransactionalResourceStore pTransactionalStore
+            ) {
+        compiler = pCompiler;
+        reader = pReader;
+        transactionalStore = pTransactionalStore;
+    }
+    
+    public void onStart(final File pRepository) {
+        created.clear();
+        changed.clear();
+        deleted.clear();
+        transactionalStore.onStart();
+    }
+    public void onStop(final File pRepository) {
+        log.debug("resources " +
+                created.size() + " created, " + 
+                changed.size() + " changed, " + 
+                deleted.size() + " deleted");
+
+        boolean reload = false;
+        
+        if (deleted.size() > 0) {
+            for (Iterator it = deleted.iterator(); it.hasNext();) {
+                final File file = (File) it.next();
+                transactionalStore.remove(ReloadingClassLoader.clazzName(pRepository, file));
+            }
+            reload = true;
+        }
+                        
+        final Collection compileables = new ArrayList();
+        compileables.addAll(created);
+        compileables.addAll(changed);
+
+        final String[] clazzes = new String[compileables.size()];
+        
+        if (compileables.size() > 0) {
+            
+            int i = 0;
+            for (Iterator it = compileables.iterator(); it.hasNext();) {
+                final File file = (File) it.next();
+                clazzes[i] = ReloadingClassLoader.clazzName(pRepository,file);
+                //log.debug(clazzes[i]);
+                i++;
+            }
+            
+            final ConsoleCompilationProblemHandler problemHandler = new ConsoleCompilationProblemHandler();
+
+            compiler.compile(
+                    clazzes,
+                    reader,
+                    transactionalStore,
+                    problemHandler
+                    );
+            
+            
+            log.debug(
+                    problemHandler.getErrorCount() + " errors, " +
+                    problemHandler.getWarningCount() + " warnings"
+                    );
+        
+            if (problemHandler.getErrorCount() > 0) {
+                for (int j = 0; j < clazzes.length; j++) {
+                    transactionalStore.remove(clazzes[j]);
+                }
+            }
+            
+            reload = true;                    
+
+        }
+
+        transactionalStore.onStop();
+
+        if (reload) {
+            reload();
+        }                
+    }
+
+    public void onCreateFile( final File file ) {
+        if (file.getName().endsWith(".java")) {
+            created.add(file);
+        }
+    }
+    public void onChangeFile( final File file ) {                
+        if (file.getName().endsWith(".java")) {
+            changed.add(file);
+        }
+    }
+    public void onDeleteFile( final File file ) {
+        if (file.getName().endsWith(".java")) {
+            deleted.add(file);
+        }
+    }
+
+    public void onCreateDirectory( final File file ) {                
+    }
+    public void onChangeDirectory( final File file ) {                
+    }
+    public void onDeleteDirectory( final File file ) {
+    }
+
+    protected void reload() {
+    }
+}

Added: jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/listeners/ReloadingListener.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/listeners/ReloadingListener.java?rev=231541&view=auto
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/listeners/ReloadingListener.java
(added)
+++ jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/listeners/ReloadingListener.java
Thu Aug 11 16:39:34 2005
@@ -0,0 +1,93 @@
+package org.apache.commons.jci.listeners;
+
+import java.io.File;
+import java.io.FileReader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.jci.ReloadingClassLoader;
+import org.apache.commons.jci.monitor.FilesystemAlterationListener;
+import org.apache.commons.jci.stores.ResourceStore;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+
+public class ReloadingListener implements FilesystemAlterationListener{
+
+    private final static Log log = LogFactory.getLog(ReloadingListener.class);
+
+    private final Collection created = new ArrayList();
+    private final Collection changed = new ArrayList();
+    private final Collection deleted = new ArrayList();
+
+    private final ResourceStore store;
+    
+    public ReloadingListener(final ResourceStore pStore) {
+        store = pStore;        
+    }
+    
+    public void onStart(final File repository) {
+        created.clear();
+        changed.clear();
+        deleted.clear();
+    }
+    public void onStop(final File pRepository) {
+
+        boolean reload = false;
+        
+        if (deleted.size() > 0) {
+            for (Iterator it = deleted.iterator(); it.hasNext();) {
+                final File file = (File) it.next();
+                store.remove(ReloadingClassLoader.clazzName(pRepository, file));
+            }
+            reload = true;
+        }
+
+        if (created.size() > 0) {
+            for (Iterator it = created.iterator(); it.hasNext();) {
+                final File file = (File) it.next();
+                try {
+                    final byte[] bytes = IOUtils.toByteArray(new FileReader(file));
+                    store.write(ReloadingClassLoader.clazzName(pRepository, file), bytes);
+                } catch(final Exception e) {
+                    log.error("could not load " + file, e);
+                }
+            }
+        }
+
+        if (changed.size() > 0) {
+            reload = true;
+        }
+
+        if (reload) {
+            reload();
+        }                
+    }
+
+    public void onCreateFile( final File file ) {
+        if (file.getName().endsWith(".class")) {
+            created.add(file);
+        }
+    }
+    public void onChangeFile( final File file ) {                
+        if (file.getName().endsWith(".class")) {
+            changed.add(file);
+        }
+    }
+    public void onDeleteFile( final File file ) {
+        if (file.getName().endsWith(".class")) {
+            deleted.add(file);
+        }
+    }
+
+    public void onCreateDirectory( final File file ) {                
+    }
+    public void onChangeDirectory( final File file ) {                
+    }
+    public void onDeleteDirectory( final File file ) {
+    }
+
+    public void reload() {        
+    }
+}

Modified: jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/monitor/FilesystemAlterationListener.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/monitor/FilesystemAlterationListener.java?rev=231541&r1=231540&r2=231541&view=diff
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/monitor/FilesystemAlterationListener.java
(original)
+++ jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/monitor/FilesystemAlterationListener.java
Thu Aug 11 16:39:34 2005
@@ -22,12 +22,12 @@
  *
  */
 public interface FilesystemAlterationListener {
-    void onStart();
+    void onStart( final File repository );
     void onCreateFile( final File file );
     void onChangeFile( final File file );
     void onDeleteFile( final File file );
     void onCreateDirectory( final File dir );
     void onChangeDirectory( final File dir );
     void onDeleteDirectory( final File dir );
-    void onStop();
+    void onStop( final File repository );
 }

Modified: jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.java?rev=231541&r1=231540&r2=231541&view=diff
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.java
(original)
+++ jakarta/commons/sandbox/jci/trunk/src/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.java
Thu Aug 11 16:39:34 2005
@@ -210,7 +210,7 @@
         if (l != null) {
             for (Iterator it = l.iterator(); it.hasNext();) {
                 final FilesystemAlterationListener listener = (FilesystemAlterationListener)
it.next();
-                listener.onStart();
+                listener.onStart(root);
             }            
         }
     }
@@ -227,7 +227,7 @@
         if (l != null) {
             for (Iterator it = l.iterator(); it.hasNext();) {
                 final FilesystemAlterationListener listener = (FilesystemAlterationListener)
it.next();
-                listener.onStop();
+                listener.onStop(root);
             }            
         }
     }

Modified: jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/CompilingClassLoaderTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/CompilingClassLoaderTestCase.java?rev=231541&r1=231540&r2=231541&view=diff
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/CompilingClassLoaderTestCase.java
(original)
+++ jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/CompilingClassLoaderTestCase.java
Thu Aug 11 16:39:34 2005
@@ -12,12 +12,12 @@
     private final Signal reload = new Signal();
 
     private CompilingClassLoader cl;
-    private ReloadingListener listener;
+    private ReloadingClassLoaderListener listener;
     
     protected void setUp() throws Exception {
         super.setUp();
         
-        listener = new ReloadingListener() {
+        listener = new ReloadingClassLoaderListener() {
             public void reload() {
                 synchronized(reload) {
                     reload.triggered = true;

Modified: jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/monitor/FilesystemAlterationMonitorTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/monitor/FilesystemAlterationMonitorTestCase.java?rev=231541&r1=231540&r2=231541&view=diff
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/monitor/FilesystemAlterationMonitorTestCase.java
(original)
+++ jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/monitor/FilesystemAlterationMonitorTestCase.java
Thu Aug 11 16:39:34 2005
@@ -52,10 +52,10 @@
             return stopped;
         }
                  
-        public void onStart() {
+        public void onStart(final File repository) {
             ++started;
         }
-        public void onStop() {
+        public void onStop(final File repository) {
             ++stopped;
             synchronized(signal) {
                 signal.triggered = true;
@@ -213,7 +213,13 @@
         assertTrue(newDirectory.mkdir());
         assertTrue(newDirectory.exists());
         assertTrue(newDirectory.isDirectory());
-
+        
+        while(directory.lastModified() == modified) {
+            Thread.sleep(100);
+            System.out.print('.');
+        }
+        
+        
         assertTrue(directory.lastModified() != modified);
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message