[jboss-cvs] JBossAS SVN: r80491 - in projects/jboss-seam-int/branches/Branch_5_0: jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Nov 4 08:30:00 EST 2008


Author: alesj
Date: 2008-11-04 08:30:00 -0500 (Tue, 04 Nov 2008)
New Revision: 80491

Added:
   projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/CachingVFSScanner.java
   projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/LeafVirtualFileFilter.java
Removed:
   projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/LeafVirtualFileFilter.java
Modified:
   projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/VFSScanner.java
   projects/jboss-seam-int/branches/Branch_5_0/pom.xml
Log:
Port trunk changes to branch.

Copied: projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/CachingVFSScanner.java (from rev 80490, projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/CachingVFSScanner.java)
===================================================================
--- projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/CachingVFSScanner.java	                        (rev 0)
+++ projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/CachingVFSScanner.java	2008-11-04 13:30:00 UTC (rev 80491)
@@ -0,0 +1,58 @@
+package org.jboss.seam.integration.jbossas.vfs;
+
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.seam.deployment.DeploymentStrategy;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Caching JBoss VSF aware scanner.
+ *
+ * Use this one when you know VFSContext will be present in cache.
+ * This is mostly true for apps that are deployed into jbossas deploy directory.
+ * Otherwise change the VFSCache impl to make sure or use plain VFSScanner.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class CachingVFSScanner extends VFSScanner
+{
+   public CachingVFSScanner(DeploymentStrategy deploymentStrategy)
+   {
+      super(deploymentStrategy);
+   }
+
+   /**
+    * Get the virtual file root.
+    *
+    * @param url         the root URL
+    * @param parentDepth level of parent depth
+    * @return actual virtual file from url param
+    * @throws java.io.IOException for any error
+    */
+   protected VirtualFile getRoot(URL url, int parentDepth) throws IOException
+   {
+      log.trace("Root url: " + url);
+
+      String urlString = url.toString();
+      // TODO - this should go away once we figure out why -exp.war is part of CL resources
+      if (urlString.startsWith("vfs") == false)
+         return null;
+
+      // get the cached file directly, as we expect it to already be there
+      VirtualFile top = VFS.getCachedFile(url);
+      while (parentDepth > 0)
+      {
+         if (top == null)
+            throw new IllegalArgumentException("Null parent: " + url + ", there might be no matching VFSContext in VFSCache.");
+         top = top.getParent();
+         parentDepth--;
+      }
+
+      log.trace("Top: " + top);
+
+      return top;
+   }
+}
\ No newline at end of file

Deleted: projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/LeafVirtualFileFilter.java
===================================================================
--- projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/LeafVirtualFileFilter.java	2008-11-04 13:09:53 UTC (rev 80490)
+++ projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/LeafVirtualFileFilter.java	2008-11-04 13:30:00 UTC (rev 80491)
@@ -1,53 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.seam.integration.jbossas.vfs;
-
-import java.io.IOException;
-
-import org.jboss.virtual.VirtualFileFilter;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * Only accept leaves.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class LeafVirtualFileFilter implements VirtualFileFilter
-{
-   public static final VirtualFileFilter INSTANCE = new LeafVirtualFileFilter();
-
-   private LeafVirtualFileFilter()
-   {
-   }
-
-   public boolean accepts(VirtualFile file)
-   {
-      try
-      {
-         return file.isLeaf();
-      }
-      catch (IOException e)
-      {
-         return false;
-      }
-   }
-}

Copied: projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/LeafVirtualFileFilter.java (from rev 80490, projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/LeafVirtualFileFilter.java)
===================================================================
--- projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/LeafVirtualFileFilter.java	                        (rev 0)
+++ projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/LeafVirtualFileFilter.java	2008-11-04 13:30:00 UTC (rev 80491)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.seam.integration.jbossas.vfs;
+
+import java.io.IOException;
+
+import org.jboss.virtual.VirtualFileFilter;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Only accept leaves.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class LeafVirtualFileFilter implements VirtualFileFilter
+{
+   public static final VirtualFileFilter INSTANCE = new LeafVirtualFileFilter();
+
+   private LeafVirtualFileFilter()
+   {
+   }
+
+   public boolean accepts(VirtualFile file)
+   {
+      try
+      {
+         return file.isLeaf();
+      }
+      catch (IOException e)
+      {
+         return false;
+      }
+   }
+}

Modified: projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/VFSScanner.java
===================================================================
--- projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/VFSScanner.java	2008-11-04 13:09:53 UTC (rev 80490)
+++ projects/jboss-seam-int/branches/Branch_5_0/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/VFSScanner.java	2008-11-04 13:30:00 UTC (rev 80491)
@@ -22,7 +22,7 @@
  */
 public class VFSScanner extends AbstractScanner
 {
-   private static final LogProvider log = Logging.getLogProvider(VFSScanner.class);
+   protected final LogProvider log = Logging.getLogProvider(getClass());
 
    private long timestamp;
 
@@ -39,7 +39,7 @@
     * @return actual virtual file from url param
     * @throws IOException for any error
     */
-   protected static VirtualFile getRoot(URL url, int parentDepth) throws IOException
+   protected VirtualFile getRoot(URL url, int parentDepth) throws IOException
    {
       log.trace("Root url: " + url);
 
@@ -81,7 +81,8 @@
 
       log.trace("URL: " + vfsurl + ", relative: " + relative);
 
-      VirtualFile top = VFS.getRoot(vfsurl);
+      // use cache any way - we should be OK with getting the parent later on
+      VirtualFile top = VFS.getCachedFile(vfsurl);
       top = top.getChild(relative);
       while (parentDepth > 0)
       {

Modified: projects/jboss-seam-int/branches/Branch_5_0/pom.xml
===================================================================
--- projects/jboss-seam-int/branches/Branch_5_0/pom.xml	2008-11-04 13:09:53 UTC (rev 80490)
+++ projects/jboss-seam-int/branches/Branch_5_0/pom.xml	2008-11-04 13:30:00 UTC (rev 80491)
@@ -28,15 +28,15 @@
   
   <properties>
     <version.jboss.seam>2.1.0.GA</version.jboss.seam>
-    <version.jboss.vfs>2.0.0.CR1</version.jboss.vfs>
+    <version.jboss.vfs>2.0.0.CR2</version.jboss.vfs>
     <version.jboss.man>2.0.0.CR2</version.jboss.man>
-    <version.jboss.microcontainer>2.0.0.CR3</version.jboss.microcontainer>
-    <version.jboss.cl>2.0.0.CR4</version.jboss.cl>
-    <version.jboss.deployers>2.0.0.CR3</version.jboss.deployers>
-    <version.jboss.common.core>2.2.8.GA</version.jboss.common.core>
+    <version.jboss.microcontainer>2.0.0.CR4</version.jboss.microcontainer>
+    <version.jboss.cl>2.0.0.CR5</version.jboss.cl>
+    <version.jboss.deployers>2.0.0.CR4</version.jboss.deployers>
+    <version.jboss.common.core>2.2.9.GA</version.jboss.common.core>
     <version.jboss.logging.spi>2.0.5.GA</version.jboss.logging.spi>
     <version.jboss.classloading.spi>5.0.0.CR2</version.jboss.classloading.spi>
-    <version.jboss.metadata>1.0.0.CR3</version.jboss.metadata>
+    <version.jboss.metadata>1.0.0.CR5</version.jboss.metadata>
     <version.jbossxb>2.0.0.GA</version.jbossxb>
     <version.servlet.api>2.5</version.servlet.api>
     <version.org.jboss.test>1.1.1.GA</version.org.jboss.test>




More information about the jboss-cvs-commits mailing list