[jboss-cvs] JBossAS SVN: r103834 - in projects/profileservice/trunk: core/src/main/java/org/jboss/profileservice/deployment and 11 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Apr 12 10:38:59 EDT 2010


Author: emuckenhuber
Date: 2010-04-12 10:38:57 -0400 (Mon, 12 Apr 2010)
New Revision: 103834

Added:
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/support/StructureMetaDataBuilder.java
Removed:
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/plugin/ClassPathProfileMetaData.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/plugin/ClassPathAdapterProfile.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/StructureMetaDataBuilder.java
Modified:
   projects/profileservice/trunk/core/pom.xml
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/AbstractProfileDeployment.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScanner.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/AbstractProfileKeyCapability.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/AbstractSubProfileKeyMetaData.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/LocalFileArtifactRepository.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/maven/MavenArtifact.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/AbstractVirtualAssemblyContext.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/domain/support/DomainMetaDataRepoSupport.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/support/VDFDeploymentBuilder.java
   projects/profileservice/trunk/persistence/src/test/java/org/jboss/test/profileservice/component/persistence/test/AbstractComponentMapperTest.java
Log:
move deployers dependency to test scope

Modified: projects/profileservice/trunk/core/pom.xml
===================================================================
--- projects/profileservice/trunk/core/pom.xml	2010-04-12 14:25:29 UTC (rev 103833)
+++ projects/profileservice/trunk/core/pom.xml	2010-04-12 14:38:57 UTC (rev 103834)
@@ -16,22 +16,27 @@
 	<dependencies>
 
 		<dependency>
+			<groupId>org.jboss</groupId>
+			<artifactId>jboss-vfs</artifactId>
+		</dependency>
+
+		<dependency>
 			<groupId>org.jboss.deployers</groupId>
 			<artifactId>jboss-deployers-vfs</artifactId>
 			<version>${version.org.jboss.deployers}</version>
-			<scope>compile</scope>
+			<scope>test</scope>
 		</dependency>
 
 		<dependency>
 			<groupId>org.jboss.kernel</groupId>
 			<artifactId>jboss-dependency</artifactId>
-			<scope>provided</scope>
+			<scope>compile</scope>
 		</dependency>
 
 		<dependency>
 			<groupId>org.jboss.kernel</groupId>
 			<artifactId>jboss-kernel</artifactId>
-			<scope>provided</scope>
+			<scope>compile</scope>
 		</dependency>
 
 		<dependency>

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/AbstractProfileDeployment.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/AbstractProfileDeployment.java	2010-04-12 14:25:29 UTC (rev 103833)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/AbstractProfileDeployment.java	2010-04-12 14:38:57 UTC (rev 103834)
@@ -22,13 +22,12 @@
 package org.jboss.profileservice.deployment;
 
 import java.io.Closeable;
-import java.io.IOException;
 
-import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.profileservice.spi.ProfileDeployment;
 import org.jboss.profileservice.spi.deployment.DeploymentAttachments;
 import org.jboss.profileservice.spi.deployment.ProfileDeploymentInfo;
 import org.jboss.profileservice.spi.virtual.VirtualDeploymentMetaData;
+import org.jboss.vfs.VFSUtils;
 import org.jboss.vfs.VirtualFile;
 
 /**
@@ -178,9 +177,7 @@
       {
          if(o instanceof Closeable)
          {
-            try {
-               Closeable.class.cast(o).close();
-            } catch(IOException ignore) { }
+              VFSUtils.safeClose(Closeable.class.cast(o));
          }
       }
    }

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScanner.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScanner.java	2010-04-12 14:25:29 UTC (rev 103833)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScanner.java	2010-04-12 14:38:57 UTC (rev 103834)
@@ -25,7 +25,6 @@
 import java.util.Collection;
 import java.util.Collections;
 
-import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.logging.Logger;
 import org.jboss.profileservice.spi.ModificationInfo;
 import org.jboss.profileservice.spi.MutableProfile;
@@ -229,7 +228,7 @@
                      break;
                }
             }
-            catch(DeploymentException e)
+            catch(Exception e)
             {
                log.warn("Failed to add deployment: " + ctx.getName(), e);
             }

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/AbstractProfileKeyCapability.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/AbstractProfileKeyCapability.java	2010-04-12 14:25:29 UTC (rev 103833)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/AbstractProfileKeyCapability.java	2010-04-12 14:38:57 UTC (rev 103834)
@@ -66,8 +66,6 @@
          return false;
       return super.equals(obj);
    }
-   
 
-
 }
 

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/AbstractSubProfileKeyMetaData.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/AbstractSubProfileKeyMetaData.java	2010-04-12 14:25:29 UTC (rev 103833)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/AbstractSubProfileKeyMetaData.java	2010-04-12 14:38:57 UTC (rev 103834)
@@ -21,7 +21,6 @@
  */ 
 package org.jboss.profileservice.profile.metadata.helpers;
 
-import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.dependency.ProfileRequirement;
 import org.jboss.profileservice.spi.metadata.ProfileMetaDataVisitor;
 import org.jboss.profileservice.spi.metadata.SubProfileMetaData;

Deleted: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/plugin/ClassPathProfileMetaData.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/plugin/ClassPathProfileMetaData.java	2010-04-12 14:25:29 UTC (rev 103833)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/plugin/ClassPathProfileMetaData.java	2010-04-12 14:38:57 UTC (rev 103834)
@@ -1,165 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, 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.profileservice.profile.metadata.plugin;
-
-import java.util.Collections;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlNsForm;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-
-import org.jboss.profileservice.domain.spi.DomainMetaDataFragment;
-import org.jboss.profileservice.domain.spi.DomainMetaDataFragmentVisitor;
-import org.jboss.profileservice.profile.metadata.CommonProfileNameSpaces;
-import org.jboss.profileservice.profile.metadata.helpers.AbstractProfileMetaData;
-import org.jboss.profileservice.repository.artifact.file.FileArtifactId;
-import org.jboss.profileservice.spi.metadata.ProfileDeploymentMetaData;
-import org.jboss.profileservice.spi.metadata.ProfileMetaDataVisitor;
-import org.jboss.profileservice.spi.metadata.ProfileSourceMetaData;
-import org.jboss.profileservice.spi.repository.ArtifactId;
-import org.jboss.profileservice.spi.virtual.VirtualArtifactMetaData;
-import org.jboss.profileservice.spi.virtual.VirtualDeploymentMetaData;
-import org.jboss.xb.annotations.JBossXmlSchema;
-
-/**
- * TODO does this make sense ?
- * 
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
- at JBossXmlSchema(namespace=CommonProfileNameSpaces.CLASSPATH_PROFILE_NAMESPACE,
-      elementFormDefault=XmlNsForm.QUALIFIED,
-      normalizeSpace=true,
-      replacePropertyRefs=true)
- at XmlRootElement(name = "classpath")
- at XmlType(name = "classpathProfileType", propOrder = "deployments")
-public class ClassPathProfileMetaData extends AbstractProfileMetaData implements DomainMetaDataFragment
-{
-
-   /** The system classpath items. */
-   private List<ClassPathItem> classPathItems; 
-   
-   @Override
-   @XmlAttribute(name = "name")
-   public String getName()
-   {
-      return super.getName();
-   }
-   
-   @Override
-   public String getNameSpace()
-   {
-      return CommonProfileNameSpaces.CLASSPATH_PROFILE_NAMESPACE;
-   }
-
-   @Override
-   public void visit(DomainMetaDataFragmentVisitor visitor)
-   {
-      visitor.addProfileMetaData(this);
-   }
-
-   @Override
-   @XmlElement(name = "source", type = ClassPathItem.class)
-   public List<ClassPathItem> getDeployments()
-   {
-      return classPathItems;
-   }
-   
-   public void setDeployments(List<ClassPathItem> classPathItems)
-   {
-      this.classPathItems = classPathItems;
-   }
-
-   @Override
-   @XmlTransient
-   public ProfileSourceMetaData getSource()
-   {
-      return null;
-   }
-
-   public static class ClassPathItem implements ProfileDeploymentMetaData
-   {
-      private String path;
-      private String archives;
-      
-      @XmlAttribute(name = "path")
-      public String getPath()
-      {
-         return path;
-      }
-      public void setPath(String path)
-      {
-         this.path = path;
-      }
-      
-      @XmlAttribute(name = "archives")
-      public String getArchives()
-      {
-         return archives;
-      }
-      public void setArchives(String archives)
-      {
-         this.archives = archives;
-      }
-      
-      @Override
-      @XmlTransient
-      public String getName()
-      {
-         // TODO
-         return getPath();
-      }
-      
-      @Override
-      @XmlTransient
-      public ArtifactId getArtifact()
-      {
-         return new FileArtifactId(getPath());
-      }
-      
-      @Override
-      @XmlTransient
-      public List<VirtualArtifactMetaData> getArtifacts()
-      {
-         return Collections.emptyList();
-      }
-      
-      @Override
-      @XmlTransient
-      public List<VirtualDeploymentMetaData> getChildren()
-      {
-         return Collections.emptyList();
-      }
-      
-      @Override
-      public void visit(ProfileMetaDataVisitor visitor)
-      {
-         // nothing
-      }
-   }
-   
-}
-

Deleted: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/plugin/ClassPathAdapterProfile.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/plugin/ClassPathAdapterProfile.java	2010-04-12 14:25:29 UTC (rev 103833)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/plugin/ClassPathAdapterProfile.java	2010-04-12 14:38:57 UTC (rev 103834)
@@ -1,204 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, 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.profileservice.profile.plugin;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
-import org.jboss.classloading.spi.vfs.metadata.VFSClassLoaderFactory10;
-import org.jboss.logging.Logger;
-import org.jboss.profileservice.profile.metadata.plugin.ClassPathProfileMetaData.ClassPathItem;
-import org.jboss.profileservice.repository.ProfileDeploymentFactory;
-import org.jboss.profileservice.spi.NoSuchDeploymentException;
-import org.jboss.profileservice.spi.Profile;
-import org.jboss.profileservice.spi.ProfileDeployment;
-import org.jboss.profileservice.spi.ProfileKey;
-import org.jboss.vfs.VFS;
-import org.jboss.vfs.VirtualFile;
-import org.jboss.vfs.VirtualFileFilter;
-
-/**
- * ClassPath adapter profile. 
- * 
- * FIXME - test if this actually works
- * 
- * TODO - does this really make sense as profile?
- * at least we need to move this out of the profileservice codebase. 
- * 
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class ClassPathAdapterProfile implements Profile
-{
-
-   private static final Logger log = Logger.getLogger(ClassPathAdapterProfile.class);
-   private final ProfileKey key;
-   private final String deploymentName; 
-   private final List<ClassPathItem> items;
-   private final long lastModified;
-   private ProfileDeployment classPathDeployment;
-   
-   public ClassPathAdapterProfile(ProfileKey key, List<ClassPathItem> items)
-   {
-      if(key == null)
-      {
-         throw new IllegalArgumentException("null profile key");
-      }
-      this.key = key;
-      this.deploymentName = key.getName();
-      this.items = items;
-      this.lastModified = System.currentTimeMillis();
-   }
-   
-   public void create() throws Exception
-   {
-      List<VirtualFile> classpath = determineRoots();
-      List<String> roots = new ArrayList<String>();
-      for(VirtualFile vf : classpath)
-      {
-         roots.add(vf.toURI().toString());
-      }
-      VFSClassLoaderFactory10 clMetaData = new VFSClassLoaderFactory10();
-      clMetaData.setRoots(roots);
-      // Create deployment
-      classPathDeployment = ProfileDeploymentFactory.getInstance().createDeployment(deploymentName);
-      classPathDeployment.getPredeterminedAttachments().putAttachment(ClassLoadingMetaData.class.getName(), clMetaData);
-   }
-   
-   @Override
-   public ProfileDeployment getDeployment(String name) throws NoSuchDeploymentException
-   {
-      if(deploymentName.equals(name))
-      {
-         return classPathDeployment;
-      }
-      throw new NoSuchDeploymentException(name);
-   }
-
-   @Override
-   public Set<String> getDeploymentNames()
-   {
-      return Collections.singleton(deploymentName);
-   }
-
-   @Override
-   public Collection<ProfileDeployment> getDeployments()
-   {
-      return Collections.singleton(classPathDeployment);
-   }
-
-   @Override
-   public ProfileKey getKey()
-   {
-      return key;
-   }
-
-   @Override
-   public long getLastModified()
-   {
-      return this.lastModified;
-   }
-
-   @Override
-   public boolean hasDeployment(String name)
-   {
-      return false;
-   }
-
-   @Override
-   public boolean isMutable()
-   {
-      return false;
-   }
-   
-   protected List<VirtualFile> determineRoots() throws IOException, URISyntaxException
-   {
-      List<VirtualFile> classpath = new ArrayList<VirtualFile>();
-      for(ClassPathItem item : items)
-      {
-         URI uri = new URI(item.getPath());
-         
-         String codebase = item.getPath();
-         String archives = item.getArchives();
-
-         log.debug("Processing classpath: codebase=" + codebase + " archives=" + archives);
-         VirtualFile codebaseFile = VFS.getChild(uri);
-         if (codebaseFile == null)
-            throw new RuntimeException("Cannot use classpath without a root: " + uri);
-
-         if (archives == null)
-         {
-            classpath.add(codebaseFile);
-         }
-         else
-         {
-            ClassPathFilter filter = new ClassPathFilter(archives);
-            List<VirtualFile> archiveFiles = codebaseFile.getChildren(filter);
-            classpath.addAll(archiveFiles);
-         }
-      }
-      return classpath;
-   }
-
-   static class ClassPathFilter implements VirtualFileFilter
-   {
-      /** The patterns */
-      private final Set<String> patterns;
-      
-      /** Whether there is the accept all wildcard */
-      private final boolean allowAll;
-
-      public ClassPathFilter(String patternsString)
-      {
-         if (patternsString == null)
-            throw new IllegalArgumentException("Null patternsString");
-
-         StringTokenizer tokens = new StringTokenizer (patternsString, ",");
-         patterns = new HashSet<String>(tokens.countTokens());
-         for (int i=0; tokens.hasMoreTokens (); ++i)
-         {
-            String token = tokens.nextToken();
-            patterns.add(token.trim());
-         }
-         allowAll = patterns.contains("*");
-      }
-      
-      public boolean accepts(VirtualFile file)
-      {
-         if (allowAll)
-            return true;
-         return patterns.contains(file.getName());
-      }
-   }
-   
-
-}
-

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/LocalFileArtifactRepository.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/LocalFileArtifactRepository.java	2010-04-12 14:25:29 UTC (rev 103833)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/LocalFileArtifactRepository.java	2010-04-12 14:38:57 UTC (rev 103834)
@@ -264,6 +264,14 @@
       }
    }
 
+   /**
+    * Get the artifact file.
+    * 
+    * @param artifact the artifact id
+    * @param checkExist fail if does not exist
+    * @return the virtual file
+    * @throws IOException 
+    */
    protected VirtualFile getArtifactFile(FileArtifactId artifact, boolean checkExist) throws IOException
    {
       validateArtifactID(artifact);

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/maven/MavenArtifact.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/maven/MavenArtifact.java	2010-04-12 14:25:29 UTC (rev 103833)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/maven/MavenArtifact.java	2010-04-12 14:38:57 UTC (rev 103834)
@@ -44,8 +44,7 @@
    {
       return (MavenArtifactMetaData) super.getIdentifier();
    }
-   
-   
+
    public String getRelativePath()
    {
       try

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/AbstractVirtualAssemblyContext.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/AbstractVirtualAssemblyContext.java	2010-04-12 14:25:29 UTC (rev 103833)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/AbstractVirtualAssemblyContext.java	2010-04-12 14:38:57 UTC (rev 103834)
@@ -43,7 +43,7 @@
    /** The child contexts. */
    private final List<VirtualDeploymentAssemblyContext> children = new ArrayList<VirtualDeploymentAssemblyContext>();
    
-   protected List<VirtualDeploymentAssemblyContext> getChildren()
+   public List<VirtualDeploymentAssemblyContext> getChildren()
    {
       return children;
    }

Deleted: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/StructureMetaDataBuilder.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/StructureMetaDataBuilder.java	2010-04-12 14:25:29 UTC (rev 103833)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/StructureMetaDataBuilder.java	2010-04-12 14:38:57 UTC (rev 103834)
@@ -1,104 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.profileservice.virtual.assembly;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.jboss.deployers.client.spi.Deployment;
-import org.jboss.deployers.client.spi.DeploymentFactory;
-import org.jboss.deployers.spi.structure.ClassPathEntry;
-import org.jboss.deployers.spi.structure.ContextInfo;
-import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
-import org.jboss.profileservice.deployment.DeploymentBuilder.DeploymentAttachmentsProcessor;
-import org.jboss.profileservice.spi.ProfileDeployment;
-import org.jboss.profileservice.spi.virtual.assembly.VirtualDeploymentAssemblyContext;
-
-/**
- * The structure meta data builder.
- * 
- * TODO move this out of the profileservice project.
- * 
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class StructureMetaDataBuilder implements DeploymentAttachmentsProcessor<Deployment>
-{
-
-   /** The deployment factory. */
-   private static final DeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
-   
-   public void processDeployment(ProfileDeployment deployment, Deployment target)
-   {
-      // Get the assembly context
-      VirtualDeploymentAssemblyContext ctx = deployment.getTransientAttachments().getAttachment(
-            VirtualDeploymentAssemblyContext.class.getName(), VirtualDeploymentAssemblyContext.class);
-      
-      // Create the structure meta data
-      if(ctx != null)
-      {
-         createStructureMetaData(target, "", ctx);
-      }
-   }
-   
-   protected ContextInfo createStructureMetaData(Deployment deployment, String path, VirtualDeploymentAssemblyContext ctx)
-   {
-      if(ctx instanceof BasicVirtualAssemblyContext)
-      {
-         return createStructureMetaData(deployment, path, (BasicVirtualAssemblyContext) ctx);
-      }
-      return null;
-   }
-   
-   protected ContextInfo createStructureMetaData(Deployment deployment, String path, BasicVirtualAssemblyContext ctx)
-   {
-      List<String> metaDataLocations = Collections.singletonList(BasicVirtualAssemblyContext.META_INF);
-      List<ClassPathEntry> classPathEntries = getClassPathEntries(ctx);
-      
-      ContextInfo info = deploymentFactory.addContext(deployment, path, metaDataLocations, classPathEntries);
-      if(ctx.getChildren() != null && ctx.getChildren().isEmpty() == false)
-      {
-         for(VirtualDeploymentAssemblyContext child : ctx.getChildren())
-         {
-            String childPath = child.getRoot().getName();
-            createStructureMetaData(deployment, childPath, child);
-         }
-      }
-      return info;
-   }
-   
-   protected List<ClassPathEntry> getClassPathEntries(BasicVirtualAssemblyContext ctx)
-   {
-      List<ClassPathEntry> entries = new ArrayList<ClassPathEntry>();
-      if(ctx.getRoots() != null && ctx.getRoots().isEmpty() == false)
-      {
-         for(String s : ctx.getRoots())
-         {
-            entries.add(VFSDeploymentFactory.createClassPathEntry(s));
-         }
-      }
-      return entries;
-   }
-   
-}
-

Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/domain/support/DomainMetaDataRepoSupport.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/domain/support/DomainMetaDataRepoSupport.java	2010-04-12 14:25:29 UTC (rev 103833)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/domain/support/DomainMetaDataRepoSupport.java	2010-04-12 14:38:57 UTC (rev 103834)
@@ -30,7 +30,6 @@
 import org.jboss.profileservice.profile.metadata.BasicProfileMetaData;
 import org.jboss.profileservice.profile.metadata.CommonProfileNameSpaces;
 import org.jboss.profileservice.profile.metadata.domain.RequiredProfiles;
-import org.jboss.profileservice.profile.metadata.plugin.ClassPathProfileMetaData;
 import org.jboss.profileservice.profile.metadata.plugin.FarmingProfileMetaData;
 import org.jboss.profileservice.profile.metadata.plugin.HotDeploymentProfileMetaData;
 import org.jboss.profileservice.profile.metadata.plugin.PropertyProfileMetaData;
@@ -55,7 +54,6 @@
       // initialize the schema binding     
       addSchemaBinding(CommonProfileNameSpaces.BOOTSTRAP_PROFILE_NAMESPACE, BootstrapProfileMetaData.class);
       addSchemaBinding(CommonProfileNameSpaces.PROFILE_NAMESPACE, BasicProfileMetaData.class);
-      addSchemaBinding(CommonProfileNameSpaces.CLASSPATH_PROFILE_NAMESPACE, ClassPathProfileMetaData.class);
       addSchemaBinding(CommonProfileNameSpaces.REQUIRED_PROFILE_NAMESPACE, RequiredProfiles.class);
       addSchemaBinding(CommonProfileNameSpaces.HOTDEPLOY_PROFILE_NAMESPACE, HotDeploymentProfileMetaData.class);
       addSchemaBinding(CommonProfileNameSpaces.IMMUTABLE_PROFILE_NAMESPACE, PropertyProfileMetaData.class);

Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/support/VDFDeploymentBuilder.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/support/VDFDeploymentBuilder.java	2010-04-12 14:25:29 UTC (rev 103833)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/support/VDFDeploymentBuilder.java	2010-04-12 14:38:57 UTC (rev 103834)
@@ -29,7 +29,7 @@
 import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
 import org.jboss.profileservice.deployment.DeploymentBuilder;
 import org.jboss.profileservice.spi.ProfileDeployment;
-import org.jboss.profileservice.virtual.assembly.StructureMetaDataBuilder;
+import org.jboss.test.profileservice.virtual.support.StructureMetaDataBuilder;
 
 
 /**

Copied: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/support/StructureMetaDataBuilder.java (from rev 103813, projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/StructureMetaDataBuilder.java)
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/support/StructureMetaDataBuilder.java	                        (rev 0)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/support/StructureMetaDataBuilder.java	2010-04-12 14:38:57 UTC (rev 103834)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.profileservice.virtual.support;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.client.spi.DeploymentFactory;
+import org.jboss.deployers.spi.structure.ClassPathEntry;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.profileservice.deployment.DeploymentBuilder.DeploymentAttachmentsProcessor;
+import org.jboss.profileservice.spi.ProfileDeployment;
+import org.jboss.profileservice.spi.virtual.assembly.VirtualDeploymentAssemblyContext;
+import org.jboss.profileservice.virtual.assembly.BasicVirtualAssemblyContext;
+
+/**
+ * The structure meta data builder.
+ * 
+ * TODO move this out of the profileservice project.
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class StructureMetaDataBuilder implements DeploymentAttachmentsProcessor<Deployment>
+{
+
+   /** The deployment factory. */
+   private static final DeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
+   
+   public void processDeployment(ProfileDeployment deployment, Deployment target)
+   {
+      // Get the assembly context
+      VirtualDeploymentAssemblyContext ctx = deployment.getTransientAttachments().getAttachment(
+            VirtualDeploymentAssemblyContext.class.getName(), VirtualDeploymentAssemblyContext.class);
+      
+      // Create the structure meta data
+      if(ctx != null)
+      {
+         createStructureMetaData(target, "", ctx);
+      }
+   }
+   
+   protected ContextInfo createStructureMetaData(Deployment deployment, String path, VirtualDeploymentAssemblyContext ctx)
+   {
+      if(ctx instanceof BasicVirtualAssemblyContext)
+      {
+         return createStructureMetaData(deployment, path, (BasicVirtualAssemblyContext) ctx);
+      }
+      return null;
+   }
+   
+   protected ContextInfo createStructureMetaData(Deployment deployment, String path, BasicVirtualAssemblyContext ctx)
+   {
+      List<String> metaDataLocations = Collections.singletonList(BasicVirtualAssemblyContext.META_INF);
+      List<ClassPathEntry> classPathEntries = getClassPathEntries(ctx);
+      
+      ContextInfo info = deploymentFactory.addContext(deployment, path, metaDataLocations, classPathEntries);
+      if(ctx.getChildren() != null && ctx.getChildren().isEmpty() == false)
+      {
+         for(VirtualDeploymentAssemblyContext child : ctx.getChildren())
+         {
+            String childPath = child.getRoot().getName();
+            createStructureMetaData(deployment, childPath, child);
+         }
+      }
+      return info;
+   }
+   
+   protected List<ClassPathEntry> getClassPathEntries(BasicVirtualAssemblyContext ctx)
+   {
+      List<ClassPathEntry> entries = new ArrayList<ClassPathEntry>();
+      if(ctx.getRoots() != null && ctx.getRoots().isEmpty() == false)
+      {
+         for(String s : ctx.getRoots())
+         {
+            entries.add(VFSDeploymentFactory.createClassPathEntry(s));
+         }
+      }
+      return entries;
+   }
+   
+}
+

Modified: projects/profileservice/trunk/persistence/src/test/java/org/jboss/test/profileservice/component/persistence/test/AbstractComponentMapperTest.java
===================================================================
--- projects/profileservice/trunk/persistence/src/test/java/org/jboss/test/profileservice/component/persistence/test/AbstractComponentMapperTest.java	2010-04-12 14:25:29 UTC (rev 103833)
+++ projects/profileservice/trunk/persistence/src/test/java/org/jboss/test/profileservice/component/persistence/test/AbstractComponentMapperTest.java	2010-04-12 14:38:57 UTC (rev 103834)
@@ -39,7 +39,7 @@
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
  */
-public class AbstractComponentMapperTest extends TestCase
+public abstract class AbstractComponentMapperTest extends TestCase
 {
 
    /** The managed object factory. */




More information about the jboss-cvs-commits mailing list