[jboss-cvs] JBossAS SVN: r84004 - projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/modified.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Feb 9 11:30:10 EST 2009


Author: alesj
Date: 2009-02-09 11:30:09 -0500 (Mon, 09 Feb 2009)
New Revision: 84004

Modified:
   projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/modified/DefaultStructureCache.java
   projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/modified/MetaDataStructureModificationChecker.java
   projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/modified/StructureCache.java
Log:
Handle metadata add/remove.

Modified: projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/modified/DefaultStructureCache.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/modified/DefaultStructureCache.java	2009-02-09 15:55:45 UTC (rev 84003)
+++ projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/modified/DefaultStructureCache.java	2009-02-09 16:30:09 UTC (rev 84004)
@@ -49,6 +49,12 @@
       return map.get(pathName);
    }
 
+   public Integer getLeavesCount(String pathName)
+   {
+      // TODO
+      return null;
+   }
+
    public void invalidateCache(String pathName)
    {
       removeCache(pathName);

Modified: projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/modified/MetaDataStructureModificationChecker.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/modified/MetaDataStructureModificationChecker.java	2009-02-09 15:55:45 UTC (rev 84003)
+++ projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/modified/MetaDataStructureModificationChecker.java	2009-02-09 16:30:09 UTC (rev 84004)
@@ -112,6 +112,13 @@
                   List<VirtualFile> children = mdpVF.getChildren(filter);
                   if (children != null && children.isEmpty() == false)
                   {
+                     Integer cachedSize = getCache().getLeavesCount(mdpVF.getPathName());
+                     // do we have some new files or some were deleted
+                     if (cachedSize != null && cachedSize != children.size())
+                     {
+                        return true;
+                     }
+
                      for (VirtualFile child : children)
                      {
                         String pathName = child.getPathName();

Modified: projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/modified/StructureCache.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/modified/StructureCache.java	2009-02-09 15:55:45 UTC (rev 84003)
+++ projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/modified/StructureCache.java	2009-02-09 16:30:09 UTC (rev 84004)
@@ -54,6 +54,15 @@
    T getCacheValue(String pathName);
 
    /**
+    * Get leaves count for this path name parameter.
+    * Only exact sub path nodes count in.
+    *
+    * @param pathName the path name
+    * @return sub-paths node size or null if no such match yet
+    */
+   Integer getLeavesCount(String pathName);
+
+   /**
     * Invalidate cache for path name.
     *
     * @param pathName the path name




More information about the jboss-cvs-commits mailing list