[jboss-cvs] JBossAS SVN: r103034 - in projects/profileservice/trunk: core/src/main/java/org/jboss/profileservice/bootstrap and 17 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Mar 26 07:35:41 EDT 2010


Author: emuckenhuber
Date: 2010-03-26 07:35:40 -0400 (Fri, 26 Mar 2010)
New Revision: 103034

Added:
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/ProfileActivationCallback.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/domain/BasicDomainMetaDataVisitor.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/ProfileMetaDataFactory.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/resolver/BasicResolverFactory.java
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/RemoveComponentAction.java
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/UpdateComponentAction.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/managed/ManagedProfileConfiguration.java
Modified:
   projects/profileservice/trunk/core/pom.xml
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/AbstractProfileServiceBootstrap.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/AbstractProfileServiceInitializer.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileServiceController.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/ProfileDeployerPluginRegistry.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/AbstractHDScannerFactory.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScannerFactory.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/metadata/ProfileConfigurationExt.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/metadata/ProfileMetaDataFactory.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/MutableScanningProfile.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/ScanningProfileFactory.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/BasicSubProfileMetaData.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/FileRepositorySourceConfiguration.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/AbstractProfileKeyMetaData.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/NoopVirtualDeploymentMetaData.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/ProfileDeploymentFactory.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/AbstractArtifactRepository.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/BasicRepositoryConfiguration.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/FileArtifactRepositoryFactory.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/MutableFileArtifactRepository.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/virtual/AbstractVirtualProfileFactory.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/version/Version.java
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/TransientProfileActivator.java
Log:
wip

Modified: projects/profileservice/trunk/core/pom.xml
===================================================================
--- projects/profileservice/trunk/core/pom.xml	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/pom.xml	2010-03-26 11:35:40 UTC (rev 103034)
@@ -42,6 +42,12 @@
 
 		<dependency>
 			<groupId>org.jboss.profileservice</groupId>
+			<artifactId>jboss-profileservice-persistence</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.jboss.profileservice</groupId>
 			<artifactId>jboss-profileservice-spi</artifactId>
 			<version>${project.parent.version}</version>
 		</dependency>

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/AbstractProfileServiceBootstrap.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/AbstractProfileServiceBootstrap.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/AbstractProfileServiceBootstrap.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -21,13 +21,23 @@
  */ 
 package org.jboss.profileservice.bootstrap;
 
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 
 import org.jboss.kernel.Kernel;
+import org.jboss.logging.Logger;
 import org.jboss.profileservice.config.ProfileServiceConfig;
 import org.jboss.profileservice.domain.AbstractDomainMetaData;
 import org.jboss.profileservice.domain.spi.DomainFeatureNode;
+import org.jboss.profileservice.domain.spi.DomainMetaData;
+import org.jboss.profileservice.profile.metadata.domain.BasicDomainMetaDataVisitor;
+import org.jboss.profileservice.resolver.BasicResolverFactory;
+import org.jboss.profileservice.spi.NoSuchProfileException;
+import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.profileservice.spi.dependency.ProfileRequirementResolver;
+import org.jboss.profileservice.spi.dependency.ProfileRequirementResolverFactory;
 
 /**
  * The abstract profile service bootstrap.
@@ -35,15 +45,21 @@
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
  */
-public abstract class AbstractProfileServiceBootstrap extends AbstractProfileServiceInitializer
+public abstract class AbstractProfileServiceBootstrap extends AbstractProfileServiceInitializer implements ProfileActivationCallback
 {
 
+   /** The logger. */
+   protected static final Logger log = Logger.getLogger("org.jboss.profileservice.bootstrap");
+   
    /** The jboss kernel. */
    private final Kernel kernel;
+
+   /** The activated profiles. */
+   private List<ProfileKey> activatedProfiles = new ArrayList<ProfileKey>();
+
+   /** The requirement resolver factory. */
+   private ProfileRequirementResolverFactory resolverFactory;
    
-   /** The profile service. */
-   private ProfileService profileService;
-   
    public AbstractProfileServiceBootstrap(Kernel kernel, ProfileServiceConfig config)
    {
       super(config);
@@ -57,21 +73,65 @@
    
    protected ProfileService createProfileService(AbstractDomainMetaData domainMetaData) throws Throwable
    {
-      return super.initialize(domainMetaData);
+      super.initialize(domainMetaData);
+      this.resolverFactory = new BasicResolverFactory(getMetaDataRegistry(), this);
+      return getProfileService();
    }
-   
+
    protected void start(AbstractDomainMetaData domainMetaData) throws Throwable
    {
-      this.profileService = createProfileService(domainMetaData);
+      createProfileService(domainMetaData);
+      ProfileRequirementResolver resolver = createRequirementResolver(domainMetaData);
+      BasicDomainMetaDataVisitor visitor = new BasicDomainMetaDataVisitor(resolver, getMetaDataRegistry());
       Collection<DomainFeatureNode> features = domainMetaData.getFeatures();
       if(features != null && features.isEmpty() == false)
       {
          for(DomainFeatureNode node : domainMetaData.getFeatures())
          {
-
+            visitor.visit(node);
          }
       }
+      resolver.resolve();
+      resolver.deploy();
    }
    
+   protected void stop(DomainMetaData domainMetaData)
+   {
+      for(ProfileKey key : activatedProfiles)
+      {
+         try
+         {
+            getProfileService().deactivateProfile(key);
+         }
+         catch(NoSuchProfileException ignore)
+         {
+            log.debug("failed to deactivate profile " + key);
+         }
+      }
+      for(ProfileKey key : activatedProfiles)
+      {
+         try
+         {
+            getProfileService().unregisterProfile(key);
+         }
+         catch(NoSuchProfileException ignore)
+         {
+            log.debug("failed to unregister profile " + key);
+         }         
+      }
+   }
+
+   public void activate(ProfileKey key) throws Exception
+   {
+      getProfileService().activateProfile(key);
+      this.activatedProfiles.add(key);
+      getProfileService().validateProfile(key);
+   }
+   
+   protected ProfileRequirementResolver createRequirementResolver(DomainMetaData domainMetaData)
+   {
+      return resolverFactory.createResolver(getConfig().getServerConfiguration().getServerName());
+   }
+   
 }
 

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/AbstractProfileServiceInitializer.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/AbstractProfileServiceInitializer.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/AbstractProfileServiceInitializer.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -51,6 +51,12 @@
    /** The profileservice config. */
    private final ProfileServiceConfig config;
    
+   /** The meta data registry. */
+   private ProfileMetaDataRegistry registry;
+   
+   /** The profile service. */
+   private ProfileService profileService;
+   
    public AbstractProfileServiceInitializer(ProfileServiceConfig config)
    {
       if(config == null)
@@ -61,6 +67,44 @@
    }
 
    /**
+    * Get the config.
+    * 
+    * @return the config
+    */
+   protected ProfileServiceConfig getConfig()
+   {
+      return config;
+   }
+   
+   /**
+    * Get the meta data registry.
+    * 
+    * @return the meta data registry.
+    */
+   protected ProfileMetaDataRegistry getMetaDataRegistry()
+   {
+      if(registry == null)
+      {
+         throw new IllegalStateException("ProfileService not initialized");
+      }
+      return registry;
+   }
+   
+   /**
+    * Get the profile service. 
+    * 
+    * @return the profile service
+    */
+   protected ProfileService getProfileService()
+   {
+      if(profileService == null)
+      {
+         throw new IllegalStateException("ProfileService not initialized");
+      }
+      return profileService;
+   }
+   
+   /**
     * Get the MC kernel.
     * 
     * @return the kernel
@@ -74,13 +118,13 @@
     * @return the profile service
     * @throws Throwable for any error
     */
-   public ProfileService initialize(AbstractDomainMetaData domainMetaData) throws Throwable
+   public void initialize(AbstractDomainMetaData domainMetaData) throws Throwable
    {
       // initialize the config
       config.setManagementDomain(createManagementDomain(domainMetaData));
       config.setServerConfiguration(createServerConfiguration(domainMetaData));     
       // Create profile service
-      return createProfileService();
+      createProfileService();
    }
    
    /**
@@ -92,13 +136,13 @@
    public ProfileService createProfileService() throws Throwable
    {
       // Create the registry
-      ProfileMetaDataRegistry registry = createProfileMetaDataRegistry();
+      this.registry = createProfileMetaDataRegistry();
       // Create the controller
       ProfileServiceController controller = new ProfileServiceController(getKernel().getController(), registry, config);
       // Create the profile service
-      AbstractProfileService ps = new AbstractProfileService(controller);
-      register(ProfileServiceConstants.PROFILESERVICE_NAME, ps);
-      return ps;
+      this.profileService = new AbstractProfileService(controller);
+      register(ProfileServiceConstants.PROFILESERVICE_NAME, profileService);
+      return profileService;
    }
 
    /**

Added: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/ProfileActivationCallback.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/ProfileActivationCallback.java	                        (rev 0)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/ProfileActivationCallback.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat 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.bootstrap;
+
+import org.jboss.profileservice.spi.ProfileKey;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ProfileActivationCallback
+{
+
+   /**
+    * Activate a profile.
+    * 
+    * @param key the profile key
+    * @throws Exception
+    */
+   void activate(ProfileKey key) throws Exception;
+   
+}
+

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileServiceController.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileServiceController.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileServiceController.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -73,9 +73,24 @@
       ProfileControllerContextActions.initializeController(controller);
    }
 
+   public ProfileKey resolveProfileKey(ProfileKey key)
+   {
+      if(key.getDomain() == ProfileKey.DEFAULT
+            && key.getServer() == ProfileKey.DEFAULT)
+      {
+         return resolveProfileKey(key.getName());
+      }
+      return key;
+   }
+   
+   public ProfileKey resolveProfileKey(String name)
+   {
+      return metaDataRegistry.createProfileKey(name);
+   }
+   
    public ProfileKey resolveProfileKey(ProfileMetaData metaData)
    {
-      return metaDataRegistry.createProfileKey(metaData.getName());
+      return resolveProfileKey(metaData.getName());
    }
    
    public List<ProfileKey> getRegisteredProfiles()
@@ -96,11 +111,13 @@
    
    public boolean isRegistered(ProfileKey key)
    {
+      key = resolveProfileKey(key);
       return controller.getContext(key, null) != null;
    }
    
    public boolean isInstalled(ProfileKey key)
    {
+      key = resolveProfileKey(key);
       return controller.getContext(key, ControllerState.INSTALLED) != null;
    }
    
@@ -116,6 +133,7 @@
    
    public ProfileControllerContext getRegisteredContext(ProfileKey key) throws NoSuchProfileException
    {
+      key = resolveProfileKey(key);
       ControllerContext context = controller.getContext(key, null);
       if(context instanceof ProfileControllerContext)
       {
@@ -126,6 +144,7 @@
    
    public ProfileControllerContext getInstalledContext(ProfileKey key) throws NoSuchProfileException
    {
+      key = resolveProfileKey(key);
       ControllerContext context = controller.getContext(key, ControllerState.INSTALLED);
       if(context instanceof ProfileControllerContext)
       {
@@ -155,6 +174,7 @@
 
    public void activate(ProfileKey key) throws NoSuchProfileException, Throwable
    {
+      key = resolveProfileKey(key);
       ProfileControllerContext context = getRegisteredContext(key);
       controller.change(context, ControllerState.INSTALLED);
       this.activeProfiles.add(context.getProfileKey());
@@ -162,6 +182,7 @@
    
    public void deactivate(ProfileKey key) throws NoSuchProfileException, Throwable
    {
+      key = resolveProfileKey(key);
       ProfileControllerContext context = getInstalledContext(key);
       controller.change(context, ControllerState.NOT_INSTALLED);
       this.activeProfiles.remove(context.getProfileKey());
@@ -169,6 +190,7 @@
    
    public void unInstallAndUnregisterContext(ProfileKey key) throws NoSuchProfileException
    {
+      key = resolveProfileKey(key);
       getRegisteredContext(key); // check if it exists
       unInstallContext(key);
       metaDataRegistry.removeProfile(key);
@@ -182,6 +204,7 @@
 
    void unInstallContext(ProfileKey key)
    {
+      key = resolveProfileKey(key);
       controller.uninstall(key);
    }
    

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/ProfileDeployerPluginRegistry.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/ProfileDeployerPluginRegistry.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/ProfileDeployerPluginRegistry.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -26,6 +26,7 @@
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.Map.Entry;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
@@ -103,9 +104,30 @@
    }
    
    /**
+    * Check all deployers complete. 
+    * 
+    * @throws Exception
+    */
+   public void checkAllComplete() throws Exception
+   {
+      for(Entry<String, ProfileDeployerPlugin> deployers : map.entrySet())
+      {
+         if(deployers.getKey().equals(DEFAULT) == false)
+         {
+            deployers.getValue().checkComplete();
+         }
+      }
+      ProfileDeployerPlugin defaultDeployer = map.get(DEFAULT);
+      if(defaultDeployer != null)
+      {
+         defaultDeployer.checkComplete();
+      }
+   }
+   
+   /**
     * Tell the deployers we are about to shutdown
     */
-   void prepareShutdown()
+   public void prepareShutdown()
    {
       for(ProfileDeployerPlugin deployer : map.values())
       {
@@ -116,7 +138,7 @@
    /**
     * Shutdown. Removes all the deployments.
     */
-   void shutdown()
+   public void shutdown()
    {
       for(ProfileDeployerPlugin deployer : map.values())
       {

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/AbstractHDScannerFactory.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/AbstractHDScannerFactory.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/AbstractHDScannerFactory.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -119,6 +119,14 @@
    /**
     * {@inheritDoc}
     */
+   public Scanner getScanner(ProfileKey key)
+   {
+      return this.registeredScans.get(key);
+   }
+   
+   /**
+    * {@inheritDoc}
+    */
    public Collection<Scanner> getRegisteredScanners()
    {
       return new ArrayList<Scanner>(this.registeredScans.values());
@@ -271,8 +279,10 @@
          this.scanner = scanner;
          this.configuration = configuration;
       }
-      
-      @Override
+
+      /**
+       * {@inheritDoc}
+       */
       public ProfileKey getKey()
       {
          return scanner.getKey();
@@ -281,7 +291,6 @@
       /**
        * {@inheritDoc}
        */
-      @Override
       public int getScanPeriod()
       {
          return configuration.getScanPeriod();
@@ -290,13 +299,14 @@
       /**
        * {@inheritDoc}
        */
-      @Override
       public TimeUnit getTimeUnit()
       {
          return configuration.getTimeUnit();
       }
       
-      @Override
+      /**
+       * {@inheritDoc}
+       */
       public boolean isStartAutomatically()
       {
          return configuration.isStartAutomatically();
@@ -305,7 +315,6 @@
       /**
        * {@inheritDoc}
        */
-      @Override
       public int getScanCount()
       {
          return scanner.getScanCount();
@@ -314,13 +323,14 @@
       /**
        * {@inheritDoc}
        */
-      @Override
       public boolean isScheduled()
       {
          return activeScan != null;
       }
       
-      @Override
+      /**
+       * {@inheritDoc}
+       */
       public synchronized void start()
       {
          if(activeScan == null)
@@ -329,13 +339,17 @@
          }
       }
       
-      @Override
+      /**
+       * {@inheritDoc}
+       */
       public synchronized void scan() throws Exception
       {
          scanner.scan();
       }
 
-      @Override
+      /**
+       * {@inheritDoc}
+       */
       public synchronized void stop()
       {
          if (activeScan != null)
@@ -352,6 +366,11 @@
          }
       }
       
+      /**
+       * Stop the scanner.
+       * 
+       * @param mayInterruptIfRunning
+       */
       protected synchronized void stop(boolean mayInterruptIfRunning)
       {
          if(activeScan != null)

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScannerFactory.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScannerFactory.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScannerFactory.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -64,6 +64,14 @@
    Scanner registerScanner(ProfileKey key, ScannerConfiguration configuration);
 
    /**
+    * Get a scanner for a given profile.
+    * 
+    * @param key the profile key
+    * @return the scanner, null if not registered
+    */
+   Scanner getScanner(ProfileKey key);
+   
+   /**
     * Activate a scanner.
     * 
     * @param key the profile key

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/metadata/ProfileConfigurationExt.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/metadata/ProfileConfigurationExt.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/metadata/ProfileConfigurationExt.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -21,23 +21,18 @@
 */
 package org.jboss.profileservice.metadata;
 
+import org.jboss.profileservice.spi.managed.ManagedProfileConfiguration;
+
 /**
  * TODO move this to managed SPI ?
  * 
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
  */
-public interface ProfileConfigurationExt
+public interface ProfileConfigurationExt extends ManagedProfileConfiguration
 {
 
    /**
-    * Does the profile support redeployment.
-    * 
-    * @return
-    */
-   boolean isSupportRedeployment();
-
-   /**
     * Check complete during the profile lifecycle.
     * 
     * @return

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/metadata/ProfileMetaDataFactory.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/metadata/ProfileMetaDataFactory.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/metadata/ProfileMetaDataFactory.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -32,6 +32,7 @@
 import org.jboss.profileservice.profile.metadata.ProfilesMetaData;
 import org.jboss.profileservice.spi.metadata.ProfileMetaData;
 import org.jboss.vfs.VFS;
+import org.jboss.vfs.VFSUtils;
 import org.jboss.vfs.VirtualFile;
 import org.jboss.vfs.VirtualFileFilter;
 import org.jboss.xb.binding.JBossXBException;
@@ -153,8 +154,7 @@
       }
       finally
       {
-         try { if(is != null) { is.close(); }
-         } catch (IOException ignore) { }
+         VFSUtils.safeClose(is);
       }
    }
 

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/MutableScanningProfile.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/MutableScanningProfile.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/MutableScanningProfile.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -48,7 +48,8 @@
    private static final Logger log = Logger.getLogger("org.jboss.profileservice.profile");
    
    /** enable modification checks. */
-   private volatile boolean enableChecks;
+   // The default is true, unlike AS5
+   private volatile boolean enableChecks = true;
    
    /** The lock. */
    private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/ScanningProfileFactory.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/ScanningProfileFactory.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/ScanningProfileFactory.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -113,7 +113,7 @@
    public AbstractScanningProfile createProfile(ProfileKey key, PropertyProfileMetaData metaData) throws Exception
    {
       PropertyProfileSourceMetaData source = metaData.getSource();
-      // We always create mutable artifact repositories for scanning profiles, since we can easily add new contents to it
+      // We always create mutable artifact repositories for scanning profiles, since we can add new contents to it
       VirtualDeploymentRepository repository = createDeploymentRepository(Integer.toString(key.hashCode()), source, true);
       if(metaData.isHotDeploymentEnabled())
       {

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/BasicSubProfileMetaData.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/BasicSubProfileMetaData.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/BasicSubProfileMetaData.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -25,7 +25,6 @@
 import javax.xml.bind.annotation.XmlTransient;
 
 import org.jboss.profileservice.profile.metadata.helpers.AbstractSubProfileKeyMetaData;
-import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.dependency.DependencyMode;
 
 /**
@@ -50,11 +49,6 @@
       super(name);
    }
    
-   public BasicSubProfileMetaData(ProfileKey key)
-   {
-      super(key);
-   }
-   
    @Override
    @XmlAttribute(name = "name")
    public String getName()

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/FileRepositorySourceConfiguration.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/FileRepositorySourceConfiguration.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/FileRepositorySourceConfiguration.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -21,7 +21,10 @@
 */
 package org.jboss.profileservice.profile.metadata;
 
+import java.net.URI;
+
 import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlTransient;
 
 import org.jboss.profileservice.repository.artifact.file.FileArtifactId;
 import org.jboss.profileservice.spi.metadata.ProfileSourceMetaData;
@@ -34,6 +37,9 @@
  */
 public class FileRepositorySourceConfiguration implements ProfileSourceMetaData
 {
+   
+   /** The root overrides group. */
+   private URI root;
 
    /** The sub folder in the file repository. */
    private String group;
@@ -60,6 +66,22 @@
    {
       this.group = group;
    }
+
+   /**
+    * Override the complete repository root.
+    * 
+    * @return the root
+    */
+   @XmlTransient
+   public URI getRoot()
+   {
+      return root;
+   }
    
+   public void setRoot(URI root)
+   {
+      this.root = root;
+   }
+   
 }
 

Added: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/domain/BasicDomainMetaDataVisitor.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/domain/BasicDomainMetaDataVisitor.java	                        (rev 0)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/domain/BasicDomainMetaDataVisitor.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -0,0 +1,105 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat 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.domain;
+
+import org.jboss.profileservice.dependency.ProfileMetaDataRegistry;
+import org.jboss.profileservice.domain.spi.DomainFeatureNode;
+import org.jboss.profileservice.domain.spi.DomainFeatureVisitor;
+import org.jboss.profileservice.profile.metadata.domain.RequiredProfiles.ResolveRequirement;
+import org.jboss.profileservice.spi.dependency.ProfileCapability;
+import org.jboss.profileservice.spi.dependency.ProfileRequirement;
+import org.jboss.profileservice.spi.dependency.ProfileRequirementResolver;
+import org.jboss.profileservice.spi.metadata.ProfileFeatureMetaData;
+import org.jboss.profileservice.spi.metadata.ProfileMetaData;
+import org.jboss.profileservice.spi.metadata.ProfileMetaDataVisitor;
+import org.jboss.profileservice.spi.metadata.ProfileMetaDataVisitorNode;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class BasicDomainMetaDataVisitor implements DomainFeatureVisitor, ProfileMetaDataVisitor
+{
+   
+   /** The requirement resolver. */
+   private final ProfileRequirementResolver resolver;
+   
+   /** The profile meta data registry. */
+   private final ProfileMetaDataRegistry registry;
+   
+   public BasicDomainMetaDataVisitor(ProfileRequirementResolver resolver, ProfileMetaDataRegistry registry)
+   {
+      this.resolver = resolver;
+      this.registry = registry;
+   }
+   
+   @Override
+   public void addProfileMetaData(ProfileMetaData metaData)
+   {
+      addRequirement(new ResolveRequirement(metaData.getName()));
+      registry.registerProfileMetaData(metaData);
+      visit(metaData);
+   }
+
+   public void addAlias(String name)
+   {
+      //
+   }
+   
+   @Override
+   public void addCapability(ProfileCapability capability)
+   {
+      // we only care about requirements for the domain
+   }
+
+   @Override
+   public void addRequirement(ProfileRequirement requirement)
+   {
+      this.resolver.addRequirement(requirement);
+   }
+
+   @Override
+   public void addFeature(ProfileFeatureMetaData feature)
+   {
+      //
+   }
+   
+   @Override
+   public void enableOnDemand(boolean onDemand)
+   {
+      // nothing
+   }
+   
+   @Override
+   public void visit(DomainFeatureNode node)
+   {
+      node.visit(this);
+   }
+   
+   @Override
+   public void visit(ProfileMetaDataVisitorNode node)
+   {
+      node.visit(this);
+   }
+
+}
+

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/AbstractProfileKeyMetaData.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/AbstractProfileKeyMetaData.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/AbstractProfileKeyMetaData.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -21,7 +21,6 @@
  */ 
 package org.jboss.profileservice.profile.metadata.helpers;
 
-import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.metadata.ProfileKeyMetaData;
 
 
@@ -50,11 +49,6 @@
       }
       this.name = name;
    }
-   
-   public AbstractProfileKeyMetaData(ProfileKey key)
-   {
-      this.name = key.getName();
-   }
 
    public String getName()
    {

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-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/AbstractSubProfileKeyMetaData.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -46,11 +46,6 @@
       super(name);
    }
    
-   public AbstractSubProfileKeyMetaData(ProfileKey key)
-   {
-      super(key);
-   }
-   
    public void visit(ProfileMetaDataVisitor visitor)
    {
       visitor.addRequirement(this);  

Added: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/ProfileMetaDataFactory.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/ProfileMetaDataFactory.java	                        (rev 0)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/metadata/helpers/ProfileMetaDataFactory.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -0,0 +1,153 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat 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.helpers;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.profileservice.profile.metadata.BasicProfileDeploymentMetaData;
+import org.jboss.profileservice.profile.metadata.BasicProfileMetaData;
+import org.jboss.profileservice.profile.metadata.FileRepositorySourceConfiguration;
+import org.jboss.profileservice.profile.metadata.plugin.HotDeploymentProfileMetaData;
+import org.jboss.profileservice.profile.metadata.plugin.PropertyProfileMetaData;
+import org.jboss.profileservice.profile.metadata.plugin.PropertyProfileSourceMetaData;
+import org.jboss.profileservice.profile.metadata.plugin.ScanPeriod;
+import org.jboss.profileservice.spi.metadata.ProfileDeploymentMetaData;
+
+/**
+ * A profile meta data factory helper. 
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ProfileMetaDataFactory
+{
+
+   /**
+    * Create a filtered profile meta data, resuing the common
+    * file repository root.
+    * 
+    * @param name the unique profile name
+    * @param group the group id
+    * @param deploymentNames the relative deployment names
+    * @return the profile meta data
+    */
+   public static BasicProfileMetaData createFilteredProfileMetaData(String name, String group, String... deploymentNames)
+   {
+      return createFilteredProfileMetaData(name, null, group, deploymentNames);
+   }
+   
+   /**
+    * Create a filtered profile meta data.
+    * 
+    * @param name the unique profile name
+    * @param root the override root
+    * @param deploymentNames the relative deployment names
+    * @return the profile meta data
+    */
+   public static BasicProfileMetaData createFilteredProfileMetaData(String name, URI root, String... deploymentNames)
+   {
+      return createFilteredProfileMetaData(name, root, root.toString(), deploymentNames);
+   }
+   
+   /**
+    * Create a filtered profile meta data.
+    * 
+    * @param name the unique profile name
+    * @param root a optional repository root
+    * @param group the mandatory group id
+    * @param deploymentNames the relative deployment names
+    * @return the profile meta data
+    */
+   protected static BasicProfileMetaData createFilteredProfileMetaData(String name, URI root, String group, String... deploymentNames)
+   {
+      // Profile
+      BasicProfileMetaData filtered = new BasicProfileMetaData();
+      filtered.setName(name);
+      // Source
+      filtered.setSource(createFileRepositoryConfiguration(root, group));
+      // Deployments
+      List<ProfileDeploymentMetaData> deployments = new ArrayList<ProfileDeploymentMetaData>(); 
+      for(String deploymentName : deploymentNames)
+      {
+         deployments.add(new BasicProfileDeploymentMetaData(deploymentName));
+      }
+      filtered.setDeployments(deployments);
+      return filtered;      
+   }
+   
+   /**
+    * Create the file repository source configuration.
+    * 
+    * @param root the override root
+    * @param group the group
+    * @return the file repository configuration
+    */
+   protected static FileRepositorySourceConfiguration createFileRepositoryConfiguration(URI root, String group)
+   {
+      FileRepositorySourceConfiguration source = new FileRepositorySourceConfiguration();
+      source.setRoot(root);
+      source.setGroup(group);
+      return source;
+   }
+   
+   /**
+    * Create a scanning profile
+    * 
+    * @param name the unique profile name
+    * @param root the profile root
+    * @return the scanning profile meta data
+    */
+   public static PropertyProfileMetaData createImmutableScanningProfile(String name, URI root)
+   {
+      PropertyProfileMetaData profile = new PropertyProfileMetaData();
+      profile.setName(name);
+      // Source
+      PropertyProfileSourceMetaData source = new PropertyProfileSourceMetaData(root.toString());
+      profile.setSource(source);
+      
+      return profile;
+   }
+   
+   /**
+    * Create a hot deployment scanning profile
+    * 
+    * @param profileName the profile name
+    * @param root the scan root
+    * @param scanPeriod the scanner configuration
+    * @return the hot deployment profile meta data
+    */
+   public static HotDeploymentProfileMetaData createHotDeploymentScanningProfile(String profileName, URI root, ScanPeriod scanPeriod)
+   {
+      HotDeploymentProfileMetaData profileMetaData = new HotDeploymentProfileMetaData();
+      profileMetaData.setName(profileName);
+      // Source
+      PropertyProfileSourceMetaData source = new PropertyProfileSourceMetaData(root.toString());
+      profileMetaData.setSource(source);
+      // HDScanner configuration
+      profileMetaData.setScanPeriod(scanPeriod);
+      return profileMetaData;
+   }
+
+}
+

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/NoopVirtualDeploymentMetaData.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/NoopVirtualDeploymentMetaData.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/NoopVirtualDeploymentMetaData.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -35,6 +35,9 @@
 public class NoopVirtualDeploymentMetaData implements VirtualDeploymentMetaData
 {
 
+   /** The noop instance. */
+   public static final NoopVirtualDeploymentMetaData INSTANCE = new NoopVirtualDeploymentMetaData();
+   
    public ArtifactId getArtifact()
    {
       return null;

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/ProfileDeploymentFactory.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/ProfileDeploymentFactory.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/ProfileDeploymentFactory.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -35,7 +35,7 @@
 {
 
    /** The noop deployment meta data. */
-   public static final VirtualDeploymentMetaData noopDeploymentMetaData = new NoopVirtualDeploymentMetaData();
+   public static final VirtualDeploymentMetaData noopDeploymentMetaData = NoopVirtualDeploymentMetaData.INSTANCE;
    
    /** The instance. */
    private static final ProfileDeploymentFactory instance = new ProfileDeploymentFactory();

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/AbstractArtifactRepository.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/AbstractArtifactRepository.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/AbstractArtifactRepository.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -24,11 +24,7 @@
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Collection;
 
-import org.jboss.profileservice.spi.repository.Artifact;
-import org.jboss.profileservice.spi.repository.ArtifactFilter;
 import org.jboss.profileservice.spi.repository.ArtifactId;
 import org.jboss.profileservice.spi.repository.ArtifactRepository;
 import org.jboss.profileservice.spi.repository.ArtifactRepositoryConfiguration;
@@ -70,7 +66,7 @@
       this.repositoryRoot = VFS.getChild(root);
       this.repositoryURI = root;
       this.identifier = identifier;
-      this.configuration = new BasicRepositoryConfiguration(root, false);;
+      this.configuration = new BasicRepositoryConfiguration<T>();;
    }
 
    public AbstractArtifactRepository(ArtifactRepositoryId identifier, VirtualFile root) throws IOException, URISyntaxException
@@ -86,7 +82,7 @@
       this.repositoryRoot = root;
       this.repositoryURI = root.toURI();
       this.identifier = identifier;
-      this.configuration = new BasicRepositoryConfiguration(root.toURI(), false);
+      this.configuration = new BasicRepositoryConfiguration<T>();
    }
    
    public URI getRepositoryURI()

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/BasicRepositoryConfiguration.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/BasicRepositoryConfiguration.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/BasicRepositoryConfiguration.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -21,8 +21,6 @@
 */
 package org.jboss.profileservice.repository.artifact;
 
-import java.net.URI;
-
 import org.jboss.profileservice.spi.repository.ArtifactId;
 import org.jboss.profileservice.spi.repository.ArtifactNotFoundHandler;
 import org.jboss.profileservice.spi.repository.ArtifactRepositoryConfiguration;
@@ -39,27 +37,28 @@
    /** The not found handler. */
    private ArtifactNotFoundHandler<T> notFoundHandler = DefaultNotFoundHandler.getInstance();
    
-   /** The repository location. */
-   private final URI location;
-   
    /** IsMutable. */
    private final boolean mutable;
+
+   public BasicRepositoryConfiguration()
+   {
+      this(false, null);
+   }
    
-   public BasicRepositoryConfiguration(URI location, boolean mutable)
+   public BasicRepositoryConfiguration(boolean mutable)
    {
-      if(location == null)
+      this(mutable, null);
+   }
+
+   public BasicRepositoryConfiguration(boolean mutable, ArtifactNotFoundHandler<T> notFoundHandler)
+   {
+      this.mutable = mutable;
+      if(notFoundHandler != null)
       {
-         throw new IllegalArgumentException("null repository location");
+         this.notFoundHandler = notFoundHandler;
       }
-      this.location = location;
-      this.mutable = mutable;
    }
    
-   public URI getLocation()
-   {
-      return location;
-   }
-   
    public VFSBackupPolicy getBackupPolicy()
    {
       return VFSBackupPolicy.ORIGINAL;

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/FileArtifactRepositoryFactory.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/FileArtifactRepositoryFactory.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/FileArtifactRepositoryFactory.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -46,7 +46,7 @@
    private final VirtualFile root;
 
    /** The profile service config. */
-   private ProfileServiceConfig config;
+   private final ProfileServiceConfig config;
    
    public FileArtifactRepositoryFactory(URI rootURI, ProfileServiceConfig config) throws IOException
    {

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/MutableFileArtifactRepository.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/MutableFileArtifactRepository.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/MutableFileArtifactRepository.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -166,14 +166,14 @@
     */
    public void removeArtifact(FileArtifactId artifactId) throws IOException
    {
-      VirtualFile vf = getArtifactFile(artifactId);
-      if(vf == null || vf.exists() == false)
-      {
-         return;
-      }
       lockWrite();
       try
       {
+         VirtualFile vf = getArtifactFile(artifactId);
+         if(vf == null || vf.exists() == false)
+         {
+            return;
+         }
          if(VFSUtils.recursiveDelete(vf) == false)
          {
             throw new IOException("Failed to delete " + vf);

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/virtual/AbstractVirtualProfileFactory.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/virtual/AbstractVirtualProfileFactory.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/virtual/AbstractVirtualProfileFactory.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -30,11 +30,13 @@
 import org.jboss.profileservice.repository.artifact.AbstractRepositoryId;
 import org.jboss.profileservice.repository.artifact.ArtifactRepositoryManager;
 import org.jboss.profileservice.repository.artifact.file.FileArtifactId;
+import org.jboss.profileservice.repository.artifact.file.FileRepositoryConfiguration;
 import org.jboss.profileservice.repository.artifact.maven.LocalMavenArtifactRepository;
 import org.jboss.profileservice.spi.ProfileDeployment;
 import org.jboss.profileservice.spi.VirtualDeploymentRepository;
 import org.jboss.profileservice.spi.repository.ArtifactId;
 import org.jboss.profileservice.spi.repository.ArtifactRepository;
+import org.jboss.profileservice.spi.repository.ArtifactRepositoryConfiguration;
 import org.jboss.profileservice.spi.repository.ArtifactRepositoryId;
 import org.jboss.profileservice.spi.virtual.VirtualDeploymentMetaData;
 
@@ -103,12 +105,29 @@
    {
       if(source != null && source.getGroup() != null)
       {
-         // Create the file repository, based on the group
-         ArtifactRepository<ArtifactId> fileRepository = repositoryManager.
-                     createArtifactRepository(createFileRepositoryId(source.getGroup()), null);
-         // Create the virtual deployment repository
-         return new DelegatingDeploymentRepository(getRepositoryManager(), config.getAssemblyConfiguration(),
-               fileRepository.getIdentifier(), MVN_ID);
+         ArtifactRepository<ArtifactId> fileRepository;
+         // TODO Root overrides original should be removed?
+         if(source.getRoot() != null && source.getGroup() != null)
+         {
+            // Override the repository root, based on the source configuration
+            FileRepositoryConfiguration configuration = new FileRepositoryConfiguration();
+            configuration.setOverrideURI(source.getRoot());
+            fileRepository = repositoryManager.
+                        createArtifactRepository(createFileRepositoryId(source.getGroup()), 
+                              ArtifactRepositoryConfiguration.class.cast(configuration));
+            // Create the virtual deployment repository
+            return new DelegatingDeploymentRepository(getRepositoryManager(), config.getAssemblyConfiguration(),
+                  fileRepository.getIdentifier());            
+         }
+         else if(source.getGroup() != null)
+         {
+            // Create the file repository, based on the group
+            fileRepository = repositoryManager.
+                        createArtifactRepository(createFileRepositoryId(source.getGroup()), null);
+            // Create the virtual deployment repository
+            return new DelegatingDeploymentRepository(getRepositoryManager(), config.getAssemblyConfiguration(),
+                  fileRepository.getIdentifier(), MVN_ID);
+         }
       }
       return UNCONFIGURED;
    }

Added: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/resolver/BasicResolverFactory.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/resolver/BasicResolverFactory.java	                        (rev 0)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/resolver/BasicResolverFactory.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -0,0 +1,114 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat 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.resolver;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.jboss.profileservice.bootstrap.ProfileActivationCallback;
+import org.jboss.profileservice.dependency.ProfileDependencyContext;
+import org.jboss.profileservice.dependency.ProfileMetaDataRegistry;
+import org.jboss.profileservice.profile.metadata.plugin.EmptyProfileMetaData;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.dependency.ProfileRequirement;
+import org.jboss.profileservice.spi.dependency.ProfileRequirementResolver;
+import org.jboss.profileservice.spi.dependency.ProfileRequirementResolverFactory;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class BasicResolverFactory implements ProfileRequirementResolverFactory
+{
+
+   /** The profile meta data registry. */
+   private final ProfileMetaDataRegistry registry;
+   private final ProfileActivationCallback callback;
+   
+   public BasicResolverFactory(ProfileMetaDataRegistry registry, ProfileActivationCallback callback)
+   {
+      this.registry = registry;
+      this.callback = callback;
+   }   
+   
+   public ProfileRequirementResolver createResolver(String name)
+   {
+      if(name == null)
+      {
+         throw new IllegalArgumentException("null profile name");
+      }
+      final EmptyProfileMetaData metaData = new EmptyProfileMetaData();
+      registry.registerProfileMetaData(metaData);
+      final ProfileDependencyContext ctx = registry.getContext(name);
+      return new ProfileResolverFacade(ctx, callback);
+   }
+
+   
+   public class ProfileResolverFacade implements ProfileRequirementResolver
+   {
+
+      private final ProfileDependencyContext context;
+      private final ProfileActivationCallback callback;
+      private List<ProfileKey> resolved;
+      
+      public ProfileResolverFacade(ProfileDependencyContext context, ProfileActivationCallback callback)
+      {
+         this.context = context;
+         this.callback = callback;
+      }
+      
+      public void addRequirement(ProfileRequirement requirement)
+      {
+         context.addRequirement(requirement);
+      }
+
+      public void deploy() throws Exception
+      {
+         if(resolved != null && resolved.isEmpty() == false)
+         {
+            for(ProfileKey key : resolved)
+            {
+               callback.activate(key);
+            }
+         }
+      }
+
+      public Collection<ProfileRequirement> getUnsatisfiedRequirements()
+      {
+         return null;
+      }
+
+      public boolean resolve()
+      {
+         AbstractRequirementResolver resolver = new AbstractRequirementResolver(registry);
+         resolver.resolve(context);
+         resolved = resolver.sort();
+         return true;
+      }
+      
+      
+      
+      
+   }
+   
+}
+

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/version/Version.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/version/Version.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/version/Version.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -45,7 +45,7 @@
    /** The serialVersionUID */
    private static final long serialVersionUID = 1L;
    
-   /** The sperator */
+   /** The separator */
    private static final String SEPARATOR = ".";
    
    /** The raw pattern */

Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/TransientProfileActivator.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/TransientProfileActivator.java	2010-03-26 11:28:12 UTC (rev 103033)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/TransientProfileActivator.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -64,6 +64,11 @@
       this.ps = profileService;
    }
    
+   /**
+    * start()
+    * 
+    * @throws Exception
+    */
    public void start() throws Exception
    {
       Profile profile = new TransientDeploymentsProfile();
@@ -72,41 +77,64 @@
       this.ps.validateProfile(TRANSIENT_PROFILE_KEY);
    }
 
+   /**
+    * stop()
+    * 
+    * @throws Exception
+    */
    public void stop() throws Exception
    {
       this.ps.deactivateProfile(TRANSIENT_PROFILE_KEY);
       this.ps.unregisterProfile(TRANSIENT_PROFILE_KEY);
    }
 
+   /**
+    * The transient deployment profile implementation.
+    */
    public static class TransientDeploymentsProfile implements MutableProfile
    {
 
       private Map<String, ProfileDeployment> deployments = new ConcurrentHashMap<String, ProfileDeployment>();
       private volatile long lastModified = System.currentTimeMillis();
       
-      public void addDeployment(ProfileDeployment deployment) throws Exception
+      /**
+       * {@inheritDoc}
+       */
+      public void addDeployment(ProfileDeployment deployment)
       {
          this.deployments.put(deployment.getName(), deployment);
          lastModified = System.currentTimeMillis();
       }
 
+      /**
+       * {@inheritDoc}
+       */
       public void enableModifiedDeploymentChecks(boolean flag)
       {
          //
       }
 
-      public Collection<ModificationInfo> getModifiedDeployments() throws Exception
+      /**
+       * {@inheritDoc}
+       */
+      public Collection<ModificationInfo> getModifiedDeployments()
       {
          return Collections.emptySet();
       }
 
-      public ProfileDeployment removeDeployment(String name) throws NoSuchDeploymentException, Exception
+      /**
+       * {@inheritDoc}
+       */
+      public ProfileDeployment removeDeployment(String name) throws NoSuchDeploymentException
       {
          ProfileDeployment deployment = getDeployment(name);
          lastModified = System.currentTimeMillis();
          return this.deployments.remove(deployment.getName());
       }
 
+      /**
+       * {@inheritDoc}
+       */
       public ProfileDeployment getDeployment(String name) throws NoSuchDeploymentException
       {
          ProfileDeployment deployment = resolveDeployment(name);
@@ -117,36 +145,62 @@
          return deployment;
       }
 
+      /**
+       * {@inheritDoc}
+       */
       public Set<String> getDeploymentNames()
       {
          return this.deployments.keySet();
       }
 
+      /**
+       * {@inheritDoc}
+       */
       public Collection<ProfileDeployment> getDeployments()
       {
          return this.deployments.values();
       }
 
+      /**
+       * {@inheritDoc}
+       */
       public ProfileKey getKey()
       {
          return TRANSIENT_PROFILE_KEY;
       }
 
+      /**
+       * {@inheritDoc}
+       */
       public long getLastModified()
       {
          return lastModified;
       }
 
+      /**
+       * {@inheritDoc}
+       */
       public boolean hasDeployment(String name)
       {
          return resolveDeployment(name) != null ? true : false;
       }
 
+      /**
+       * {@inheritDoc}
+       */
       public boolean isMutable()
       {
          return true;
       }
       
+      /**
+       * Try to resolve a deployment. This is going to resolve the name against
+       * the deployment-name, the initial URL used for deployment or the simple
+       * name. 
+       * 
+       * @param name the deployment name
+       * @return the deployment, null if not found
+       */
       protected ProfileDeployment resolveDeployment(String name)
       {
          ProfileDeployment deployment = this.deployments.get(name);

Added: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/RemoveComponentAction.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/RemoveComponentAction.java	                        (rev 0)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/RemoveComponentAction.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -0,0 +1,95 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat 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.plugins.management.actions;
+
+import org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction;
+import org.jboss.profileservice.spi.action.management.ManagementAction;
+import org.jboss.profileservice.spi.action.management.ManagementActionContext;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class RemoveComponentAction extends AbstractTwoPhaseModificationAction<ManagementActionContext> implements ManagementAction<ManagementActionContext>
+{
+
+   public RemoveComponentAction(ManagementActionContext modificationContext)
+   {
+      super(modificationContext);
+   }
+
+   protected void doCancel()
+   {
+      // FIXME doCancel
+      
+   }
+
+   protected void doCommit()
+   {
+      // FIXME doCommit
+      
+   }
+
+   protected void doComplete() throws Exception
+   {
+      // FIXME doComplete
+      
+   }
+
+   protected boolean doPrepare()
+   {
+      // FIXME doPrepare
+      return false;
+   }
+
+   protected void doRollbackFromActive()
+   {
+      // FIXME doRollbackFromActive
+      
+   }
+
+   protected void doRollbackFromCancelled()
+   {
+      // FIXME doRollbackFromCancelled
+      
+   }
+
+   protected void doRollbackFromComplete()
+   {
+      // FIXME doRollbackFromComplete
+      
+   }
+
+   protected void doRollbackFromPrepared()
+   {
+      // FIXME doRollbackFromPrepared
+      
+   }
+
+   protected void doRollbackFromRollbackOnly()
+   {
+      // FIXME doRollbackFromRollbackOnly
+      
+   }
+
+}
+

Added: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/UpdateComponentAction.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/UpdateComponentAction.java	                        (rev 0)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/UpdateComponentAction.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -0,0 +1,95 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat 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.plugins.management.actions;
+
+import org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction;
+import org.jboss.profileservice.spi.action.management.ManagementAction;
+import org.jboss.profileservice.spi.action.management.ManagementActionContext;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class UpdateComponentAction extends AbstractTwoPhaseModificationAction<ManagementActionContext> implements ManagementAction<ManagementActionContext>
+{
+
+   public UpdateComponentAction(ManagementActionContext modificationContext)
+   {
+      super(modificationContext);
+   }
+
+   protected void doCancel()
+   {
+      // FIXME doCancel
+      
+   }
+
+   protected void doCommit()
+   {
+      // FIXME doCommit
+      
+   }
+
+   protected void doComplete() throws Exception
+   {
+      // FIXME doComplete
+      
+   }
+
+   protected boolean doPrepare()
+   {
+      // FIXME doPrepare
+      return false;
+   }
+
+   protected void doRollbackFromActive()
+   {
+      // FIXME doRollbackFromActive
+      
+   }
+
+   protected void doRollbackFromCancelled()
+   {
+      // FIXME doRollbackFromCancelled
+      
+   }
+
+   protected void doRollbackFromComplete()
+   {
+      // FIXME doRollbackFromComplete
+      
+   }
+
+   protected void doRollbackFromPrepared()
+   {
+      // FIXME doRollbackFromPrepared
+      
+   }
+
+   protected void doRollbackFromRollbackOnly()
+   {
+      // FIXME doRollbackFromRollbackOnly
+      
+   }
+
+}
+

Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/managed/ManagedProfileConfiguration.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/managed/ManagedProfileConfiguration.java	                        (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/managed/ManagedProfileConfiguration.java	2010-03-26 11:35:40 UTC (rev 103034)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat 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.spi.managed;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ManagedProfileConfiguration
+{
+
+   /**
+    * Check whether this profile supports redeployment. A 
+    * "false" return value means that the server has to be
+    * restarted to apply modifications.
+    * 
+    * @return true, if this profile supports redeployment. 
+    */
+   boolean isSupportRedeployment();
+   
+}
+




More information about the jboss-cvs-commits mailing list