[jboss-cvs] JBossAS SVN: r111387 - in projects/jboss-deployers/branches/Branch_2_2: deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading and 12 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon May 16 15:35:19 EDT 2011


Author: alesj
Date: 2011-05-16 15:35:18 -0400 (Mon, 16 May 2011)
New Revision: 111387

Added:
   projects/jboss-deployers/branches/Branch_2_2/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractTranslatorsDeployer.java
   projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/link/
   projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/link/VFSLinkStructureDeployer.java
   projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/support/BableFish.java
   projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/support/IATranslator.java
   projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/support/MockTranslator.java
   projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/test/ClassLoadingTranslatorsMetaDataUnitTestCase.java
   projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/resources/classloading/translator/
   projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/resources/classloading/translator/META-INF/
   projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/resources/classloading/translator/META-INF/jboss-translator.xml
Removed:
   projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/link/VFSLinkStructureDeployer.java
   projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/resources/classloading/translator/META-INF/
   projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/resources/classloading/translator/META-INF/jboss-translator.xml
Modified:
   projects/jboss-deployers/branches/Branch_2_2/
   projects/jboss-deployers/branches/Branch_2_2/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/SortedDeployers.java
   projects/jboss-deployers/branches/Branch_2_2/deployers-impl/src/test/java/org/jboss/test/deployers/main/test/DynamicDeployerUsageTestCase.java
   projects/jboss-deployers/branches/Branch_2_2/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java
   projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/ClassLoadingTestSuite.java
   projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/resources/bootstrap/bootstrap.xml
   projects/jboss-deployers/branches/Branch_2_2/pom.xml
Log:
Port trunk to 2_2.
TODO -- fix CL version!



Property changes on: projects/jboss-deployers/branches/Branch_2_2
___________________________________________________________________
Modified: svn:mergeinfo
   - /projects/jboss-deployers/trunk:110263,110265-110968
   + /projects/jboss-deployers/trunk:110263,110265-110968,111070-111111

Copied: projects/jboss-deployers/branches/Branch_2_2/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractTranslatorsDeployer.java (from rev 111111, projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractTranslatorsDeployer.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_2/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractTranslatorsDeployer.java	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_2/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractTranslatorsDeployer.java	2011-05-16 19:35:18 UTC (rev 111387)
@@ -0,0 +1,171 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.deployers.plugins.classloading;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.classloader.spi.ClassLoaderDomain;
+import org.jboss.classloader.spi.ClassLoaderPolicy;
+import org.jboss.classloader.spi.ClassLoaderSystem;
+import org.jboss.classloading.spi.dependency.Module;
+import org.jboss.classloading.spi.dependency.policy.ClassLoaderPolicyModule;
+import org.jboss.classloading.spi.metadata.ClassLoadingTranslatorMetaData;
+import org.jboss.classloading.spi.metadata.ClassLoadingTranslatorsMetaData;
+import org.jboss.classloading.spi.metadata.TranslatorScope;
+import org.jboss.classloading.spi.metadata.helpers.ReflectionTranslator;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.spi.deployer.helpers.AttachmentLocator;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.util.loading.Translator;
+
+/**
+ * AbstractTranslatorsDeployer.
+ * 
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ * @version $Revision: 1.1 $
+ */
+public class AbstractTranslatorsDeployer extends AbstractSimpleRealDeployer<ClassLoadingTranslatorsMetaData>
+{
+   /** Attachment key */
+   public static final String TRANSLATORS_KEY = "TRANSLATORS_KEY";
+
+   /** The classloader system */
+   private ClassLoaderSystem system;
+
+   public AbstractTranslatorsDeployer()
+   {
+      super(ClassLoadingTranslatorsMetaData.class);
+      // add this deployer right after ClassLoader is created
+      addInput(ClassLoader.class);
+      addOutput(Translator.class);
+      setStage(DeploymentStages.CLASSLOADER);
+   }
+
+   /**
+    * Validate the config
+    */
+   public void create()
+   {
+      if (system == null)
+         throw new IllegalStateException("The system has not been set");
+   }
+
+   public void deploy(DeploymentUnit unit, ClassLoadingTranslatorsMetaData deployment) throws DeploymentException
+   {
+      Module module = AttachmentLocator.searchAncestors(unit, Module.class);
+      if (module == null || (module instanceof ClassLoaderPolicyModule == false))
+         return;
+
+      Map<Translator, TranslatorScope> added = new HashMap<Translator, TranslatorScope>();
+      try
+      {
+         List<ClassLoadingTranslatorMetaData> translators = deployment.getTranslators();
+         if (translators != null)
+         {
+            ClassLoaderPolicyModule clpm = (ClassLoaderPolicyModule) module;
+            ClassLoaderDomain domain = system.getDomain(module.getDeterminedDomainName());
+            ClassLoaderPolicy policy = clpm.getPolicy();
+            ClassLoader cl = unit.getClassLoader();
+
+            for (ClassLoadingTranslatorMetaData cltmd : translators)
+            {
+               TranslatorScope scope = cltmd.getScope();
+               if (scope == null)
+                  throw new IllegalArgumentException("Null scope for: " + cltmd);
+
+               String className = cltmd.getClassName();
+               Object instance = cl.loadClass(className).newInstance();
+               String methodName = cltmd.getMethod();
+               Translator translator;
+               if (methodName != null)
+                  translator = new ReflectionTranslator(instance, methodName);
+               else
+                  translator = Translator.class.cast(instance);
+
+               scope.addTranslator(system, domain, policy, translator);
+               added.put(translator, scope);
+            }
+
+            unit.addAttachment(TRANSLATORS_KEY, added);
+         }
+      }
+      catch (Exception e)
+      {
+         ClassLoaderPolicyModule clpm = (ClassLoaderPolicyModule) module;
+         ClassLoaderDomain domain = system.getDomain(module.getDeterminedDomainName());
+         ClassLoaderPolicy policy = clpm.getPolicy();
+
+         for (Map.Entry<Translator, TranslatorScope> entry : added.entrySet())
+         {
+            entry.getValue().removeTranslator(system, domain, policy, entry.getKey());
+         }
+
+         throw DeploymentException.rethrowAsDeploymentException("Error adding translators.", e);
+      }
+   }
+
+   @SuppressWarnings({"unchecked"})
+   @Override
+   public void undeploy(DeploymentUnit unit, ClassLoadingTranslatorsMetaData deployment)
+   {
+      Module module = AttachmentLocator.searchAncestors(unit, Module.class);
+      if (module == null || (module instanceof ClassLoaderPolicyModule == false))
+         return;
+
+      Map<Translator, TranslatorScope> added = unit.getAttachment(TRANSLATORS_KEY, Map.class);
+      if (added != null)
+      {
+         ClassLoaderPolicyModule clpm = (ClassLoaderPolicyModule) module;
+         ClassLoaderDomain domain = system.getDomain(module.getDeterminedDomainName());
+         ClassLoaderPolicy policy = clpm.getPolicy();
+
+         for (Map.Entry<Translator, TranslatorScope> entry : added.entrySet())
+         {
+            entry.getValue().removeTranslator(system, domain, policy, entry.getKey());
+         }
+      }
+   }
+
+   /**
+    * Get the system.
+    * 
+    * @return the system.
+    */
+   public ClassLoaderSystem getSystem()
+   {
+      return system;
+   }
+
+   /**
+    * Set the system.
+    * 
+    * @param system the system.
+    */
+   public void setSystem(ClassLoaderSystem system)
+   {
+      this.system = system;
+   }
+}

Modified: projects/jboss-deployers/branches/Branch_2_2/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/SortedDeployers.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_2/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/SortedDeployers.java	2011-05-16 19:24:59 UTC (rev 111386)
+++ projects/jboss-deployers/branches/Branch_2_2/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/SortedDeployers.java	2011-05-16 19:35:18 UTC (rev 111387)
@@ -1,3 +1,24 @@
+/*
+* 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.deployers.plugins.sort;
 
 import java.util.ArrayList;
@@ -12,13 +33,13 @@
 
 /**
  * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
  * @version $Revision: 1 $
  */
 public class SortedDeployers
 {
    private static class Entry
    {
-
       public Deployer deployer;
       public int index;
 
@@ -66,8 +87,8 @@
 
    Map<String, List<Entry>> outputMap = new HashMap<String, List<Entry>>();
    Map<String, List<Entry>> inputMap = new HashMap<String, List<Entry>>();
-   ArrayList<Entry> entries = new ArrayList<Entry>();
-   ArrayList<Deployer> deployers = new ArrayList<Deployer>();
+   List<Entry> entries = new ArrayList<Entry>();
+   volatile List<Deployer> deployers = new ArrayList<Deployer>();
 
    public void addOutputs(Entry deployer)
    {
@@ -108,11 +129,12 @@
       if (entries.size() == 0)
       {
          insertAt(n);
-         deployers.clear();
+         List<Deployer> copy = new ArrayList<Deployer>();
          for (Entry entry : entries)
          {
-            deployers.add(entry.deployer);
+            copy.add(entry.deployer);
          }
+         deployers = copy;
          return;
       }
 
@@ -123,11 +145,12 @@
 
       // For some reason, something depends on a new list within MC/VDF
       // be careful if you change this
-      deployers = new ArrayList<Deployer>();
+      List<Deployer> copy = new ArrayList<Deployer>();
       for (Entry entry : entries)
       {
-         deployers.add(entry.deployer);
+         copy.add(entry.deployer);
       }
+      deployers = copy;
    }
 
    public void removeDeployer(Deployer d)
@@ -136,14 +159,15 @@
       int esize = entries.size();
       for (int i = 0; i < esize; i++)
       {
-         if (entries.get(0).deployer.equals(d))
+         Entry entry = entries.get(i);
+         if (entry.deployer.equals(d))
          {
-            removed = entries.get(0);
+            removed = entry;
             removeAt(i);
             break;
          }
       }
-      if (d.getInputs() != null)
+      if (removed != null && d.getInputs() != null)
       {
          for (String input : d.getInputs())
          {
@@ -154,7 +178,7 @@
             }
          }
       }
-      if (d.getOutputs() != null)
+      if (removed != null && d.getOutputs() != null)
       {
          for (String output : d.getOutputs())
          {
@@ -165,16 +189,17 @@
             }
          }
       }
-      deployers = new ArrayList<Deployer>();
+      List<Deployer> copy = new ArrayList<Deployer>();
       for (Entry entry : entries)
       {
-         deployers.add(entry.deployer);
+         copy.add(entry.deployer);
       }
+      deployers = copy;
    }
 
    public List<Deployer> getDeployers()
    {
-      return deployers;
+      return Collections.unmodifiableList(deployers);
    }
 
    private void traverseOutputs(Entry n, IdentityHashMap<Entry, Entry> visited)

Modified: projects/jboss-deployers/branches/Branch_2_2/deployers-impl/src/test/java/org/jboss/test/deployers/main/test/DynamicDeployerUsageTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_2/deployers-impl/src/test/java/org/jboss/test/deployers/main/test/DynamicDeployerUsageTestCase.java	2011-05-16 19:24:59 UTC (rev 111386)
+++ projects/jboss-deployers/branches/Branch_2_2/deployers-impl/src/test/java/org/jboss/test/deployers/main/test/DynamicDeployerUsageTestCase.java	2011-05-16 19:35:18 UTC (rev 111387)
@@ -46,12 +46,17 @@
 
    public void testAddRemove() throws Exception
    {
-      MarkerDeployer md = new MarkerDeployer();
-      DeployerClient main = createMainDeployer(md);
+      // make sure md1 is before md2
+      MarkerDeployer md1 = new MarkerDeployer();
+      md1.addOutput(MarkerDeployer.class);
+      MarkerDeployer md2 = new MarkerDeployer();
+      md2.addInput(MarkerDeployer.class);
+
+      DeployerClient main = createMainDeployer(md1, md2);
       Deployment deployment = createSimpleDeployment("test");
       main.deploy(deployment);
-      removeDeployer(main, md);
+      removeDeployer(main, md2);
       main.undeploy(deployment);
-      assertNull(md.unit);
+      assertNull(md2.unit);
    }
 }

Deleted: projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/link/VFSLinkStructureDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/link/VFSLinkStructureDeployer.java	2011-04-06 20:40:01 UTC (rev 111111)
+++ projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/link/VFSLinkStructureDeployer.java	2011-05-16 19:35:18 UTC (rev 111387)
@@ -1,188 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.deployers.vfs.plugins.structure.link;
-
-import java.io.BufferedReader;
-import java.io.Closeable;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.vfs.spi.structure.StructureContext;
-import org.jboss.deployers.vfs.spi.structure.StructureDeployer;
-import org.jboss.logging.Logger;
-import org.jboss.util.StringPropertyReplacer;
-import org.jboss.vfs.VFS;
-import org.jboss.vfs.VFSUtils;
-import org.jboss.vfs.VirtualFile;
-
-/**
- * .vfslink.properties feature port
- * We don't recognize structure, we just prepare .vfslink.properties mounts.
- *
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class VFSLinkStructureDeployer implements StructureDeployer
-{
-   /** The log */
-   protected static final Logger log = Logger.getLogger("org.jboss.deployers.vfs.structure");
-
-   /** The link properties */
-   public static final String VFS_LINK_PROPERTIES_SUFFIX = ".vfslink.properties";
-   /** The link name */
-   public static final String VFS_LINK_NAME = "vfs.link.name";
-   /** The link target */
-   public static final String VFS_LINK_TARGET = "vfs.link.target";
-
-   public boolean determineStructure(StructureContext context) throws DeploymentException
-   {
-      VirtualFile root = context.getFile();
-      VirtualFile vfslinks = root.getChild("META-INF/jboss-vfslinks.txt");
-      if (vfslinks.exists())
-      {
-         try
-         {
-            InputStream is = vfslinks.openStream();
-            BufferedReader reader = new BufferedReader(new InputStreamReader(is));
-            try
-            {
-               String line;
-               while((line = reader.readLine()) != null)
-               {
-                  // ignore comments
-                  if (line.startsWith("#") == false)
-                     mountLinks(context, line);
-               }
-            }
-            finally
-            {
-               VFSUtils.safeClose(is);
-            }
-         }
-         catch (IOException e)
-         {
-            throw DeploymentException.rethrowAsDeploymentException("Cannot read jboss-vfslinks.txt", e);
-         }
-      }
-      return false;
-   }
-
-   protected void mountLinks(StructureContext context, String path) throws IOException
-   {
-      VirtualFile root = context.getFile();
-      VirtualFile link = root.getChild(path + VFS_LINK_PROPERTIES_SUFFIX);
-      if (link.exists())
-      {
-         List<LinkInfo> links = new ArrayList<LinkInfo>();
-         parseLinkProperties(link, links);
-         mountLinks(context, link.getParent(), path, links);
-      }
-      else
-      {
-         log.warn("No " + VFS_LINK_PROPERTIES_SUFFIX + " match for link: " + path);
-      }
-   }
-
-   protected void parseLinkProperties(VirtualFile link, List<LinkInfo> links) throws IOException
-   {
-      InputStream is = link.openStream();
-      try
-      {
-         Properties props = new Properties();
-         props.load(is);
-
-         for(int n = 0; ; n ++)
-         {
-            String nameKey = VFS_LINK_NAME + "." + n;
-            String name = props.getProperty(nameKey);
-            String uriKey = VFS_LINK_TARGET + "." + n;
-            String uri = props.getProperty(uriKey);
-            // End when the value is null since a link may not have a name
-            if (uri == null)
-            {
-               break;
-            }
-            // Replace any system property references
-            uri = StringPropertyReplacer.replaceProperties(uri);
-            LinkInfo li = new LinkInfo(name, new URI(uri));
-            links.add(li);
-         }
-      }
-      catch (URISyntaxException e)
-      {
-         IOException ioe = new IOException();
-         ioe.initCause(e);
-         throw ioe;
-      }
-      finally
-      {
-         VFSUtils.safeClose(is);
-      }
-   }
-
-   @SuppressWarnings({"UnusedDeclaration"})
-   protected void mountLinks(StructureContext context, VirtualFile parent, String path, List<LinkInfo> links) throws IOException
-   {
-      VirtualFile root = context.getFile();
-      VirtualFile link = parent.getChild(path);
-      for (LinkInfo li : links)
-      {
-         VirtualFile linkChild = link.getChild(li.name);
-         Closeable closeable = VFS.mountReal(new File(li.uri), linkChild);
-         // mount closeable to root for proper cleanup
-      }
-   }
-
-   public boolean isSupportsCandidateAnnotations()
-   {
-      return false;
-   }
-
-   public int getRelativeOrder()
-   {
-      return Integer.MIN_VALUE + 10;
-   }
-
-   public void setRelativeOrder(int order)
-   {
-   }
-
-   private static class LinkInfo
-   {
-      private String name;
-      private URI uri;
-
-      private LinkInfo(String name, URI uri)
-      {
-         this.name = name;
-         this.uri = uri;
-      }
-   }
-}

Copied: projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/link/VFSLinkStructureDeployer.java (from rev 111111, projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/link/VFSLinkStructureDeployer.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/link/VFSLinkStructureDeployer.java	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/link/VFSLinkStructureDeployer.java	2011-05-16 19:35:18 UTC (rev 111387)
@@ -0,0 +1,188 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.deployers.vfs.plugins.structure.link;
+
+import java.io.BufferedReader;
+import java.io.Closeable;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
+import org.jboss.deployers.vfs.spi.structure.StructureDeployer;
+import org.jboss.logging.Logger;
+import org.jboss.util.StringPropertyReplacer;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VFSUtils;
+import org.jboss.vfs.VirtualFile;
+
+/**
+ * .vfslink.properties feature port
+ * We don't recognize structure, we just prepare .vfslink.properties mounts.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class VFSLinkStructureDeployer implements StructureDeployer
+{
+   /** The log */
+   protected static final Logger log = Logger.getLogger("org.jboss.deployers.vfs.structure");
+
+   /** The link properties */
+   public static final String VFS_LINK_PROPERTIES_SUFFIX = ".vfslink.properties";
+   /** The link name */
+   public static final String VFS_LINK_NAME = "vfs.link.name";
+   /** The link target */
+   public static final String VFS_LINK_TARGET = "vfs.link.target";
+
+   public boolean determineStructure(StructureContext context) throws DeploymentException
+   {
+      VirtualFile root = context.getFile();
+      VirtualFile vfslinks = root.getChild("META-INF/jboss-vfslinks.txt");
+      if (vfslinks.exists())
+      {
+         try
+         {
+            InputStream is = vfslinks.openStream();
+            BufferedReader reader = new BufferedReader(new InputStreamReader(is));
+            try
+            {
+               String line;
+               while((line = reader.readLine()) != null)
+               {
+                  // ignore comments
+                  if (line.startsWith("#") == false)
+                     mountLinks(context, line);
+               }
+            }
+            finally
+            {
+               VFSUtils.safeClose(is);
+            }
+         }
+         catch (IOException e)
+         {
+            throw DeploymentException.rethrowAsDeploymentException("Cannot read jboss-vfslinks.txt", e);
+         }
+      }
+      return false;
+   }
+
+   protected void mountLinks(StructureContext context, String path) throws IOException
+   {
+      VirtualFile root = context.getFile();
+      VirtualFile link = root.getChild(path + VFS_LINK_PROPERTIES_SUFFIX);
+      if (link.exists())
+      {
+         List<LinkInfo> links = new ArrayList<LinkInfo>();
+         parseLinkProperties(link, links);
+         mountLinks(context, link.getParent(), path, links);
+      }
+      else
+      {
+         log.warn("No " + VFS_LINK_PROPERTIES_SUFFIX + " match for link: " + path);
+      }
+   }
+
+   protected void parseLinkProperties(VirtualFile link, List<LinkInfo> links) throws IOException
+   {
+      InputStream is = link.openStream();
+      try
+      {
+         Properties props = new Properties();
+         props.load(is);
+
+         for(int n = 0; ; n ++)
+         {
+            String nameKey = VFS_LINK_NAME + "." + n;
+            String name = props.getProperty(nameKey);
+            String uriKey = VFS_LINK_TARGET + "." + n;
+            String uri = props.getProperty(uriKey);
+            // End when the value is null since a link may not have a name
+            if (uri == null)
+            {
+               break;
+            }
+            // Replace any system property references
+            uri = StringPropertyReplacer.replaceProperties(uri);
+            LinkInfo li = new LinkInfo(name, new URI(uri));
+            links.add(li);
+         }
+      }
+      catch (URISyntaxException e)
+      {
+         IOException ioe = new IOException();
+         ioe.initCause(e);
+         throw ioe;
+      }
+      finally
+      {
+         VFSUtils.safeClose(is);
+      }
+   }
+
+   @SuppressWarnings({"UnusedDeclaration"})
+   protected void mountLinks(StructureContext context, VirtualFile parent, String path, List<LinkInfo> links) throws IOException
+   {
+      VirtualFile root = context.getFile();
+      VirtualFile link = parent.getChild(path);
+      for (LinkInfo li : links)
+      {
+         VirtualFile linkChild = link.getChild(li.name);
+         Closeable closeable = VFS.mountReal(new File(li.uri), linkChild);
+         // mount closeable to root for proper cleanup
+      }
+   }
+
+   public boolean isSupportsCandidateAnnotations()
+   {
+      return false;
+   }
+
+   public int getRelativeOrder()
+   {
+      return Integer.MIN_VALUE + 10;
+   }
+
+   public void setRelativeOrder(int order)
+   {
+   }
+
+   private static class LinkInfo
+   {
+      private String name;
+      private URI uri;
+
+      private LinkInfo(String name, URI uri)
+      {
+         this.name = name;
+         this.uri = uri;
+      }
+   }
+}

Modified: projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/ClassLoadingTestSuite.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/ClassLoadingTestSuite.java	2011-05-16 19:24:59 UTC (rev 111386)
+++ projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/ClassLoadingTestSuite.java	2011-05-16 19:35:18 UTC (rev 111387)
@@ -22,15 +22,15 @@
 
 package org.jboss.test.deployers.vfs.classloading;
 
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
 import org.jboss.test.deployers.vfs.classloading.test.ClassLoaderCachingTestCase;
 import org.jboss.test.deployers.vfs.classloading.test.ClassLoadingDomainMetaDataUnitTestCase;
+import org.jboss.test.deployers.vfs.classloading.test.ClassLoadingTranslatorsMetaDataUnitTestCase;
 import org.jboss.test.deployers.vfs.classloading.test.DeploymentMetaDataUnitTestCase;
 import org.jboss.test.deployers.vfs.classloading.test.ResourceLookupUnitTestCase;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
 /**
  * ClassLoading test suite.
  * 
@@ -48,6 +48,7 @@
       TestSuite suite = new TestSuite("VFS ClassLoading Tests");
 
       suite.addTest(DeploymentMetaDataUnitTestCase.suite());
+      suite.addTest(ClassLoadingTranslatorsMetaDataUnitTestCase.suite());
       suite.addTest(ClassLoadingDomainMetaDataUnitTestCase.suite());
       suite.addTest(ClassLoaderCachingTestCase.suite());
       suite.addTest(ResourceLookupUnitTestCase.suite());

Copied: projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/support/BableFish.java (from rev 111111, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/support/BableFish.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/support/BableFish.java	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/support/BableFish.java	2011-05-16 19:35:18 UTC (rev 111387)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.deployers.vfs.classloading.support;
+
+import java.lang.instrument.IllegalClassFormatException;
+import java.security.ProtectionDomain;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class BableFish
+{
+   public byte[] bable(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException
+   {
+      return classfileBuffer;
+   }
+}

Copied: projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/support/IATranslator.java (from rev 111111, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/support/IATranslator.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/support/IATranslator.java	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/support/IATranslator.java	2011-05-16 19:35:18 UTC (rev 111387)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.deployers.vfs.classloading.support;
+
+import java.lang.instrument.ClassFileTransformer;
+import java.lang.instrument.IllegalClassFormatException;
+import java.security.ProtectionDomain;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class IATranslator implements ClassFileTransformer
+{
+   public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException
+   {
+      return classfileBuffer;
+   }
+}

Copied: projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/support/MockTranslator.java (from rev 111111, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/support/MockTranslator.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/support/MockTranslator.java	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/support/MockTranslator.java	2011-05-16 19:35:18 UTC (rev 111387)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.deployers.vfs.classloading.support;
+
+import java.security.ProtectionDomain;
+
+import org.jboss.util.loading.Translator;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class MockTranslator implements Translator
+{
+   public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws Exception
+   {
+      return classfileBuffer;
+   }
+
+   public void unregisterClassLoader(ClassLoader loader)
+   {
+   }
+}

Copied: projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/test/ClassLoadingTranslatorsMetaDataUnitTestCase.java (from rev 111111, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/test/ClassLoadingTranslatorsMetaDataUnitTestCase.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/test/ClassLoadingTranslatorsMetaDataUnitTestCase.java	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classloading/test/ClassLoadingTranslatorsMetaDataUnitTestCase.java	2011-05-16 19:35:18 UTC (rev 111387)
@@ -0,0 +1,80 @@
+/*
+* 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.test.deployers.vfs.classloading.test;
+
+import java.util.List;
+
+import junit.framework.Test;
+import org.jboss.classloader.spi.ClassLoaderDomain;
+import org.jboss.classloader.spi.ClassLoaderPolicy;
+import org.jboss.classloader.spi.ClassLoaderSystem;
+import org.jboss.classloading.spi.dependency.Module;
+import org.jboss.classloading.spi.dependency.policy.ClassLoaderPolicyModule;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.test.deployers.BootstrapDeployersTest;
+import org.jboss.util.loading.Translator;
+
+/**
+ * ClassLoadingTranslators metadata test case.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class ClassLoadingTranslatorsMetaDataUnitTestCase extends BootstrapDeployersTest
+{
+   public ClassLoadingTranslatorsMetaDataUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(ClassLoadingTranslatorsMetaDataUnitTestCase.class);
+   }
+
+   public void testDeployer() throws Exception
+   {
+      DeploymentUnit du = addDeployment("/classloading", "translator");
+      try
+      {
+         ClassLoaderSystem system = (ClassLoaderSystem) getBean("ClassLoaderSystem", ControllerState.INSTALLED);
+         assertTranslators(system.getTranslators(), 1);
+
+         ClassLoaderDomain domain = system.getDefaultDomain();
+         assertTranslators(domain.getTranslators(), 1);
+
+         ClassLoaderPolicyModule module = du.getAttachment(Module.class.getName(), ClassLoaderPolicyModule.class);
+         ClassLoaderPolicy policy = module.getPolicy();
+         assertTranslators(policy.getTranslators(), 1);
+      }
+      finally
+      {
+         undeploy(du);
+      }
+   }
+
+   protected void assertTranslators(List<Translator> translators, int size)
+   {
+      assertNotNull(translators);
+      assertEquals(size, translators.size());
+   }
+}
\ No newline at end of file

Modified: projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/resources/bootstrap/bootstrap.xml
===================================================================
--- projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/resources/bootstrap/bootstrap.xml	2011-05-16 19:24:59 UTC (rev 111386)
+++ projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/resources/bootstrap/bootstrap.xml	2011-05-16 19:35:18 UTC (rev 111387)
@@ -114,6 +114,15 @@
       <property name="buildManagedObject">true</property>
       <property name="registerWithJBossXB">true</property>
    </bean>
+   <bean name="ClassLoadingTranslatorsMetaDataParser" class="org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer">
+      <constructor>
+         <parameter>org.jboss.classloading.spi.metadata.ClassLoadingTranslatorsMetaData10</parameter>
+      </constructor>
+      <property name="attachmentKey">org.jboss.classloading.spi.metadata.ClassLoadingTranslatorsMetaData</property>
+      <property name="name">jboss-translator.xml</property>
+      <property name="buildManagedObject">true</property>
+      <property name="registerWithJBossXB">true</property>
+   </bean>
    <bean name="DeploymentMetaDataParser" class="org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer">
       <constructor>
          <parameter>org.jboss.deployers.spi.classloading.DeploymentMetaData</parameter>
@@ -142,4 +151,7 @@
       <property name="classLoading"><inject bean="ClassLoading"/></property>
       <property name="system"><inject bean="ClassLoaderSystem"/></property>
    </bean>
+   <bean name="ClassLoaderTranslatorDeployer" class="org.jboss.deployers.plugins.classloading.AbstractTranslatorsDeployer">
+      <property name="system"><inject bean="ClassLoaderSystem"/></property>
+   </bean>
 </deployment>

Deleted: projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/resources/classloading/translator/META-INF/jboss-translator.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/classloading/translator/META-INF/jboss-translator.xml	2011-04-06 20:40:01 UTC (rev 111111)
+++ projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/resources/classloading/translator/META-INF/jboss-translator.xml	2011-05-16 19:35:18 UTC (rev 111387)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<classloading-translators xmlns="urn:jboss:classloading-translators:1.0">
-    <translator class="org.jboss.test.deployers.vfs.classloading.support.MockTranslator" scope="DOMAIN" />
-    <translator class="org.jboss.test.deployers.vfs.classloading.support.IATranslator" method="transform" scope="POLICY" />
-    <translator class="org.jboss.test.deployers.vfs.classloading.support.BableFish" method="bable" scope="SYSTEM" />
-</classloading-translators>

Copied: projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/resources/classloading/translator/META-INF/jboss-translator.xml (from rev 111111, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/classloading/translator/META-INF/jboss-translator.xml)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/resources/classloading/translator/META-INF/jboss-translator.xml	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_2/deployers-vfs/src/test/resources/classloading/translator/META-INF/jboss-translator.xml	2011-05-16 19:35:18 UTC (rev 111387)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<classloading-translators xmlns="urn:jboss:classloading-translators:1.0">
+    <translator class="org.jboss.test.deployers.vfs.classloading.support.MockTranslator" scope="DOMAIN" />
+    <translator class="org.jboss.test.deployers.vfs.classloading.support.IATranslator" method="transform" scope="POLICY" />
+    <translator class="org.jboss.test.deployers.vfs.classloading.support.BableFish" method="bable" scope="SYSTEM" />
+</classloading-translators>

Modified: projects/jboss-deployers/branches/Branch_2_2/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_2/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java	2011-05-16 19:24:59 UTC (rev 111386)
+++ projects/jboss-deployers/branches/Branch_2_2/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java	2011-05-16 19:35:18 UTC (rev 111387)
@@ -21,14 +21,18 @@
 */
 package org.jboss.deployers.vfs.spi.structure.helpers;
 
-import java.io.IOException;
 import java.lang.annotation.Annotation;
 import java.util.ArrayList;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
 
-import org.jboss.deployers.spi.structure.*;
+import org.jboss.deployers.spi.structure.ClassPathEntry;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.MetaDataEntry;
+import org.jboss.deployers.spi.structure.MetaDataType;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.deployers.spi.structure.StructureMetaDataFactory;
 import org.jboss.deployers.vfs.spi.structure.CandidateAnnotationsCallback;
 import org.jboss.deployers.vfs.spi.structure.StructureContext;
 import org.jboss.deployers.vfs.spi.structure.StructureDeployer;
@@ -228,7 +232,6 @@
     * @param includeRootManifestCP - a flag indicating if the entry metainf
     *    manifest classpath should be included.
     * @param context - the context to populate
-    * @throws IOException on any IO error
     */
    protected void addClassPath(StructureContext structureContext, VirtualFile entry, boolean includeEntry, boolean includeRootManifestCP, ContextInfo context)
    {
@@ -381,7 +384,6 @@
     * 
     * @param file the virtual file
     * @return true when it is a leaf
-    * @throws IOException for any error
     */
    protected static boolean isLeaf(VirtualFile file)
    {
@@ -548,7 +550,7 @@
    {
       if (result != null && contextInfoOrder != null)
       {
-         result.setRelativeOrder(contextInfoOrder.intValue());
+         result.setRelativeOrder(contextInfoOrder);
       }
    }
 }

Modified: projects/jboss-deployers/branches/Branch_2_2/pom.xml
===================================================================
--- projects/jboss-deployers/branches/Branch_2_2/pom.xml	2011-05-16 19:24:59 UTC (rev 111386)
+++ projects/jboss-deployers/branches/Branch_2_2/pom.xml	2011-05-16 19:35:18 UTC (rev 111387)
@@ -27,7 +27,7 @@
     <version.jboss.man>2.1.1.SP2</version.jboss.man>
     <version.jboss.mdr>2.2.0.SP1</version.jboss.mdr>
     <version.jboss.kernel>2.2.0.SP1</version.jboss.kernel>
-    <version.jboss.classloader>2.2.0.GA</version.jboss.classloader>
+    <version.jboss.classloader>2.2.0-SNAPSHOT</version.jboss.classloader>
     <version.jboss.scanning>1.0.0.Alpha6</version.jboss.scanning>
     <version.jboss.classloading.spi>6.0.0-Alpha8</version.jboss.classloading.spi>
     <version.jboss.common.core>2.2.17.GA</version.jboss.common.core>



More information about the jboss-cvs-commits mailing list