[jboss-cvs] JBossAS SVN: r95099 - in projects/profileservice/trunk: build and 47 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Oct 19 05:58:46 EDT 2009


Author: emuckenhuber
Date: 2009-10-19 05:58:43 -0400 (Mon, 19 Oct 2009)
New Revision: 95099

Added:
   projects/profileservice/trunk/build/src/assemble/
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/FileArtifactId.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/virtual/
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/virtual/VirtualDeploymentRepository.java
   projects/profileservice/trunk/plugins/
   projects/profileservice/trunk/plugins/pom.xml
   projects/profileservice/trunk/plugins/src/
   projects/profileservice/trunk/plugins/src/main/
   projects/profileservice/trunk/plugins/src/main/java/
   projects/profileservice/trunk/plugins/src/main/java/org/
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/AbstractDeployHandler.java
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/DeploymentManagerImpl.java
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AggregatingLocalManagementView.java
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/AbstractProfileView.java
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/ProfileViewWrapper.java
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/RuntimeManagedObjectRegistry.java
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/spi/
   projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/spi/ProfileView.java
   projects/profileservice/trunk/plugins/src/main/resources/
   projects/profileservice/trunk/plugins/src/test/
   projects/profileservice/trunk/plugins/src/test/java/
   projects/profileservice/trunk/plugins/src/test/resources/
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ActionStatus.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationAction.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationContext.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/TwoPhaseCommitProfileAction.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/deployment/
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/deployment/DeploymentAction.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/deployment/DeploymentActionContext.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/Engine.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/EventBus.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ModificationEvent.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ModificationListener.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ModificationStatus.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/management/
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/management/ManagementAction.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/management/ManagementActionContext.java
Removed:
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/bootstrap/BootstrapDeployAction.java
Modified:
   projects/profileservice/trunk/build/pom.xml
   projects/profileservice/trunk/core/pom.xml
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/AbstractProfileService.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/NoopProfileDeployerPlugin.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/ProfileDeployerPlugin.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/ProfileDeployerPluginRegistry.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/TypedProfileFactory.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/AbstractProfileServiceBootstrap.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/AbstractProfileAction.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/AbstractProfileLifeCycleAction.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/LocalProfileServiceDomain.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileControllerContext.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileControllerContextActions.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileDependencyContext.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileDeployAction.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileInstantiateAction.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileServiceController.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/metadata/ProfilesMetaDataFactory.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/AbstractImmutableProfile.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/AbstractVFSProfileSource.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/FilteredProfile.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/bootstrap/BootstrapDeployerPlugin.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/DelegatingArtifactRepository.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/FileArtifact.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/legacy/AbstractDeploymentRepository.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/legacy/BasicDeploymentRepository.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/legacy/DeploymentUtils.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/BasicVirtualAssemblyContext.java
   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/deployment/AbstractVirtualDeployment.java
   projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/deployment/AbstractVirtualFileArtifact.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/ProfileServiceTestBase.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/repository/test/ArtifactRepositoryUnitTestCase.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/support/ProfileServiceBootstrap.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/test/AbstractProfileServiceTest.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/test/BasicProfileServiceUnitTestCase.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/AbstractVirtualAssemblyTestCase.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/StructureMetaDataUnitTestCase.java
   projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/VirtualDeploymentAssemblyUnitTestCase.java
   projects/profileservice/trunk/core/src/test/resources/bootstrap/basic.profile
   projects/profileservice/trunk/core/src/test/resources/metadata/test.xml
   projects/profileservice/trunk/domain/pom.xml
   projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AbstractPersistenceFactory.java
   projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AbstractValuePersistence.java
   projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AbstractValueRecreation.java
   projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AttachmentPropertyPopulator.java
   projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/ManagedObjectRecreationHelper.java
   projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/PersistenceConstants.java
   projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/xml/PersistedPropertiesValue.java
   projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/xml/PersistedTableValue.java
   projects/profileservice/trunk/pom.xml
   projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/NameMatcher.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/deploy/DeploymentManager.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/ProfileKey.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/repository/MutableArtifactRepository.java
   projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/virtual/VirtualArtifactMetaData.java
Log:
add some uncommitted work, add plugins module, update maven dependencies and other minor changes

Modified: projects/profileservice/trunk/build/pom.xml
===================================================================
--- projects/profileservice/trunk/build/pom.xml	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/build/pom.xml	2009-10-19 09:58:43 UTC (rev 95099)
@@ -8,34 +8,24 @@
   <groupId>org.jboss.profileservice</groupId>
   <artifactId>jboss-profileservice-build</artifactId>
   <version>1.0.0-SNAPSHOT</version>
-  <packaging>pom</packaging>
+  <packaging>jar</packaging>
   <name>JBoss ProfileService Distribution</name>
   <url>http://www.jboss.org/jbossas</url>
   <description>JBoss ProfileService Distribution Build</description>
 
+<!-- 
   <build>
-  <!--
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-assembly-plugin</artifactId>
-        <version>2.2-beta-2</version>
-        <executions>
-          <execution>
-            <id>make-assembly</id>
-            <phase>package</phase>
-            <configuration>
-              <finalName>jboss-man-${project.version}</finalName>
-            </configuration>
-          </execution>
-        </executions>
+        <configuration>
+          <descriptors>
+            <descriptor>src/assemble/repository.xml</descriptor>
+          </descriptors>
+        </configuration>
       </plugin>
     </plugins>
-    -->
   </build>
-
-  <dependencies>
-
-  </dependencies>
+ -->
   
 </project>

Modified: projects/profileservice/trunk/core/pom.xml
===================================================================
--- projects/profileservice/trunk/core/pom.xml	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/pom.xml	2009-10-19 09:58:43 UTC (rev 95099)
@@ -14,12 +14,6 @@
 	<description>JBoss ProfileService Core</description>
 
 	<dependencies>
-		<dependency>
-			<groupId>org.jboss.logging</groupId>
-			<artifactId>jboss-logging-log4j</artifactId>
-			<version>2.1.0.GA</version>
-			<scope>provided</scope>
-		</dependency>
 
 		<dependency>
 			<groupId>org.jboss.deployers</groupId>
@@ -31,14 +25,12 @@
 		<dependency>
 			<groupId>org.jboss.microcontainer</groupId>
 			<artifactId>jboss-dependency</artifactId>
-			<version>${version.org.jboss.microcontainer}</version>
 			<scope>provided</scope>
 		</dependency>
 
 		<dependency>
 			<groupId>org.jboss.microcontainer</groupId>
 			<artifactId>jboss-kernel</artifactId>
-			<version>${version.org.jboss.microcontainer}</version>
 			<scope>provided</scope>
 		</dependency>
 
@@ -55,10 +47,11 @@
 		</dependency>
 
 		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
+			<groupId>org.jboss.test</groupId>
+			<artifactId>jboss-test</artifactId>
 			<scope>test</scope>
 		</dependency>
+		
 	</dependencies>
 
 </project>

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/AbstractProfileService.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/AbstractProfileService.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/AbstractProfileService.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -29,7 +29,6 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.jboss.dependency.plugins.AbstractController;
 import org.jboss.dependency.spi.ControllerContext;
 import org.jboss.dependency.spi.ControllerState;
 import org.jboss.dependency.spi.ControllerStateModel;
@@ -37,13 +36,13 @@
 import org.jboss.dependency.spi.DependencyItem;
 import org.jboss.deployers.spi.management.ManagementView;
 import org.jboss.deployers.spi.management.deploy.DeploymentManager;
+import org.jboss.kernel.Kernel;
 import org.jboss.profileservice.dependency.LocalProfileServiceDomain;
 import org.jboss.profileservice.dependency.ProfileControllerContext;
 import org.jboss.profileservice.dependency.ProfileDependencyContext;
 import org.jboss.profileservice.dependency.ProfileServiceController;
 import org.jboss.profileservice.spi.NoSuchProfileException;
 import org.jboss.profileservice.spi.Profile;
-import org.jboss.profileservice.spi.ProfileFactory;
 import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.ProfileService;
 import org.jboss.profileservice.spi.metadata.ProfileMetaData;
@@ -70,17 +69,14 @@
    /** The management view plugin. */
    private ManagementView mgtView;
 
-   public AbstractProfileService(AbstractController parent,
-         ProfileDeployerPluginRegistry reg, ProfileFactory<ProfileMetaData, Profile> delegate)
+   public AbstractProfileService(Kernel kernel) throws Exception
    {
-      if(parent == null)
-         throw new IllegalArgumentException("null controller");
+      if(kernel == null)
+      {
+         throw new IllegalArgumentException("null kernel");
+      }
       // Create a scoped controller
-      ProfileServiceController controller = new ProfileServiceController(parent);
-      // TODO this should not be set to the controller
-      controller.setDeployerRegistry(reg);
-      controller.setProfileFactory(delegate);
-      this.controller = controller;
+      this.controller = new ProfileServiceController(kernel);
    }
    
    public DeploymentManager getDeploymentManager()
@@ -136,12 +132,14 @@
    public void activateProfile(ProfileKey key) throws NoSuchProfileException, Exception
    {
       if(key == null)
+      {
          throw new IllegalArgumentException("null profile key");
-      
+      }
       ControllerContext ctx = controller.getContext(key, null);
       if(ctx == null)
+      {
          throw new NoSuchProfileException("No such registered profile" + key);
-      
+      }
       try
       {
          controller.change(ctx, ControllerState.INSTALLED);
@@ -159,12 +157,14 @@
    public void deactivateProfile(ProfileKey key) throws NoSuchProfileException
    {
       if(key == null)
+      {
          throw new IllegalArgumentException("null profile key");
-      
+      }
       ControllerContext ctx = controller.getInstalledContext(key);
       if(ctx == null)
+      {
          throw new NoSuchProfileException("No such registered profile" + key);
-      
+      }
       try
       {
          controller.change(ctx, ControllerState.NOT_INSTALLED);
@@ -178,8 +178,9 @@
    public Profile getActiveProfile(ProfileKey key) throws NoSuchProfileException
    {
       if(key == null)
+      {
          throw new IllegalArgumentException("null profile key");
-      
+      }
       ControllerContext ctx = controller.getInstalledContext(key);
       if(ctx instanceof ProfileControllerContext)
       {
@@ -219,8 +220,9 @@
    public ProfileMetaData getProfileMetaData(ProfileKey key) throws NoSuchProfileException
    {
       if(key == null)
+      {
          throw new IllegalArgumentException("null profile key");
-      
+      }
       ControllerContext ctx = controller.getContext(key, null);
       if(ctx instanceof ProfileControllerContext)
       {
@@ -232,27 +234,31 @@
    public ProfileKey registerProfile(ProfileMetaData metaData) throws Exception
    {
       if(metaData == null)
+      {
          throw new IllegalArgumentException("null profile meta data");
-    
+      }
       return registerProfile(metaData, null);
    }
    
    public ProfileKey registerProfile(ProfileMetaData metaData, Profile profile) throws Exception
    {
       if(metaData == null)
+      {
          throw new IllegalArgumentException("null profile meta data");
-      
+      }
       // Create the profile key
       ProfileKey key = new ProfileKey(getDomainName(), getServerName(), metaData.getName());
       
       // Register
+      // TODO this should be plugable?
       ProfileDependencyContext dependency = new ProfileDependencyContext(key, metaData, domain);
       domain.addProfile(dependency);
       
       ProfileControllerContext ctx = new ProfileControllerContext(dependency);
       if(ctx == null)
+      {
          throw new IllegalStateException("created null profile context");
-      
+      }
       try
       {
          controller.install(ctx);
@@ -271,12 +277,14 @@
    public void unregisterProfile(ProfileKey key) throws NoSuchProfileException
    {
       if(key == null)
+      {
          throw new IllegalArgumentException("null profile key");
-      
+      }
       ControllerContext ctx = controller.getContext(key, null);
       if(ctx == null)
+      {
          throw new NoSuchProfileException("No such registered profile");
-      
+      }
       //
       domain.removeProfile(key);
       //
@@ -286,12 +294,14 @@
    public void validateProfile(ProfileKey key) throws Exception
    {
       if(key == null)
+      {
          throw new IllegalArgumentException("null profile key");
-      
+      }
       ControllerContext ctx = controller.getContext(key, null);
       if(ctx == null)
+      {
          throw new NoSuchProfileException("No such profile registered " + key);
-      
+      }
       validate(ctx);
    }
    
@@ -382,9 +392,13 @@
                   else
                   {
                      if (other == null)
+                     {
                         buffer.append("** NOT FOUND **");
+                     }
                      else
+                     {
                         buffer.append(otherState.getStateString());
+                     }
                   }
                   buffer.append('}');
 

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/NoopProfileDeployerPlugin.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/NoopProfileDeployerPlugin.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/NoopProfileDeployerPlugin.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -26,9 +26,15 @@
 
 import org.jboss.logging.Logger;
 import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.managed.plugins.ManagedDeploymentImpl;
+import org.jboss.profileservice.spi.NoSuchDeploymentException;
 import org.jboss.profileservice.spi.ProfileDeployment;
 
 /**
+ * A profile deployer plugin which does not perform any deployment actions.
+ * 
+ * TODO move this class to src/tests
+ * 
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
  */
@@ -77,11 +83,26 @@
       if(log.isTraceEnabled())
          log.trace("remove " + deployment);
    }
+   
+   @Override
+   public boolean isSupportRedeployment()
+   {
+      return true;
+   }
 
    @Override
-   public ManagedDeployment getManagedDeployment(ProfileDeployment deployment)
+   public ManagedDeployment getManagedDeployment(ProfileDeployment deployment) throws NoSuchDeploymentException
    {
-      return null;
+      if(deployment == null)
+      {
+         throw new IllegalArgumentException("null profile deployment");
+      }
+      if(deployments.containsKey(deployment.getName()) == false)
+      {
+         throw new NoSuchDeploymentException(deployment.getName());
+      }      
+      String deploymentName = deployment.getName();
+      return new ManagedDeploymentImpl(deploymentName, deploymentName);
    }
    
 }

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/ProfileDeployerPlugin.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/ProfileDeployerPlugin.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/ProfileDeployerPlugin.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -37,7 +37,7 @@
     * @param deployment the profile deployment.
     * @throws Exception
     */
-   public void addDeployment(ProfileDeployment deployment) throws Exception;
+   void addDeployment(ProfileDeployment deployment) throws Exception;
    
    /**
     * Remove a deployment.
@@ -45,12 +45,12 @@
     * @param deployment the profile deployment
     * @throws Exception
     */
-   public void removeDeployment(ProfileDeployment deployment) throws Exception;
+   void removeDeployment(ProfileDeployment deployment) throws Exception;
    
    /**
     * Process ...
     */
-   public void process();
+   void process();
    
    /**
     * Check complete.
@@ -58,23 +58,31 @@
     * @param names the deployment names
     * @throws Excetion
     */
-   public void checkComplete(String... names) throws Exception;
+   void checkComplete(String... names) throws Exception;
 
-   
    /**
     * Check complete.
     * 
     * @throws Exception
     */
-   public void checkComplete() throws Exception;
- 
+   void checkComplete() throws Exception;
+
+   /** 
+    * Flag indicating if redeployment is supported.
+    * 
+    * @return true if deployments can be re-added, false otherwise
+    */
+   boolean isSupportRedeployment();
+   
+   
    /**
     * Get a managed deployment.
     * 
     * @param deployment the profile deployment
     * @return the managed deployment
+    * @throws Exception if the deployment don't exist
     */
-   ManagedDeployment getManagedDeployment(ProfileDeployment deployment);
+   ManagedDeployment getManagedDeployment(ProfileDeployment deployment) throws Exception;
    
 }
 

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/ProfileDeployerPluginRegistry.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/ProfileDeployerPluginRegistry.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/ProfileDeployerPluginRegistry.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -37,7 +37,7 @@
 public class ProfileDeployerPluginRegistry
 {
    /** The default. */
-   private static final String DEFAULT = "__default___";
+   private static final String DEFAULT = "___default___";
    
    private Map<String, ProfileDeployerPlugin> map = new ConcurrentHashMap<String, ProfileDeployerPlugin>();
    

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/TypedProfileFactory.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/TypedProfileFactory.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/TypedProfileFactory.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -60,14 +60,18 @@
    public Profile createProfile(ProfileKey key, ProfileMetaData metaData) throws Exception
    {
       if(key == null)
+      {
          throw new IllegalArgumentException("Null profile key.");
+      }
       if(metaData == null)
+      {
          throw new IllegalArgumentException("Null profile meta data");
-      
+      }
       String profileType = metaData.getClass().getName();
       if(typeName.equals(profileType))
+      {
          return createNoopProfile(key, metaData);
-      
+      }
       return delegateCreate(profileType, key, metaData);
    }
 
@@ -85,8 +89,9 @@
    {
       ProfileFactory<ProfileMetaData, Profile> factory = this.factories.get(profileType);
       if(factory == null)
+      {
          throw new IllegalStateException("Unrecognized meta data type: " + profileType);
-      
+      }
       return factory.createProfile(key, metaData);      
    }
    
@@ -111,12 +116,17 @@
    public void addProfileFactory(ProfileFactory<ProfileMetaData, Profile> factory)
    {
       if(factory == null)
+      {
          throw new IllegalArgumentException("Null profile factory.");
+      }
       if(factory.getTypes() == null)
+      {
          throw new IllegalArgumentException("Null factory types.");
-      
+      }
       for(String type : factory.getTypes())
+      {
          addProfileFactory(type, factory);
+      }
    }
    
    /**
@@ -128,9 +138,13 @@
    public void addProfileFactory(String type, ProfileFactory<ProfileMetaData, Profile> factory)
    {
       if(type == null)
+      {
          throw new IllegalArgumentException("null factory type");
+      }
       if(factory == null)
+      {
          throw new IllegalArgumentException("null profile factory");
+      }
       this.factories.put(type, factory);
    }
    
@@ -142,12 +156,17 @@
    public void removeProfileFactory(ProfileFactory<ProfileMetaData, Profile> factory)
    {
       if(factory == null)
+      {
          throw new IllegalArgumentException("Null profile factory.");
+      }
       if(factory.getTypes() == null)
+      {
          throw new IllegalArgumentException("Null factory types.");
-      
+      }
       for(String type : factory.getTypes())
+      {
          removeProfileFactory(type);
+      }
    }
    
    /**
@@ -158,7 +177,9 @@
    public void removeProfileFactory(String type)
    {
       if(type == null)
+      {
          throw new IllegalArgumentException("null factory type.");
+      }
       this.factories.remove(type);
    }
 

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	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/AbstractProfileServiceBootstrap.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -23,8 +23,8 @@
 
 import org.jboss.beans.metadata.spi.BeanMetaData;
 import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
-import org.jboss.dependency.plugins.AbstractController;
 import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.kernel.Kernel;
 import org.jboss.kernel.spi.dependency.KernelController;
 import org.jboss.profileservice.AbstractProfileService;
 import org.jboss.profileservice.ManagementDomain;
@@ -52,6 +52,7 @@
    public static final String LOCALDOMAIN_BEANNAME = "org.jboss:service=LocalProfileServiceDomain";
    public static final String PROFILESERVICE_BEANNAME = "org.jboss:service=ProfileService";
 
+   protected abstract Kernel getKernel();
    protected abstract KernelController getController();
    protected abstract ProfileDeployerPluginRegistry getDeployerRegistry();
    protected abstract ProfileFactory<ProfileMetaData, Profile> getProfileFactory();
@@ -59,17 +60,17 @@
    protected ProfileService createProfileService(DomainMetaData domainMetaData) throws Throwable
    {
       if(domainMetaData == null)
+      {
          throw new IllegalArgumentException("null domain meta data");
-      
+      }
       BeanMetaData localDomain = createLocalDomain(domainMetaData);
       if(localDomain == null)
+      {
          throw new IllegalStateException("failed to create local domain");
-      
+      }
       //
       BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(PROFILESERVICE_BEANNAME, AbstractProfileService.class.getName());
-      builder.addConstructorParameter(AbstractController.class.getName(), getController());
-      builder.addConstructorParameter(ProfileDeployerPluginRegistry.class.getName(), getDeployerRegistry());
-      builder.addConstructorParameter(ProfileFactory.class.getName(), getProfileFactory());
+      builder.addConstructorParameter(Kernel.class.getName(), getKernel());
       builder.addPropertyMetaData("domain", builder.createInject(localDomain.getName()));
       
       // TODO
@@ -83,28 +84,37 @@
    {
       ManagementDomainMetaData domain = domainMetaData.getDomain();
       if(domain == null)
+      {
          throw new IllegalArgumentException("null domain meta data");
-      
+      }
       // Get the domain name
       String domainName = domain.getDomainName();
       if(domainName == null)
+      {
          throw new IllegalArgumentException("null domain name");
+      }
       domainName = domainName.trim();
       if(domainName.length() == 0)
+      {
          throw new IllegalArgumentException("empty domain name");
+      }
       
       ServerMetaData serverMetaData = domainMetaData.getServer();
       if(serverMetaData == null)
+      {
          throw new IllegalArgumentException("null server meta data");
-
+      }
       // Get the server name
       String serverName = serverMetaData.getName();
       if(serverName == null)
+      {
          throw new IllegalArgumentException("null server name");
+      }
       serverName = serverName.trim();
       if(serverName.length() == 0)
+      {
          throw new IllegalArgumentException("empty server name");
-
+      }
       // The management domain
       ManagementDomain mgtDomain = new ManagementDomain(domainName);
       
@@ -113,7 +123,10 @@
             LOCALDOMAIN_BEANNAME, LocalProfileServiceDomain.class.getName());
       builder.addConstructorParameter(ManagementDomain.class.getName(), mgtDomain);
       builder.addConstructorParameter(String.class.getName(), serverName);
-
+      // Inject the DeployersRegistry and profileFactory
+      builder.addPropertyMetaData("profileDeployers", getDeployerRegistry());
+      builder.addPropertyMetaData("profileFactory", getProfileFactory());
+      
       // Install
       BeanMetaData bmd = builder.getBeanMetaData();
       getController().install(bmd);

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/AbstractProfileAction.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/AbstractProfileAction.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/AbstractProfileAction.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -69,16 +69,9 @@
          Profile profile = ((ProfileControllerContext)context).getProfile();
          if(profile == null)
             return;
-       
-         try
-         {
-            // Uninstall
-            uninstall(profile);
-         }
-         catch (Throwable t)
-         {
-            log.error("Error when uninstalling profile: " + profile, t);
-         }
+         
+         // Uninstall
+         uninstall(profile);
       }
    }
    

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/AbstractProfileLifeCycleAction.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/AbstractProfileLifeCycleAction.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/AbstractProfileLifeCycleAction.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -63,7 +63,7 @@
       }
    }
 
-   protected static void invoke(Profile profile, String method) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
+   protected static void invoke(Profile profile, String method) throws IllegalAccessException, InvocationTargetException
    {
       Method m = null;
       try
@@ -77,11 +77,13 @@
       invoke(profile, m);
    }
 
-   private static void invoke(Profile profile, final Method method) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
+   private static void invoke(Profile profile, final Method method) throws IllegalAccessException, InvocationTargetException
    {
       SecurityManager sm = System.getSecurityManager();
       if (sm == null)
+      {
          method.setAccessible(true);
+      }
       else
       {
          AccessController.doPrivileged(new PrivilegedAction<Object>()

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/LocalProfileServiceDomain.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/LocalProfileServiceDomain.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/LocalProfileServiceDomain.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -29,9 +29,13 @@
 
 import org.jboss.logging.Logger;
 import org.jboss.profileservice.ManagementDomain;
+import org.jboss.profileservice.ProfileDeployerPluginRegistry;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileFactory;
 import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.dependency.ProfileCapability;
 import org.jboss.profileservice.spi.dependency.ProfileRequirement;
+import org.jboss.profileservice.spi.metadata.ProfileMetaData;
 
 /**
  * The local profile service domain.
@@ -51,14 +55,20 @@
    /** The server name. */
    private final String server;
 
+   /** The profile deployers registry. */
+   private ProfileDeployerPluginRegistry deployers;
+   
+   /** The profile factory. */
+   private ProfileFactory<ProfileMetaData, Profile> profileFactory;
+   
    /** The profiles. */
    private List<ProfileDependencyContext> profiles = new CopyOnWriteArrayList<ProfileDependencyContext>();
    
    /** The profiles by name. */
-   private Map<ProfileKey, ProfileDependencyContext> profilesByKey = new ConcurrentHashMap<ProfileKey, ProfileDependencyContext>();
+   private Map<String, ProfileDependencyContext> profilesByKey = new ConcurrentHashMap<String, ProfileDependencyContext>();
   
    /** The deployments to profile mapping. */
-   private Map<String, ProfileKey> deploymentsToProfiles;
+   private Map<String, String> deploymentsToProfile = new ConcurrentHashMap<String, String>();
    
    public LocalProfileServiceDomain(ManagementDomain domain, String server)
    {
@@ -74,6 +84,26 @@
       this.server = server;
    }
    
+   public ProfileDeployerPluginRegistry getProfileDeployers()
+   {
+      return deployers;
+   }
+   
+   public void setProfileDeployers(ProfileDeployerPluginRegistry deployers)
+   {
+      this.deployers = deployers;
+   }
+   
+   public ProfileFactory<ProfileMetaData, Profile> getProfileFactory()
+   {
+      return profileFactory;
+   }
+   
+   public void setProfileFactory(ProfileFactory<ProfileMetaData, Profile> profileFactory)
+   {
+      this.profileFactory = profileFactory;
+   }
+   
    public String getDomainName()
    {
       return domainName();
@@ -92,87 +122,119 @@
    public void addProfile(ProfileDependencyContext ctx)
    {
       if(ctx == null)
+      {
          throw new IllegalArgumentException("null context");
+      }
       if(ctx.getKey() == null)
+      {
          throw new IllegalArgumentException("null profile key");
-      
+      }
+      String profileName = ctx.getKey().getName();
+      if(profileName == null)
+      {
+         throw new IllegalArgumentException("null profile name");
+      }
+      profileName = profileName.trim();
+      if(profileName.length() == 0)
+      {
+         throw new IllegalArgumentException("empty profile name");
+      }
       this.profiles.add(ctx);
-      this.profilesByKey.put(ctx.getKey(), ctx);
+      this.profilesByKey.put(profileName, ctx);
    }
    
    public ProfileDependencyContext getProfile(String name)
    {
       if(name == null)
+      {
          throw new IllegalArgumentException("null profile name");
-      
-      return getProfile(new ProfileKey(domainName(), server, name));
+      }
+      return this.profilesByKey.get(name);
    }
    
    public ProfileDependencyContext getProfile(ProfileKey key)
    {
       if(key == null)
+      {
          throw new IllegalArgumentException("null profile key");
-      
-      return this.profilesByKey.get(key);
+      }
+      final String profileName = key.getName();
+      if(profileName == null)
+      {
+         throw new IllegalArgumentException("null profile name");
+      }
+      return getProfile(profileName);
    }
    
    public void removeProfile(ProfileDependencyContext ctx)
    {
       if(ctx == null)
+      {
          throw new IllegalArgumentException("null context");
+      }
       if(ctx.getKey() == null)
+      {
          throw new IllegalArgumentException("null profile key");
-      
+      }
       removeProfile(ctx.getKey());
    }
    
    public void removeProfile(ProfileKey key)
    {
       if(key == null)
+      {
          throw new IllegalArgumentException("null profile key");
-      
-      this.profiles.remove(key);
-      this.profilesByKey.remove(key);
+      }
+      final String profileName = key.getName();
+      if(profileName == null)
+      {
+         throw new IllegalArgumentException("null profle name");
+      }
+      ProfileDependencyContext ctx = this.profilesByKey.remove(profileName);
+      if(ctx != null)
+      {
+         this.profiles.remove(ctx);
+      }
    }
    
-//   TODO  
-//   public void installProfile(Profile profile) throws Exception
-//   {
-//      ProfileKey key = profile.getKey();
-//      ProfileDeployerPlugin deployer = getProfile(key).getDeployerPlugin();
-//      for(ProfileDeployment deployment : profile.getDeployments())
-//      {
-//         deployer.addDeployment(deployment);
-//         this.deploymentsToProfiles.put(deployment.getName(), key);
-//      }
-//      deployer.process();
-//      deployer.checkComplete();
-//   }
-//   
-//   public void uninstallProfile(Profile profile) throws Exception
-//   {
-//      ProfileKey key = profile.getKey();
-//      ProfileDeployerPlugin deployer = null;
-//      for(ProfileDeployment deployment : profile.getDeployments())
-//      {
-//         deployer.removeDeployment(deployment);
-//         this.deploymentsToProfiles.remove(deployment.getName());
-//      }
-//      deployer.process();
-//   }
+   public ProfileDependencyContext getDeploymentProfile(String deploymentName)
+   {
+      if(deploymentName == null)
+      {
+         throw new IllegalArgumentException("null deployment name");
+      }
+      final String profileName = this.deploymentsToProfile.get(deploymentName);
+      if(profileName != null)
+      {
+         return getProfile(profileName);
+      }
+      return null;
+   }
    
+   protected void addDeploymentToProfile(String deploymentName, ProfileKey key)
+   {
+      this.deploymentsToProfile.put(deploymentName, key.getName());
+   }
+   
+   protected String removeDeploymentToProfile(String deploymentName)
+   {
+      return this.deploymentsToProfile.remove(deploymentName);
+   }
+   
    protected String domainName()
    {
-      String domainName = domain.getName();
+      final String domainName = domain.getName();
       if(domainName == null)
+      {
          throw new IllegalStateException("null domain name");
+      }
       return domainName;
    }
    
    protected ProfileKey resolve(ProfileDependencyContext ctx, ProfileRequirement requirement)
    {
       // Resolve the requirements based on the exposed capabilities
-      boolean trace = log.isTraceEnabled();
+      final boolean trace = log.isTraceEnabled();
       for(ProfileDependencyContext child : profiles)
       {
          Collection<ProfileCapability> capabilities = child.getCapabilities();
@@ -183,7 +245,9 @@
                if(capability.resolves(requirement))
                {
                   if(trace)
+                  {
                      log.trace(child.getKey() + ":" + capability + " resolved " + requirement);
+                  }
                   return child.getKey();
                }
             }

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileControllerContext.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileControllerContext.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileControllerContext.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -42,10 +42,13 @@
    protected static ProfileKey getKey(ProfileDependencyContext ctx)
    {
       if(ctx == null)
+      {
          throw new IllegalArgumentException("null ctx");
+      }
       if(ctx.getKey() == null)
+      {
          throw new IllegalArgumentException("null profile key");
-      
+      }
       return ctx.getKey();
    }
    
@@ -58,12 +61,17 @@
    {
       super(getKey(ctx), profile != null ? ProfileControllerContextActions.instantiatedActions : ProfileControllerContextActions.defaultActions);
       if(ctx == null)
-         throw new IllegalArgumentException("null profile meta data");
+      {
+         throw new IllegalArgumentException("null profile dependency context");
+      }
       
       this.ctx = ctx;
       if(profile != null)
+      {
+         // Set the target
          setTarget(profile);
-      //
+      }
+      // Make all contexts ON_DEMAND
       setMode(ControllerMode.ON_DEMAND);
    }
    

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileControllerContextActions.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileControllerContextActions.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileControllerContextActions.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -32,7 +32,7 @@
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
  */
-public class ProfileControllerContextActions
+class ProfileControllerContextActions
 {
 
    /** The default actions. */
@@ -44,7 +44,7 @@
    static
    {
       Map<ControllerState, ControllerContextAction> actions = new HashMap<ControllerState, ControllerContextAction>();
-      actions.put(ControllerState.DESCRIBED, ProfileDescribeAction.getInstance());
+      actions.put(ProfileServiceController.PRE_DESCRIBE_STATE, ProfileDescribeAction.getInstance());
       actions.put(ControllerState.INSTANTIATED, ProfileInstantiateAction.getInstance());
       actions.put(ControllerState.CREATE, ProfileCreateAction.getInstance());
       actions.put(ControllerState.START, ProfileStartAction.getInstance());
@@ -53,8 +53,7 @@
       defaultActions = new AbstractControllerContextActions(actions);
       
       actions = new HashMap<ControllerState, ControllerContextAction>();
-      actions.put(ControllerState.DESCRIBED, ProfileDescribeAction.getInstance());
-      // actions.put(ControllerState.INSTANTIATED, ProfileInstantiateAction.getInstance());
+      actions.put(ProfileServiceController.PRE_DESCRIBE_STATE, ProfileDescribeAction.getInstance());
       actions.put(ControllerState.CREATE, ProfileCreateAction.getInstance());
       actions.put(ControllerState.START, ProfileStartAction.getInstance());
       actions.put(ProfileServiceController.DEPLOY_STATE, ProfileDeployAction.getInstance());
@@ -63,5 +62,10 @@
       
    }
    
+   protected ProfileControllerContextActions()
+   {
+      //
+   }
+   
 }
 

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileDependencyContext.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileDependencyContext.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileDependencyContext.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -27,6 +27,9 @@
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.jboss.dependency.spi.ControllerState;
+import org.jboss.profileservice.ProfileDeployerPlugin;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileFactory;
 import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.dependency.ProfileCapability;
 import org.jboss.profileservice.spi.dependency.ProfileRequirement;
@@ -35,7 +38,7 @@
 import org.jboss.profileservice.spi.metadata.ProfileMetaDataVisitorNode;
 
 /**
- * The abstract dependency context.
+ * The dependency context.
  * 
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
@@ -82,6 +85,16 @@
       return profileMetaData;
    }
    
+   public ProfileDeployerPlugin getDeployer()
+   {
+      return this.domain.getProfileDeployers().getDeployer(getProfileMetaData());
+   }
+   
+   public ProfileFactory<ProfileMetaData, Profile> getProfileFactory()
+   {
+      return this.domain.getProfileFactory();
+   }
+   
    public void addCapability(ProfileCapability capability)
    {
       this.capabilites.add(capability);
@@ -147,5 +160,6 @@
    {
       builder.append("key=").append(getKey());
    }
+   
 }
 

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileDeployAction.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileDeployAction.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileDeployAction.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -63,12 +63,13 @@
          throw new NoSuchProfileException("null profile " + ctx.getProfileKey());
       if(profile.getDeployments() != null & profile.getDeployments().isEmpty() == false)
       {
-         ProfileDeployerPlugin deployer = ((ProfileServiceController)ctx.getController()).getDeployer(ctx.getProfileMetaData());
+         // Get the deployer plugin
+         ProfileDeployerPlugin deployer = ctx.getDependencyContext().getDeployer();
          if(deployer == null)
             throw new IllegalStateException("null deployer for profile " + profile.getKey());
             
          // Deploy
-         deploy(profile, deployer);         
+         deploy(profile, deployer);
       }
    }
 
@@ -81,9 +82,10 @@
       Profile profile = ctx.getProfile();
       if(profile.getDeployments() != null & profile.getDeployments().isEmpty() == false)
       {
-         ProfileDeployerPlugin deployer = ((ProfileServiceController)ctx.getController()).getDeployer(ctx.getProfileMetaData());
-         if(profile == null || deployer == null)
-            return;
+         // Get the deployer plugin
+         ProfileDeployerPlugin deployer = ctx.getDependencyContext().getDeployer();
+         if(deployer == null)
+            throw new IllegalStateException("null deployer for profile " + profile.getKey());
          
          // Undeploy
          undeployer(profile, deployer);
@@ -108,7 +110,6 @@
                log.error("Failed to add deployment: " + deployment, e);
             }
          }
-
          // deploy
          deployer.process();
       }
@@ -132,7 +133,6 @@
                log.warn("failed to remove deployment: " + deployment, t);
             }
          }
-
          // undeploy
          deployer.process();
       }      

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileInstantiateAction.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileInstantiateAction.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileInstantiateAction.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -24,6 +24,8 @@
 import org.jboss.dependency.plugins.action.ControllerContextAction;
 import org.jboss.dependency.spi.ControllerContext;
 import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileFactory;
+import org.jboss.profileservice.spi.metadata.ProfileMetaData;
 
 /**
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
@@ -46,11 +48,8 @@
       if(context instanceof ProfileControllerContext == false) return;
       ProfileControllerContext ctx = (ProfileControllerContext) context;
       
-      if(ctx.getTarget() != null && ctx.getTarget() instanceof Profile)
-         return;
-      
-      ProfileServiceController controller = (ProfileServiceController) ctx.getController();
-      Profile profile = controller.createProfile(ctx.getProfileKey(), ctx.getProfileMetaData());
+      ProfileFactory<ProfileMetaData, Profile> factory = ctx.getDependencyContext().getProfileFactory();
+      Profile profile = factory.createProfile(ctx.getProfileKey(), ctx.getProfileMetaData());
       if(profile == null)
          throw new IllegalStateException("created null profile");
       

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	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileServiceController.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -21,17 +21,27 @@
  */ 
 package org.jboss.profileservice.dependency;
 
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
 import org.jboss.dependency.plugins.AbstractController;
-import org.jboss.dependency.plugins.ScopedController;
+import org.jboss.dependency.plugins.action.ControllerContextAction;
+import org.jboss.dependency.spi.ControllerContext;
 import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.dependency.AbstractKernelController;
+import org.jboss.kernel.plugins.dependency.InstallExistingScopeAction;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.kernel.spi.event.KernelEvent;
+import org.jboss.kernel.spi.event.KernelEventFilter;
+import org.jboss.kernel.spi.event.KernelEventListener;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.kernel.spi.registry.KernelRegistryPlugin;
 import org.jboss.metadata.spi.scope.CommonLevels;
 import org.jboss.metadata.spi.scope.ScopeKey;
-import org.jboss.profileservice.ProfileDeployerPlugin;
-import org.jboss.profileservice.ProfileDeployerPluginRegistry;
-import org.jboss.profileservice.spi.Profile;
-import org.jboss.profileservice.spi.ProfileFactory;
-import org.jboss.profileservice.spi.ProfileKey;
-import org.jboss.profileservice.spi.metadata.ProfileMetaData;
 
 /**
  * A scoped controller for the profile controller context.
@@ -39,46 +49,170 @@
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
  */
-public class ProfileServiceController extends ScopedController
+public class ProfileServiceController extends AbstractKernelController
 {
    
+   /** The pre describe state. */
+   public static final ControllerState PRE_DESCRIBE_STATE = new ControllerState("Pre_Describe"); 
+   
    /** The deploy state. */
    public static final ControllerState DEPLOY_STATE = new ControllerState("Deploy"); 
    
-   /** The profile factory. */
-   private ProfileFactory<ProfileMetaData, Profile> profileFactory;
-   
-   /** The deployers registry. */
-   private ProfileDeployerPluginRegistry registry;
-   
-   public ProfileServiceController(AbstractController parentController)
+   public ProfileServiceController(Kernel kernel) throws Exception
    {
-      setScopeKey(new ScopeKey(CommonLevels.SUBSYSTEM, "Profile"));
-      setParentController(parentController);
-      setUnderlyingController(this);
+      super();
+      setScopeKey(new ScopeKey(CommonLevels.SERVER, "ProfileService"));
+      if (kernel.getController() instanceof AbstractController == false)
+         throw new IllegalArgumentException("Underlying controller does not extend AbstractController.");
+      this.kernel = kernel;
+      setParentController((AbstractController) kernel.getController());
+      // setUnderlyingController(this);
       getParentController().addController(this);
+      addState(PRE_DESCRIBE_STATE, ControllerState.DESCRIBED);
       addState(DEPLOY_STATE, ControllerState.INSTALLED);
    }
-   
-   public void setProfileFactory(ProfileFactory<ProfileMetaData, Profile> factory)
+
+   /**
+    * Get parent kernel controller.
+    *
+    * @return kernel controller
+    */
+   private KernelController getParentKernelController()
    {
-      this.profileFactory = factory;
+      return (KernelController)getParentController();
    }
-   
-   public Profile createProfile(ProfileKey key, ProfileMetaData metaData) throws Exception
+
+   // Scoped helper methods 
+
+   void addScopedControllerContext(ControllerContext context)
    {
-      return this.profileFactory.createProfile(key, metaData);
+      super.addControllerContext(context);
    }
-   
-   public void setDeployerRegistry(ProfileDeployerPluginRegistry registry)
+
+   void removeScopedControllerContext(ControllerContext context)
    {
-      this.registry = registry;
+      super.removeControllerContext(context);
    }
 
-   public ProfileDeployerPlugin getDeployer(ProfileMetaData metaData)
+   /**
+    * Perform release of resources.
+    */
+   void release()
    {
-      return registry.getDeployer(metaData);
+      getParentController().removeController(this);
+      setUnderlyingController(null);
+      setParentController(null);
    }
+
+   // Controller methods
+
+   protected Map<ControllerState, ControllerContextAction> createAliasActions()
+   {
+      Map<ControllerState, ControllerContextAction> map = new HashMap<ControllerState, ControllerContextAction>(super.createAliasActions());
+      map.put(ControllerState.PRE_INSTALL, InstallExistingScopeAction.INSTANCE);
+      return map;
+   }
+
+   // override, since kernel's contexts are extended with registry plugin
+   public ControllerContext getContextLocally(Object name, ControllerState state)
+   {
+      return super.getContext(name, state);
+   }
+
+   public ControllerContext getContext(Object name, ControllerState state)
+   {
+      ControllerContext context = super.getContext(name, state);
+      if (context != null)
+      {
+         return context;
+      }
+      return getParentController().getContext(name, state);
+   }
+
+   public Set<ControllerContext> getNotInstalled()
+   {
+      Set<ControllerContext> uninstalled = new HashSet<ControllerContext>(getParentController().getNotInstalled());
+      uninstalled.addAll(super.getNotInstalled());
+      return uninstalled;
+   }
+
+   // KernelController methods
+
+   public void fireKernelEvent(KernelEvent event)
+   {
+      getParentKernelController().fireKernelEvent(event);
+   }
+
+   public void registerListener(KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable
+   {
+      getParentKernelController().registerListener(listener, filter, handback);
+   }
+
+   public void unregisterListener(KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable
+   {
+      getParentKernelController().unregisterListener(listener, filter, handback);
+   }
+
+   public Set<KernelControllerContext> getInstantiatedContexts(Class<?> clazz)
+   {
+      lockRead();
+      try
+      {
+         Set<KernelControllerContext> contexts = new HashSet<KernelControllerContext>();
+         Set<KernelControllerContext> currentContexts = super.getInstantiatedContexts(clazz);
+         if (currentContexts != null && currentContexts.size() > 0)
+         {
+            contexts.addAll(currentContexts);
+         }
+         Set<KernelControllerContext> parentContexts = getParentKernelController().getInstantiatedContexts(clazz);
+         if (parentContexts != null && parentContexts.size() > 0)
+         {
+            contexts.addAll(parentContexts);
+         }
+         return contexts.size() > 0 ? contexts : null;
+      }
+      finally{
+         unlockRead();
+      }
+   }
+
+   public Set<KernelControllerContext> getContexts(Class<?> clazz, ControllerState state)
+   {
+      lockRead();
+      try
+      {
+         Set<KernelControllerContext> contexts = new HashSet<KernelControllerContext>();
+         Set<KernelControllerContext> currentContexts = super.getContexts(clazz, state);
+         if (currentContexts != null && currentContexts.size() > 0)
+         {
+            contexts.addAll(currentContexts);
+         }
+         Set<KernelControllerContext> parentContexts = getParentKernelController().getContexts(clazz, state);
+         if (parentContexts != null && parentContexts.size() > 0)
+         {
+            contexts.addAll(parentContexts);
+         }
+         return contexts.size() > 0 ? contexts : null;
+      }
+      finally{
+         unlockRead();
+      }
+   }
+
+   // org.jboss.kernel.spi.registry.KernelRegistry plugin method
+
+   public KernelRegistryEntry getEntry(Object name)
+   {
+      KernelRegistryEntry entry = super.getEntry(name);
+      if (entry != null)
+         return entry;
+      if (getParentController() instanceof KernelRegistryPlugin)
+      {
+         return ((KernelRegistryPlugin)getParentController()).getEntry(name);
+      }
+      return null;
+   }
+
    
 }
 

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/metadata/ProfilesMetaDataFactory.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/metadata/ProfilesMetaDataFactory.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/metadata/ProfilesMetaDataFactory.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -128,8 +128,6 @@
    protected void processProfiles(URL url) throws Exception
    {
       InputStream is = url.openStream();
-      if(is == null)
-         throw new IllegalStateException("Could not open stream " + url);
       processProfilesMetaData(unmarshal(is, ProfilesMetaData.class));
    }
    

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/AbstractImmutableProfile.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/AbstractImmutableProfile.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/AbstractImmutableProfile.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -24,6 +24,7 @@
 import java.net.URI;
 import java.util.List;
 
+import org.jboss.logging.Logger;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.ProfileDeployment;
@@ -42,6 +43,9 @@
    /** The profile key. */
    private ProfileKey key;
   
+   /** The logger. */
+   private static final Logger log = Logger.getLogger(AbstractImmutableProfile.class);
+   
    public AbstractImmutableProfile(ProfileKey key, URI[] uris)
    {
       super(uris);

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/AbstractVFSProfileSource.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/AbstractVFSProfileSource.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/AbstractVFSProfileSource.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -70,7 +70,7 @@
    private volatile long lastModified;
    
    /** The logger. */
-   protected final Logger log = Logger.getLogger(getClass());
+   private final static Logger log = Logger.getLogger(AbstractVFSProfileSource.class);
    
    /** The deployment factory. */
    private final static ProfileDeploymentFactory deploymentFactory = ProfileDeploymentFactory.getInstance();

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/FilteredProfile.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/FilteredProfile.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/FilteredProfile.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -26,6 +26,7 @@
 import java.util.Collection;
 import java.util.List;
 
+import org.jboss.logging.Logger;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.ProfileDeployment;
@@ -45,6 +46,9 @@
    /** The deployments names. */
    private final Collection<String> deploymentNames;
    
+   /** The logger. */
+   private static final Logger log = Logger.getLogger(FilteredProfile.class);
+   
    public FilteredProfile(ProfileKey key, Collection<String> deploymentNames, URI[] uris)
    {
       super(uris);

Deleted: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/bootstrap/BootstrapDeployAction.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/bootstrap/BootstrapDeployAction.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/bootstrap/BootstrapDeployAction.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -1,80 +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.profile.bootstrap;
-
-import org.jboss.logging.Logger;
-import org.jboss.profileservice.ProfileDeployerPlugin;
-import org.jboss.profileservice.dependency.ProfileDeployAction;
-import org.jboss.profileservice.spi.Profile;
-import org.jboss.profileservice.spi.ProfileDeployment;
-
-/**
- * A deploy action used for the BootstrapDeployerPlugin.
- * 
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class BootstrapDeployAction extends ProfileDeployAction
-{
-
-   /** The instance. */
-   protected final static BootstrapDeployAction instance = new BootstrapDeployAction();
-   
-   public static BootstrapDeployAction getInstance()
-   {
-      return instance;
-   }
-   
-   /** The logger. */
-   private static final Logger log = Logger.getLogger(BootstrapDeployAction.class);
-   
-   @Override
-   protected void deploy(Profile profile, ProfileDeployerPlugin deployer) throws Exception
-   {
-      boolean trace = log.isTraceEnabled();
-      for(ProfileDeployment deployment : profile.getDeployments())
-      {
-         if(trace) log.trace("Deploying " + deployment);
-         deployer.addDeployment(deployment);
-      }
-   }
-   
-   @Override
-   protected void undeployer(Profile profile, ProfileDeployerPlugin deployer)
-   {
-      boolean trace = log.isTraceEnabled();
-      for(ProfileDeployment deployment : profile.getDeployments())
-      {
-         try
-         {
-            if(trace) log.trace("Undeploying " + deployment);
-            deployer.removeDeployment(deployment);
-         }
-         catch(Throwable t)
-         {
-            log.debug("failed to undeploy " + deployment, t);
-         }
-      }
-   }
-   
-}
-

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/bootstrap/BootstrapDeployerPlugin.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/bootstrap/BootstrapDeployerPlugin.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/profile/bootstrap/BootstrapDeployerPlugin.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -67,7 +67,7 @@
       }
       catch(Throwable t)
       {
-         throw new RuntimeException("failed to deploy " + deployment);
+         throw new RuntimeException("failed to deploy " + deployment, t);
       }
    }
 
@@ -117,6 +117,12 @@
    }
    
    @Override
+   public boolean isSupportRedeployment()
+   {
+      return false;
+   }
+   
+   @Override
    public ManagedDeployment getManagedDeployment(ProfileDeployment deployment)
    {
       if(deployment == 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	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/ProfileDeploymentFactory.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -21,13 +21,7 @@
  */ 
 package org.jboss.profileservice.repository;
 
-import org.jboss.profileservice.repository.artifact.DelegatingArtifactRepository;
 import org.jboss.profileservice.spi.ProfileDeployment;
-import org.jboss.profileservice.spi.repository.ArtifactId;
-import org.jboss.profileservice.spi.repository.ArtifactRepository;
-import org.jboss.profileservice.spi.virtual.VirtualDeployment;
-import org.jboss.profileservice.spi.virtual.assembly.VirtualDeploymentAssemblyContext;
-import org.jboss.profileservice.virtual.assembly.AbstractVirtualDeploymentAssembly;
 import org.jboss.virtual.VirtualFile;
 
 /**
@@ -36,7 +30,7 @@
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
  */
-public class ProfileDeploymentFactory extends AbstractVirtualDeploymentAssembly
+public class ProfileDeploymentFactory
 {
 
    /** The instance. */
@@ -47,42 +41,28 @@
       return instance;
    }
    
-   public ProfileDeploymentFactory()
+   private ProfileDeploymentFactory()
    {
-      super(DelegatingArtifactRepository.getInstance());
+      //
    }
-   
-   public ProfileDeploymentFactory(ArtifactRepository<ArtifactId> repository)
-   {
-      super(repository);
-   }
 
    public ProfileDeployment createDeployment(String name)
    {
       if(name == null)
+      {
          throw new IllegalArgumentException("null deployment name");
+      }
       return new BasicProfileDeployment(name);
    }
    
    public ProfileDeployment createDeployment(VirtualFile vf)
    {
       if(vf == null)
+      {
          throw new IllegalArgumentException("null virtual file");
+      }
       return new BasicProfileDeployment(vf);
    }
    
-   public ProfileDeployment createDeployment(VirtualDeployment deployment) throws Exception
-   {
-      if(deployment == null)
-         throw new IllegalArgumentException("null virtual deployment");
-      
-      // Assemble the virtual deployment
-      VirtualDeploymentAssemblyContext ctx = assemble(deployment);
-      VirtualFile vf = ctx.getRoot();
-      if(vf == null)
-         throw new IllegalStateException("Assembled null virtual file");
-      
-      return new BasicProfileDeployment(vf, ctx);
-   }
 }
 

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	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/AbstractArtifactRepository.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -42,9 +42,6 @@
    
    /** The repository root. */
    private VirtualFile repositoryRoot;
-
-   /** Is mutable. */
-   private boolean mutable;
    
    public AbstractArtifactRepository(String type, URI root) throws IOException
    {
@@ -80,7 +77,7 @@
    @Override
    public boolean isMutable()
    {
-      return this.mutable;
+      return getConfiguration().isMutable();
    }
    
 }

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	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/BasicRepositoryConfiguration.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -39,7 +39,7 @@
    private URI location;
    
    /** IsMutable. */
-   private boolean mutable = false;
+   private final boolean mutable;
  
    public BasicRepositoryConfiguration(String type, URI location)
    {

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/DelegatingArtifactRepository.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/DelegatingArtifactRepository.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/DelegatingArtifactRepository.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -22,7 +22,9 @@
 package org.jboss.profileservice.repository.artifact;
 
 import java.io.IOException;
+import java.net.URI;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -44,6 +46,9 @@
    /** The instance. */
    private static final DelegatingArtifactRepository instance = new DelegatingArtifactRepository();
    
+   /** The configuration. */
+   private final ArtifactRepositoryConfiguration configuration;
+   
    /** The repositories. */
    private Map<String, ArtifactRepository<ArtifactId>> repositories = new ConcurrentHashMap<String, ArtifactRepository<ArtifactId>>();
    
@@ -54,25 +59,24 @@
    
    private DelegatingArtifactRepository()
    {
-      
+      this.configuration = new DelegatingRepositoryConfiguraiton();
    }
    
    public ArtifactRepositoryConfiguration getConfiguration()
    {
-      return null; // TODO
+      return this.configuration;
    }
    
    @Override
    public Collection<Artifact<ArtifactId>> getArtifacts()
    {
       // FIXME getArtifacts
-      return null;
+      return Collections.emptySet();
    }
    
    @Override
    public boolean isMutable()
    {
-      // FIXME isMutable
       return false;
    }
    
@@ -93,11 +97,13 @@
       return getRepository(artifact).getArtifactFile(artifact);
    }
 
-   protected ArtifactRepository<ArtifactId> getRepository(ArtifactId artifact)
+   public ArtifactRepository<ArtifactId> getRepository(ArtifactId artifact)
    {
       ArtifactRepository<ArtifactId> repository = this.repositories.get(artifact.getType());
       if(repository == null)
+      {
          throw new IllegalStateException("failed to find repository for artifact " + artifact);
+      }
       return repository; 
    }
  
@@ -116,6 +122,28 @@
    {
       this.repositories.put(type, repository);
    }
+
+   static class DelegatingRepositoryConfiguraiton implements ArtifactRepositoryConfiguration
+   {
+      @Override
+      public URI getLocation()
+      {
+         // FIXME
+         return null;
+      }
+
+      @Override
+      public String getType()
+      {
+         return DelegatingArtifactRepository.class.getName();
+      }
+
+      @Override
+      public boolean isMutable()
+      {
+         return false;
+      }
+   }
    
 }
 

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/FileArtifact.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/FileArtifact.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/FileArtifact.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -21,52 +21,22 @@
 */
 package org.jboss.profileservice.repository.artifact.file;
 
-import javax.xml.bind.annotation.XmlAttribute;
+import org.jboss.profileservice.repository.artifact.AbstractArtifact;
+import org.jboss.profileservice.spi.repository.ArtifactRepository;
 
-import org.jboss.profileservice.repository.artifact.AbstractArtifactId;
-
 /**
+ * Basic file artifact.
+ * 
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
  */
-public class FileArtifact extends AbstractArtifactId
+public class FileArtifact extends AbstractArtifact<FileArtifactId>
 {
 
-   /** The type. */
-   public final static String TYPE = FileArtifact.class.getName();
-   
-   /** The relative path. */
-   private String path;
-   
-   public FileArtifact()
+   public FileArtifact(FileArtifactId identifier, ArtifactRepository<FileArtifactId> repository)
    {
-      //
+      super(identifier, repository);
    }
-   
-   public FileArtifact(String path)
-   {
-      if(path == null)
-         throw new IllegalArgumentException("null path name");
-      
-      this.path = path;
-   }   
-   
-   @XmlAttribute(name = "path")
-   public String getPath()
-   {
-      return path;
-   }
-   
-   public void setPath(String path)
-   {
-      this.path = path;
-   }
-   
-   @Override
-   public String getType()
-   {
-      return TYPE;
-   }
-   
+
 }
 

Copied: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/FileArtifactId.java (from rev 93603, projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/FileArtifact.java)
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/FileArtifactId.java	                        (rev 0)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/FileArtifactId.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,72 @@
+/*
+* 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.repository.artifact.file;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+import org.jboss.profileservice.repository.artifact.AbstractArtifactId;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class FileArtifactId extends AbstractArtifactId
+{
+
+   /** The type. */
+   public final static String TYPE = FileArtifactId.class.getName();
+   
+   /** The relative path. */
+   private String path;
+   
+   public FileArtifactId()
+   {
+      //
+   }
+   
+   public FileArtifactId(String path)
+   {
+      if(path == null)
+         throw new IllegalArgumentException("null path name");
+      
+      this.path = path;
+   }   
+   
+   @XmlAttribute(name = "path")
+   public String getPath()
+   {
+      return path;
+   }
+   
+   public void setPath(String path)
+   {
+      this.path = path;
+   }
+   
+   @Override
+   public String getType()
+   {
+      return TYPE;
+   }
+   
+}
+

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	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/file/LocalFileArtifactRepository.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -25,6 +25,7 @@
 import java.net.URI;
 import java.net.URL;
 import java.util.Collection;
+import java.util.Collections;
 
 import org.jboss.profileservice.repository.artifact.AbstractArtifactRepository;
 import org.jboss.profileservice.spi.repository.Artifact;
@@ -35,16 +36,16 @@
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
  */
-public class LocalFileArtifactRepository extends AbstractArtifactRepository<FileArtifact>
+public class LocalFileArtifactRepository extends AbstractArtifactRepository<FileArtifactId>
 {
 
    public LocalFileArtifactRepository(URI rootURI) throws IOException
    {
-      super(FileArtifact.TYPE, rootURI);
+      super(FileArtifactId.TYPE, rootURI);
    }
    
    @Override
-   public boolean containsArtifact(FileArtifact artifact)
+   public boolean containsArtifact(FileArtifactId artifact)
    {
       try
       {
@@ -57,19 +58,19 @@
    }
    
    @Override
-   public Artifact<FileArtifact> getArtifact(FileArtifact artifactId)
+   public Artifact<FileArtifactId> getArtifact(FileArtifactId artifactId)
    {
-      return null;
+      return new FileArtifact(artifactId, this);
    }
    
    @Override
-   public Collection<Artifact<FileArtifact>> getArtifacts()
+   public Collection<Artifact<FileArtifactId>> getArtifacts()
    {
-      return null;
+      return Collections.emptySet();
    }
    
    @Override
-   public VirtualFile getArtifactFile(FileArtifact artifact) throws IOException
+   public VirtualFile getArtifactFile(FileArtifactId artifact) throws IOException
    {
       if(artifact == null)
       {

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/legacy/AbstractDeploymentRepository.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/legacy/AbstractDeploymentRepository.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/legacy/AbstractDeploymentRepository.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -30,6 +30,7 @@
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.jboss.logging.Logger;
 import org.jboss.profileservice.profile.AbstractVFSProfileSource;
 import org.jboss.profileservice.spi.DeploymentContentFlags;
 import org.jboss.profileservice.spi.DeploymentRepository;
@@ -56,6 +57,9 @@
    /** The content flags. */
    private Map<String, Integer> contentFlags = new ConcurrentHashMap<String, Integer>();
       
+   /** The logger. */
+   private static final Logger log = Logger.getLogger(AbstractDeploymentRepository.class);
+   
    public AbstractDeploymentRepository(ProfileKey key, URI[] uris)
    {
       super(uris);

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/legacy/BasicDeploymentRepository.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/legacy/BasicDeploymentRepository.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/legacy/BasicDeploymentRepository.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -36,6 +36,7 @@
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.zip.ZipInputStream;
 
+import org.jboss.logging.Logger;
 import org.jboss.profileservice.spi.DeploymentContentFlags;
 import org.jboss.profileservice.spi.DeploymentOption;
 import org.jboss.profileservice.spi.ModificationInfo;
@@ -62,6 +63,9 @@
    /** A lock for the hot deployment/{@link #getModifiedDeployments()} */
    private ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true);
    
+   /** The Logger. */
+   private static final Logger log = Logger.getLogger(BasicDeploymentRepository.class);
+   
    public BasicDeploymentRepository(ProfileKey key, URI[] uris)
    {
       super(key, uris);

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/legacy/DeploymentUtils.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/legacy/DeploymentUtils.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/legacy/DeploymentUtils.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -38,9 +38,16 @@
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
  */
-public class DeploymentUtils
+class DeploymentUtils
 {
+   /** The buffer size. */
+   static final int BUFFER_SIZE = 1024; 
    
+   protected DeploymentUtils()
+   {
+      //
+   }
+   
    /**
     * Try to unpack an inputStream.
     * This is a fork of {@link JarUtils#unjar}, but does not close the
@@ -61,7 +68,7 @@
          throw new IOException("Destination must be a directory.");
       }
       JarInputStream jin = new JarInputStream(in);
-      byte[] buffer = new byte[1024];
+      byte[] buffer = new byte[BUFFER_SIZE];
       
       ZipEntry entry = jin.getNextEntry();
       while (entry != null)

Added: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/virtual/VirtualDeploymentRepository.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/virtual/VirtualDeploymentRepository.java	                        (rev 0)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/virtual/VirtualDeploymentRepository.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,68 @@
+/*
+* 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.repository.virtual;
+
+import org.jboss.profileservice.repository.BasicProfileDeployment;
+import org.jboss.profileservice.repository.artifact.DelegatingArtifactRepository;
+import org.jboss.profileservice.spi.ProfileDeployment;
+import org.jboss.profileservice.spi.repository.ArtifactId;
+import org.jboss.profileservice.spi.repository.ArtifactRepository;
+import org.jboss.profileservice.spi.virtual.VirtualDeployment;
+import org.jboss.profileservice.spi.virtual.assembly.VirtualDeploymentAssemblyContext;
+import org.jboss.profileservice.virtual.assembly.AbstractVirtualDeploymentAssembly;
+import org.jboss.virtual.VirtualFile;
+
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class VirtualDeploymentRepository extends AbstractVirtualDeploymentAssembly
+{
+   
+   public VirtualDeploymentRepository()
+   {
+      super(DelegatingArtifactRepository.getInstance());
+   }
+   
+   public VirtualDeploymentRepository(ArtifactRepository<ArtifactId> artifactRepository)
+   {
+      super(artifactRepository);
+   }
+   
+   public ProfileDeployment createDeployment(VirtualDeployment deployment) throws Exception
+   {
+      if(deployment == null)
+         throw new IllegalArgumentException("null virtual deployment");
+      
+      // Assemble the virtual deployment
+      VirtualDeploymentAssemblyContext ctx = assemble(deployment);
+      VirtualFile vf = ctx.getRoot();
+      if(vf == null)
+      {
+         throw new IllegalStateException("Assembled null virtual file");
+      }
+      return new BasicProfileDeployment(vf, ctx);
+   }
+   
+}
+

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/BasicVirtualAssemblyContext.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/BasicVirtualAssemblyContext.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/BasicVirtualAssemblyContext.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -140,9 +140,13 @@
       Collection<String> paths = addVirtualPath(vf, artifact);
       // TODO
       if(artifact.isMetaDataPath())
+      {
          getMetaDataLocations().addAll(paths);
+      }
       else
+      {
          getClassPathLocations().addAll(paths);
+      }
    }   
    
    protected VirtualFile createPath(VirtualArtifactMetaData path) throws IOException

Modified: 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	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/StructureMetaDataBuilder.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -70,7 +70,6 @@
       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())

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/deployment/AbstractVirtualDeployment.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/deployment/AbstractVirtualDeployment.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/deployment/AbstractVirtualDeployment.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -85,8 +85,8 @@
     * @return the path.
     */
    @XmlElements({
-      @XmlElement(name = "file", type = AbstractVirtualFileArtifact.class),
-      @XmlElement(name = "artifact", type = VirtualMavenArtifactMetaData.class)
+      @XmlElement(name = "file", type = AbstractVirtualFileArtifact.class)
+      // @XmlElement(name = "artifact", type = VirtualMavenArtifactMetaData.class)
    })
    public VirtualArtifactMetaData getPath()
    {

Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/deployment/AbstractVirtualFileArtifact.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/deployment/AbstractVirtualFileArtifact.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/deployment/AbstractVirtualFileArtifact.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -26,7 +26,7 @@
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlType;
 
-import org.jboss.profileservice.repository.artifact.file.FileArtifact;
+import org.jboss.profileservice.repository.artifact.file.FileArtifactId;
 import org.jboss.profileservice.spi.virtual.PathRestriction;
 import org.jboss.profileservice.spi.virtual.VirtualArtifactMetaData;
 
@@ -37,7 +37,7 @@
  * @version $Revision$
  */
 @XmlType(propOrder = { "path", "includes", "excludes" })
-public class AbstractVirtualFileArtifact extends FileArtifact implements VirtualArtifactMetaData
+public class AbstractVirtualFileArtifact extends FileArtifactId implements VirtualArtifactMetaData
 {
 
    /** The includes. */

Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/ProfileServiceTestBase.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/ProfileServiceTestBase.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/ProfileServiceTestBase.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -25,9 +25,7 @@
 import java.io.InputStream;
 import java.net.URL;
 
-import junit.framework.TestCase;
-
-import org.jboss.logging.Logger;
+import org.jboss.test.BaseTestCase;
 import org.jboss.xb.binding.JBossXBException;
 import org.jboss.xb.binding.Unmarshaller;
 import org.jboss.xb.binding.UnmarshallerFactory;
@@ -39,15 +37,12 @@
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
  */
-public abstract class ProfileServiceTestBase extends TestCase
+public abstract class ProfileServiceTestBase extends BaseTestCase
 {
-
-   /** The logger. */
-   protected final Logger log = Logger.getLogger(getClass());
    
-   protected Logger getLog()
+   public ProfileServiceTestBase(String name)
    {
-      return this.log;
+      super(name);
    }
    
    protected <T> T unmarshal(String resource, Class<T> clazz) throws IOException, JBossXBException
@@ -77,5 +72,15 @@
       }
    }
    
+   public URL getResource(String name)
+   {
+      URL url = super.getResource(name);
+      if(url == null)
+      {
+         url = Thread.currentThread().getContextClassLoader().getResource(name);
+      }
+      return url;
+   }
+   
 }
 

Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/repository/test/ArtifactRepositoryUnitTestCase.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/repository/test/ArtifactRepositoryUnitTestCase.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/repository/test/ArtifactRepositoryUnitTestCase.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -23,16 +23,16 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URL;
 
 import org.jboss.profileservice.profile.metadata.ProfilesMetaData;
 import org.jboss.profileservice.repository.ProfileDeploymentFactory;
 import org.jboss.profileservice.repository.artifact.DelegatingArtifactRepository;
-import org.jboss.profileservice.repository.artifact.file.FileArtifact;
+import org.jboss.profileservice.repository.artifact.file.FileArtifactId;
 import org.jboss.profileservice.repository.artifact.file.LocalFileArtifactRepository;
 import org.jboss.profileservice.repository.artifact.maven.LocalMavenArtifactRepository;
 import org.jboss.profileservice.repository.artifact.maven.MavenArtifactId;
 import org.jboss.profileservice.repository.artifact.maven.MavenArtifactRepositoryMetaData;
+import org.jboss.profileservice.repository.virtual.VirtualDeploymentRepository;
 import org.jboss.profileservice.spi.ProfileDeployment;
 import org.jboss.profileservice.spi.metadata.ProfileDeploymentMetaData;
 import org.jboss.profileservice.spi.metadata.ProfileMetaData;
@@ -48,15 +48,20 @@
 public class ArtifactRepositoryUnitTestCase extends ProfileServiceTestBase
 {
    
+   public ArtifactRepositoryUnitTestCase(String name)
+   {
+      super(name);
+   }
+   
    public void testVirtualDeploymentAssembly() throws Exception
    {      
       //
       MavenArtifactRepositoryMetaData metaData = unmarshal(getIS("repository/artifacts.xml"), MavenArtifactRepositoryMetaData.class);
       ProfilesMetaData profiles = unmarshal(getIS("repository/profiles.xml"), ProfilesMetaData.class);
-      DelegatingArtifactRepository repository = createRepository(metaData);
+      createRepository(metaData);
       
       //
-      ProfileDeploymentFactory factory = new ProfileDeploymentFactory(repository);
+      VirtualDeploymentRepository factory = new VirtualDeploymentRepository();
       for(ProfileMetaData md : profiles.getProfiles())
       {
          for(ProfileDeploymentMetaData deployment : md.getDeployments())
@@ -71,7 +76,7 @@
    protected DelegatingArtifactRepository createRepository(MavenArtifactRepositoryMetaData metaData) throws Exception
    {
       DelegatingArtifactRepository repository = DelegatingArtifactRepository.getInstance();
-      repository.addRepository(FileArtifact.TYPE, (ArtifactRepository) new LocalFileArtifactRepository(getResource("repository/static").toURI()));
+      repository.addRepository(FileArtifactId.TYPE, (ArtifactRepository) new LocalFileArtifactRepository(getResource("repository/static").toURI()));
       repository.addRepository(MavenArtifactId.TYPE, (ArtifactRepository) new LocalMavenArtifactRepository(metaData, getResource("repository").toURI()));
       return repository;
    }
@@ -81,10 +86,5 @@
       return getResource(name).openStream();
    }
    
-   protected URL getResource(String name)
-   {
-      return Thread.currentThread().getContextClassLoader().getResource(name);
-   }
-   
 }
 

Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/support/ProfileServiceBootstrap.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/support/ProfileServiceBootstrap.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/support/ProfileServiceBootstrap.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -50,6 +50,11 @@
       this.kernel = kernel;
    }
 
+   protected Kernel getKernel()
+   {
+      return this.kernel;
+   }
+   
    @Override
    protected KernelController getController()
    {

Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/test/AbstractProfileServiceTest.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/test/AbstractProfileServiceTest.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/test/AbstractProfileServiceTest.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -49,6 +49,11 @@
    /** The basic xml deployer. */
    private BasicXMLDeployer deployer;
    
+   public AbstractProfileServiceTest(String name)
+   {
+      super(name);
+   }
+   
    @Override
    public void setUp() throws Exception
    {
@@ -66,11 +71,6 @@
       getController().shutdown();
    }
    
-   protected Logger getLog()
-   {
-      return this.log;
-   }
-   
    protected Kernel getKernel()
    {
       return kernel;
@@ -112,11 +112,6 @@
       bootstrap.run();
       return bootstrap.getKernel();
    }
-
-   static URL getResource(String name)
-   {
-      return Thread.currentThread().getContextClassLoader().getResource(name);
-   }
    
 }
 

Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/test/BasicProfileServiceUnitTestCase.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/test/BasicProfileServiceUnitTestCase.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/test/BasicProfileServiceUnitTestCase.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -21,13 +21,17 @@
  */ 
 package org.jboss.test.profileservice.test;
 
+import java.net.URL;
 import java.util.List;
 
+import org.jboss.profileservice.dependency.LocalProfileServiceDomain;
 import org.jboss.profileservice.metadata.ProfilesMetaDataFactory;
+import org.jboss.profileservice.repository.legacy.BasicProfileFactory;
 import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.ProfileService;
 import org.jboss.profileservice.spi.metadata.ProfileMetaData;
 
+
 /**
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
@@ -37,10 +41,15 @@
 
    static
    {
-      System.setProperty("jboss.common.profiles.url", getResource("bootstrap/").toExternalForm());
-      System.setProperty("jboss.common.deployments.url", getResource("bootstrap/").toExternalForm());
+      System.setProperty("jboss.common.profiles.url", findResource("bootstrap/").toExternalForm());
+      System.setProperty("jboss.common.deployments.url", findResource("bootstrap/").toExternalForm());
    }
    
+   public BasicProfileServiceUnitTestCase(String name)
+   {
+      super(name);
+   }
+   
    public void test() throws Exception
    {
       // Bootstrap ProfileService
@@ -55,14 +64,38 @@
       
       // Now get the ProfileService
       ProfileService ps = getBean("org.jboss:service=ProfileService", ProfileService.class);
+      LocalProfileServiceDomain domain = getBean("org.jboss:service=LocalProfileServiceDomain", LocalProfileServiceDomain.class);
       
       // And activate the profiles
       for(ProfileKey key : ps.getProfileKeys())
       {
          ps.activateProfile(key);
       }
+      for(ProfileKey key : ps.getProfileKeys())
+      {
+         ps.validateProfile(key);         
+      }
+      // Check the profile.xml
+      assertNotNull(getBean("Basic Profile Factory", BasicProfileFactory.class));
 
+      //
+//      for(ProfileKey key : ps.getActiveProfileKeys())
+//      {
+//         Profile profile = ps.getActiveProfile(key);
+//         for(String deployment : profile.getDeploymentNames())
+//         {
+//            ProfileDependencyContext ctx = domain.getDeploymentProfile(deployment);
+//            assertNotNull(ctx);
+//            getLog().debug(deployment + " maps to " + ctx.getKey());
+//            assertEquals(key, ctx.getKey());
+//         }
+//      }
    }
    
+   static URL findResource(String name)
+   {
+      return Thread.currentThread().getContextClassLoader().getResource(name);
+   }
+   
 }
 

Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/AbstractVirtualAssemblyTestCase.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/AbstractVirtualAssemblyTestCase.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/AbstractVirtualAssemblyTestCase.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -43,6 +43,11 @@
    /** The repository location. */
    protected final static String REPOSITORY_LOCATION = "repository/static";
    
+   public AbstractVirtualAssemblyTestCase(String name)
+   {
+      super(name);
+   }
+   
    protected ArtifactRepository<ArtifactId> createArtifactRepository(String name) throws Exception
    {
       URL rootURL = getResource(name);
@@ -68,11 +73,6 @@
          deployments.put(deployment.getName(), deployment);
       return deployments;
    }
-  
-   protected URL getResource(String name)
-   {
-      return Thread.currentThread().getContextClassLoader().getResource(name);
-   }
    
 }
 

Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/StructureMetaDataUnitTestCase.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/StructureMetaDataUnitTestCase.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/StructureMetaDataUnitTestCase.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -31,7 +31,7 @@
 import org.jboss.deployers.spi.structure.ContextInfo;
 import org.jboss.deployers.spi.structure.StructureMetaData;
 import org.jboss.profileservice.deployers.VDFDeploymentBuilder;
-import org.jboss.profileservice.repository.ProfileDeploymentFactory;
+import org.jboss.profileservice.repository.virtual.VirtualDeploymentRepository;
 import org.jboss.profileservice.spi.ProfileDeployment;
 import org.jboss.profileservice.spi.virtual.VirtualDeployment;
 import org.jboss.test.profileservice.metadata.support.VirtualRepositoryMetaData;
@@ -45,9 +45,14 @@
 public class StructureMetaDataUnitTestCase extends AbstractVirtualAssemblyTestCase
 {
 
-   private  ProfileDeploymentFactory profileDeploymentFactory;
+   private VirtualDeploymentRepository profileDeploymentFactory;
    private final VDFDeploymentBuilder mcDeploymentBuilder = VDFDeploymentBuilder.getInstance();
    
+   public StructureMetaDataUnitTestCase(String name)
+   {
+      super(name);
+   }
+   
    public void test() throws Exception
    {
       // Set the jboss.deployment.resources
@@ -57,7 +62,7 @@
       VirtualRepositoryMetaData repository = unmarshal("repository.xml", VirtualRepositoryMetaData.class);
       Map<String, VirtualDeployment> deployments = mapDeployments(repository);
     
-      this.profileDeploymentFactory = new ProfileDeploymentFactory(createArtifactRepository(REPOSITORY_LOCATION));
+      this.profileDeploymentFactory = new VirtualDeploymentRepository(createArtifactRepository(REPOSITORY_LOCATION));
       for(VirtualDeployment d : repository.getDeployments())
       {
          ProfileDeployment pd = profileDeploymentFactory.createDeployment(d);

Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/VirtualDeploymentAssemblyUnitTestCase.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/VirtualDeploymentAssemblyUnitTestCase.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/VirtualDeploymentAssemblyUnitTestCase.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -23,7 +23,7 @@
 
 import java.util.Map;
 
-import org.jboss.profileservice.repository.ProfileDeploymentFactory;
+import org.jboss.profileservice.repository.virtual.VirtualDeploymentRepository;
 import org.jboss.profileservice.spi.ProfileDeployment;
 import org.jboss.profileservice.spi.virtual.VirtualDeployment;
 import org.jboss.profileservice.version.helpers.NameAndVersionRangeSupport;
@@ -41,6 +41,11 @@
  */
 public class VirtualDeploymentAssemblyUnitTestCase extends AbstractVirtualAssemblyTestCase
 {
+ 
+   public VirtualDeploymentAssemblyUnitTestCase(String name)
+   {
+      super(name);
+   }
    
    public void test() throws Exception
    {
@@ -48,11 +53,11 @@
       System.setProperty("jboss.deployment.resources", getResource(REPOSITORY_LOCATION).toExternalForm());
       
       // Get the repository meta data
-      VirtualRepositoryMetaData repository = unmarshal("repository.xml", VirtualRepositoryMetaData.class);
-      Map<String, VirtualDeployment> deployments = mapDeployments(repository);
+      VirtualRepositoryMetaData repositoryMetaData = unmarshal("repository.xml", VirtualRepositoryMetaData.class);
+      Map<String, VirtualDeployment> deployments = mapDeployments(repositoryMetaData);
 
-      // Get the ProfileDeploymentFactory
-      ProfileDeploymentFactory factory = new ProfileDeploymentFactory(createArtifactRepository(REPOSITORY_LOCATION));
+      // Get the VirtualDeploymentRepository
+      VirtualDeploymentRepository factory = new VirtualDeploymentRepository(createArtifactRepository(REPOSITORY_LOCATION));
       
       // Test simple.deployer
       AbstractVirtualDeployment simpleVD = (AbstractVirtualDeployment) deployments.get("simple.deployer");
@@ -106,6 +111,6 @@
             capability.resolves(
                   ((AbstractVirtualDeploymentRequirement) requirement)));
    }
-   
+ 
 }
 

Modified: projects/profileservice/trunk/core/src/test/resources/bootstrap/basic.profile
===================================================================
--- projects/profileservice/trunk/core/src/test/resources/bootstrap/basic.profile	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/test/resources/bootstrap/basic.profile	2009-10-19 09:58:43 UTC (rev 95099)
@@ -2,7 +2,7 @@
 <profiles xmlns="urn:jboss:profileservice:profiles:1.0" name="bootstrap">
 
 	<profile name="test-profile">
-
+		<deployment>basic.profile</deployment>
 	</profile>
 
 </profiles>
\ No newline at end of file

Modified: projects/profileservice/trunk/core/src/test/resources/metadata/test.xml
===================================================================
--- projects/profileservice/trunk/core/src/test/resources/metadata/test.xml	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/core/src/test/resources/metadata/test.xml	2009-10-19 09:58:43 UTC (rev 95099)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <profiles xmlns="urn:jboss:profileservice:profiles:1.0"
 	name="profiles">
 

Modified: projects/profileservice/trunk/domain/pom.xml
===================================================================
--- projects/profileservice/trunk/domain/pom.xml	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/domain/pom.xml	2009-10-19 09:58:43 UTC (rev 95099)
@@ -14,12 +14,6 @@
   <description>JBoss ProfileService Management Domain Model</description>
 
   <dependencies>
-		<dependency>
-			<groupId>org.jboss.microcontainer</groupId>
-			<artifactId>jboss-dependency</artifactId>
-			<version>${version.org.jboss.microcontainer}</version>
-			<scope>provided</scope>
-		</dependency>
 
 		<dependency>
 			<groupId>org.jboss.microcontainer</groupId>
@@ -33,6 +27,13 @@
 			<artifactId>jboss-profileservice-spi</artifactId>
 			<version>${project.parent.version}</version>
 		</dependency>
+		
+		<dependency>
+			<groupId>org.jboss.test</groupId>
+			<artifactId>jboss-test</artifactId>
+			<scope>test</scope>
+		</dependency>
+		
   </dependencies>
   
 </project>

Modified: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AbstractPersistenceFactory.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AbstractPersistenceFactory.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AbstractPersistenceFactory.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -181,7 +181,9 @@
       // Remove the component
       PersistedComponent previous = components.remove(persistedComponent.getOriginalName());
       if(previous == null)
-         previous = components.remove(persistedComponent.getName());
+      {
+         components.remove(persistedComponent.getName());
+      }
       // Set the new values
       root.setComponents(new ArrayList<PersistedComponent>(components.values()));
       return root;

Modified: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AbstractValuePersistence.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AbstractValuePersistence.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AbstractValuePersistence.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -25,6 +25,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.Map.Entry;
 
 import org.jboss.logging.Logger;
 import org.jboss.managed.api.ManagedObject;
@@ -403,9 +404,10 @@
          pairs = new ArrayList<PersistedPair>();
          properties.setEntries(pairs);
       }
-      for(Object key : value.keySet())
+      for(Entry<Object, Object> entry : value.entrySet())
       {
-         Object kvalue = value.get(key);
+         Object key = entry.getKey();
+         Object kvalue = entry.getValue();
          PersistedPair pair = new PersistedPair(key.toString(), kvalue.toString());
          pairs.add(pair);
       }

Modified: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AbstractValueRecreation.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AbstractValueRecreation.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AbstractValueRecreation.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -156,65 +156,58 @@
          return null;
       
       MetaValue metaValue = null;
-      try
+      if(metaType.isSimple())
       {
-         if(metaType.isSimple())
-         {
-            metaValue = createSimpleValue(
-                  (PersistedSimpleValue) valueElement,
-                  (SimpleMetaType) metaType);
-         }
-         else if(metaType.isEnum())
-         {
-            metaValue = createEnumValue(
-                  (PersistedEnumValue) valueElement,
-                  (EnumMetaType) metaType);
-         }
-         else if(metaType.isCollection())
-         {
-            metaValue = createCollectionValue(
-                  (PersistedCollectionValue) valueElement,
-                  (CollectionMetaType) metaType);
-         }
-         else if(metaType.isGeneric())
-         {
-            metaValue = createGenericValue(
-                  (PersistedGenericValue) valueElement,
-                  (GenericMetaType) metaType);
-         }
-         else if(metaType.isComposite())
-         {
-            metaValue = createCompositeValue(
-                  (PersistedCompositeValue) valueElement,
-                  (CompositeMetaType) metaType);
-         }
-         else if(metaType.isTable())
-         {
-            metaValue = createTableValue(
-                  (PersistedTableValue) valueElement,
-                  (TableMetaType)metaType);
-         }
-         else if(metaType.isArray())
-         {
-            metaValue = createArrayValue(
-                  (PersistedArrayValue) valueElement,
-                  (ArrayMetaType) metaType);
-         }
-         else if(metaType.isProperties())
-         {
-            metaValue = createPropertiesValue(
-                  (PersistedPropertiesValue) valueElement,
-                  (PropertiesMetaType) metaType);
-         }
-         else
-         {
-            throw new IllegalStateException("unknown metaType");
-         }
+         metaValue = createSimpleValue(
+               (PersistedSimpleValue) valueElement,
+               (SimpleMetaType) metaType);
       }
-      finally
+      else if(metaType.isEnum())
       {
-         //
+         metaValue = createEnumValue(
+               (PersistedEnumValue) valueElement,
+               (EnumMetaType) metaType);
       }
+      else if(metaType.isCollection())
+      {
+         metaValue = createCollectionValue(
+               (PersistedCollectionValue) valueElement,
+               (CollectionMetaType) metaType);
+      }
+      else if(metaType.isGeneric())
+      {
+         metaValue = createGenericValue(
+               (PersistedGenericValue) valueElement,
+               (GenericMetaType) metaType);
+      }
+      else if(metaType.isComposite())
+      {
+         metaValue = createCompositeValue(
+               (PersistedCompositeValue) valueElement,
+               (CompositeMetaType) metaType);
+      }
+      else if(metaType.isTable())
+      {
+         metaValue = createTableValue(
+               (PersistedTableValue) valueElement,
+               (TableMetaType)metaType);
+      }
+      else if(metaType.isArray())
+      {
+         metaValue = createArrayValue(
+               (PersistedArrayValue) valueElement,
+               (ArrayMetaType) metaType);
+      }
+      else if(metaType.isProperties())
+      {
+         metaValue = createPropertiesValue(
+               (PersistedPropertiesValue) valueElement,
+               (PropertiesMetaType) metaType);
+      }
+      else
+      {
+         throw new IllegalStateException("unknown metaType");
+      }
       return metaValue;
    }
    

Modified: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AttachmentPropertyPopulator.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AttachmentPropertyPopulator.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/AttachmentPropertyPopulator.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -101,9 +101,13 @@
       synchronized(instanceFactoryMap)
       {
          if (factory == null)
+         {
             instanceFactoryMap.remove(clazz);
+         }
          else
+         {
             instanceFactoryMap.put(clazz, factory);
+         }
       }
    }
    
@@ -123,6 +127,11 @@
       setInstanceFactory(SortedSet.class, SortedSetInstanceFactory.INSTANCE);
    }
    
+   ManagedObjectRecreationHelper getHelper()
+   {
+      return helper;
+   }
+   
    /**
     * Process a ManagedProperty.
     * 

Modified: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/ManagedObjectRecreationHelper.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/ManagedObjectRecreationHelper.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/ManagedObjectRecreationHelper.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -109,6 +109,8 @@
    
    private static final class SecurityActions
    {
+      private SecurityActions() {}
+      
       public static ClassLoader getContextClassLoader()
       {
          if (System.getSecurityManager() == null)

Modified: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/PersistenceConstants.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/PersistenceConstants.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/PersistenceConstants.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -42,4 +42,9 @@
    /** The managed-component name. */
    public static final String MANAGED_COMPONENT_ELEMENT_NAME = "managed-component";
    
+   protected PersistenceConstants()
+   {
+      //
+   }
+   
 }

Modified: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/xml/PersistedPropertiesValue.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/xml/PersistedPropertiesValue.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/xml/PersistedPropertiesValue.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -35,7 +35,7 @@
 {
 
    /** The entries. */
-   List<PersistedPair> entries;
+   private List<PersistedPair> entries;
 
    @XmlElement(name = "entry")
    public List<PersistedPair> getEntries()

Modified: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/xml/PersistedTableValue.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/xml/PersistedTableValue.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/xml/PersistedTableValue.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -35,7 +35,7 @@
 {
 
    /** The entries. */
-   List<PersistedCompositeValue> entries;
+   private List<PersistedCompositeValue> entries;
 
    @XmlElement(name = "entry")
    public List<PersistedCompositeValue> getEntries()


Property changes on: projects/profileservice/trunk/plugins
___________________________________________________________________
Name: svn:ignore
   + .classpath
.project
.settings
target


Added: projects/profileservice/trunk/plugins/pom.xml
===================================================================
--- projects/profileservice/trunk/plugins/pom.xml	                        (rev 0)
+++ projects/profileservice/trunk/plugins/pom.xml	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,57 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.jboss.profileservice</groupId>
+    <artifactId>jboss-profileservice-parent</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.profileservice</groupId>
+  <artifactId>jboss-profileservice-plugins</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <name>JBoss ProfileService Plugins</name>
+  <url>http://www.jboss.org/jbossas</url>
+  <description>JBoss ProfileService Deployment and Management plugins</description>
+
+  <dependencies>
+  
+ 	<dependency>
+		<groupId>junit</groupId>
+		<artifactId>junit</artifactId>
+		<scope>test</scope>
+	</dependency>
+  
+ 	<dependency>
+		<groupId>org.jboss.logging</groupId>
+		<artifactId>jboss-logging-log4j</artifactId>
+		<scope>provided</scope>
+	</dependency>
+  
+	<dependency>
+		<groupId>org.jboss.man</groupId>
+		<artifactId>jboss-managed</artifactId>
+		<scope>provided</scope>
+	</dependency>
+  
+ 	<dependency>
+		<groupId>org.jboss.profileservice</groupId>
+		<artifactId>jboss-profileservice-spi</artifactId>
+		<version>${project.parent.version}</version>
+	</dependency>
+
+ 	<dependency>
+		<groupId>org.jboss.profileservice</groupId>
+		<artifactId>jboss-profileservice-core</artifactId>
+		<version>${project.parent.version}</version>
+	</dependency>
+  
+	<dependency>
+		<groupId>org.jboss</groupId>
+		<artifactId>jboss-vfs</artifactId>
+		<version>${version.org.jboss.vfs}</version>
+		<scope>provided</scope>
+	</dependency>
+	
+  </dependencies>
+  
+</project>

Added: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/AbstractDeployHandler.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/AbstractDeployHandler.java	                        (rev 0)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/AbstractDeployHandler.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,98 @@
+/*
+* 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.plugins.deploy;
+
+import org.jboss.deployers.spi.management.deploy.DeploymentID;
+import org.jboss.profileservice.ProfileDeployerPlugin;
+import org.jboss.profileservice.dependency.LocalProfileServiceDomain;
+import org.jboss.profileservice.dependency.ProfileDependencyContext;
+import org.jboss.profileservice.spi.NoSuchDeploymentException;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileDeployment;
+import org.jboss.profileservice.spi.ProfileService;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class AbstractDeployHandler
+{
+
+   /** The local profile service domain. */
+   private LocalProfileServiceDomain domain;
+   
+   /** The ProfileService. */
+   private ProfileService ps;
+
+   protected void distribute(DeploymentID id)
+   {
+      
+   }
+   
+   protected void startDeployment(String deploymentName) throws Exception
+   {
+      ProfileDependencyContext ctx = domain().getDeploymentProfile(deploymentName);
+      if(ctx == null)
+      {
+         throw new NoSuchDeploymentException(deploymentName);
+      }
+      ProfileDeployerPlugin deployer = ctx.getDeployer();
+      // Make sure the profile is active
+      Profile profile = ps.getActiveProfile(ctx.getKey());
+      
+      ProfileDeployment deployment = profile.getDeployment(deploymentName);
+      //
+      deployer.addDeployment(deployment);
+    
+      // TODO unlock deployment content
+   }
+   
+   protected void stopDeployment(String deploymentName) throws Exception
+   {
+      ProfileDependencyContext ctx = domain().getDeploymentProfile(deploymentName);
+      if(ctx == null)
+      {
+         throw new NoSuchDeploymentException(deploymentName);
+      }
+      ProfileDeployerPlugin deployer = ctx.getDeployer();
+      
+      Profile profile = ps.getActiveProfile(ctx.getKey());
+      
+      ProfileDeployment deployment = profile.getDeployment(deploymentName);
+      
+      // TODO lock deployment content
+    
+      deployer.removeDeployment(deployment);
+   }
+   
+   protected void removeDeployment(String deploymentName) throws Exception
+   {
+      
+   }
+   
+   LocalProfileServiceDomain domain()
+   {
+      return this.domain;
+   }
+   
+}
+

Added: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/DeploymentManagerImpl.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/DeploymentManagerImpl.java	                        (rev 0)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/DeploymentManagerImpl.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,32 @@
+/*
+* 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.plugins.deploy;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class DeploymentManagerImpl
+{
+
+}
+

Added: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AggregatingLocalManagementView.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AggregatingLocalManagementView.java	                        (rev 0)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AggregatingLocalManagementView.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,89 @@
+/*
+* 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.plugins.management;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.jboss.profileservice.plugins.management.view.AbstractProfileView;
+import org.jboss.profileservice.plugins.management.view.ProfileViewWrapper;
+import org.jboss.profileservice.spi.ProfileKey;
+
+/**
+ * The aggregating management view.
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class AggregatingLocalManagementView
+{
+
+   /** The profile views. */
+   private List<ProfileViewWrapper> views = new CopyOnWriteArrayList<ProfileViewWrapper>();
+   
+   /** The views by key. */
+   private Map<ProfileKey, ProfileViewWrapper> viewsByKey = new ConcurrentHashMap<ProfileKey, ProfileViewWrapper>();
+
+   public void load()
+   {
+      for(ProfileViewWrapper view : views)
+      {
+         view.load();
+      }
+   }
+   
+   public void addProfileView(AbstractProfileView view)
+   {
+      if(view == null)
+      {
+         throw new IllegalArgumentException("null profile view");
+      }
+      if(view.getKey() == null)
+      {
+         throw new IllegalArgumentException("null profile key");
+      }
+      ProfileViewWrapper wrapper =  new ProfileViewWrapper(view);
+      this.views.add(wrapper);
+      this.viewsByKey.put(wrapper.getKey(), wrapper);
+   }
+   
+   public void removeProfileView(AbstractProfileView view)
+   {
+      if(view == null)
+      {
+         throw new IllegalArgumentException("null profile view");
+      }
+      if(view.getKey() == null)
+      {
+         throw new IllegalArgumentException("null profile key");
+      }
+      ProfileViewWrapper wrapper = this.viewsByKey.get(view.getKey());
+      if(wrapper != null)
+      {
+         this.views.remove(wrapper);
+      }
+   }
+   
+}
+

Added: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/AbstractProfileView.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/AbstractProfileView.java	                        (rev 0)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/AbstractProfileView.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,84 @@
+/*
+* 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.plugins.management.view;
+
+import java.util.Collection;
+
+import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.profileservice.ProfileDeployerPlugin;
+import org.jboss.profileservice.plugins.spi.ProfileView;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileDeployment;
+import org.jboss.profileservice.spi.ProfileKey;
+
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class AbstractProfileView implements ProfileView
+{
+   
+   /** The profile. */
+   private final Profile profile;
+   private final ProfileDeployerPlugin deployer;
+
+   public AbstractProfileView(Profile profile, ProfileDeployerPlugin deployer)
+   {
+      if(profile == null)
+      {
+         throw new IllegalArgumentException("null profile");
+      }
+      this.profile = profile;
+      this.deployer = deployer;
+   }
+   
+   public ProfileKey getKey()
+   {
+      return this.profile.getKey();
+   }
+   
+   @Override
+   public Collection<String> getDeploymentNames()
+   {
+      // FIXME getDeploymentNames
+      return null;
+   }
+   
+   @Override
+   public ManagedDeployment getManagedDeployment(String name)
+   {
+      // FIXME getManagedDeployment
+      return null;
+   }
+
+   protected void load() throws Exception
+   {
+      for(ProfileDeployment deployment : profile.getDeployments())
+      {
+         ManagedDeployment md = deployer.getManagedDeployment(deployment);
+         
+      }
+   }
+   
+}
+

Added: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/ProfileViewWrapper.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/ProfileViewWrapper.java	                        (rev 0)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/ProfileViewWrapper.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,72 @@
+/*
+* 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.plugins.management.view;
+
+import java.util.Collection;
+
+import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.profileservice.plugins.spi.ProfileView;
+import org.jboss.profileservice.spi.ProfileKey;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ProfileViewWrapper implements ProfileView
+{
+
+   /** The wrapped view. */
+   private ProfileView view;
+   
+   public ProfileViewWrapper(ProfileView view)
+   {
+      if(view == null)
+      {
+         throw new IllegalArgumentException("null profile view");
+      }
+      this.view = view;
+   }
+   
+   public ProfileKey getKey()
+   {
+      return this.view.getKey();
+   }
+   
+   public void load()
+   {
+
+   }
+
+   @Override
+   public Collection<String> getDeploymentNames()
+   {
+      return view.getDeploymentNames();
+   }
+
+   @Override
+   public ManagedDeployment getManagedDeployment(String name)
+   {
+      return view.getManagedDeployment(name);
+   }
+   
+}
+

Added: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/RuntimeManagedObjectRegistry.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/RuntimeManagedObjectRegistry.java	                        (rev 0)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/RuntimeManagedObjectRegistry.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,92 @@
+/*
+* 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.plugins.management.view;
+
+import java.util.Map;
+
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.util.collection.ConcurrentReferenceHashMap;
+import org.jboss.util.collection.ConcurrentReferenceHashMap.ReferenceType;
+
+/**
+ * Registry for runtime ManagedObjects.
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+class RuntimeManagedObjectRegistry
+{
+ 
+   /** The runtime managed objects. */
+   private Map<String, ManagedObject> runtimeMOs = new ConcurrentReferenceHashMap<String, ManagedObject>(ReferenceType.STRONG, ReferenceType.WEAK);
+   
+   /**
+    * Get a registered runtime ManagedObject.
+    * 
+    * @param name the runtime managed object name
+    * @return the runtime managed object, null if not available
+    */
+   public ManagedObject get(String name)
+   {
+      if(name == null)
+      {
+         throw new IllegalArgumentException("null runtime MO name");
+      }
+      return this.runtimeMOs.get(name);
+   }
+   
+   /**
+    * Add a runtime ManagedObject.
+    * 
+    * @param name the runtime managed object name
+    * @param mo the runtime managed object
+    */
+   public void put(String name, ManagedObject mo)
+   {
+      if(name == null)
+      {
+         throw new IllegalArgumentException("null runtime MO name");
+      }
+      if(mo == null)
+      {
+         throw new IllegalArgumentException("null runtime MO");
+      }
+      this.runtimeMOs.put(name, mo);
+   }
+   
+   /**
+    * Remove a runtime ManagedObject from the registry.
+    * 
+    * @param name the runtime managed object name
+    * @return the removed object or null if not registered
+    */
+   public ManagedObject remove(String name)
+   {
+      if(name == null)
+      {
+         throw new IllegalArgumentException("null name");
+      }
+      return this.runtimeMOs.remove(name);
+   }
+   
+}
+

Added: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/spi/ProfileView.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/spi/ProfileView.java	                        (rev 0)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/spi/ProfileView.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,62 @@
+/*
+* 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.plugins.spi;
+
+import java.util.Collection;
+
+import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.profileservice.spi.ProfileKey;
+
+/**
+ * A management view of a single profile and extension point for integrating
+ * different views.
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ProfileView
+{
+
+   /**
+    * Get the profile key.
+    * 
+    * @return the profile key
+    */
+   ProfileKey getKey();
+   
+   /**
+    * Get the deployment names.
+    * 
+    * @return the deployment names
+    */
+   Collection<String> getDeploymentNames();
+   
+   /**
+    * Get the managed deployment.
+    * 
+    * @param name the deployment name
+    * @return the managed deployment, null if there is no such deployment
+    */
+   ManagedDeployment getManagedDeployment(String name);
+   
+}
+

Modified: projects/profileservice/trunk/pom.xml
===================================================================
--- projects/profileservice/trunk/pom.xml	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/pom.xml	2009-10-19 09:58:43 UTC (rev 95099)
@@ -21,6 +21,10 @@
 			<url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html</url>
 	    </license>
   	</licenses>
+	<organization>
+    	<name>JBoss, A division of Red Hat, Inc</name>
+    	<url>http://www.jboss.org</url>
+  	</organization>
 	<!-- SCM -->
 	<scm>
 		<connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/profileservice/trunk/</connection>
@@ -38,14 +42,15 @@
 	    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 	    
 		<version.junit>3.8.2</version.junit>
-		<version.org.jboss.common.core>2.2.14.GA</version.org.jboss.common.core>
-		<version.org.jboss.deployers>2.0.8.GA</version.org.jboss.deployers>
+		<version.org.jboss.common.core>2.2.16.GA</version.org.jboss.common.core>
+		<version.org.jboss.deployers>2.0.8.SP1</version.org.jboss.deployers>
 		<version.org.jboss.jbossxb>2.0.1.GA</version.org.jboss.jbossxb>
-		<version.org.jboss.logging>2.0.5.GA</version.org.jboss.logging>
+		<version.org.jboss.logging>2.2.0.CR1</version.org.jboss.logging>
 		<version.org.jboss.man>2.1.1.GA</version.org.jboss.man>
-		<version.org.jboss.microcontainer>2.0.8.GA</version.org.jboss.microcontainer>
+		<version.org.jboss.microcontainer>2.0.9.GA</version.org.jboss.microcontainer>
 		<version.org.jboss.reflect>2.0.2.GA</version.org.jboss.reflect>
-		<version.org.jboss.vfs>2.1.3.GA</version.org.jboss.vfs>
+		<version.jboss.test>1.1.0.GA</version.jboss.test>
+		<version.org.jboss.vfs>2.1.3.SP1</version.org.jboss.vfs>
 		<version.sun.jaxb>2.1.9-brew</version.sun.jaxb>
 	</properties>
 
@@ -54,6 +59,7 @@
 		<module>persistence</module>
 		<module>domain</module>
 		<module>core</module>
+		<module>plugins</module>
 		<module>sandbox</module>
 		<module>build</module>
 	</modules>
@@ -143,28 +149,27 @@
 				<groupId>junit</groupId>
 				<artifactId>junit</artifactId>
 				<version>${version.junit}</version>
+				<scope>test</scope>
 			</dependency>
 
 			<dependency>
 				<groupId>org.jboss</groupId>
 				<artifactId>jboss-common-core</artifactId>
 				<version>${version.org.jboss.common.core}</version>
+				<scope>provided</scope>
 			</dependency>
 
 			<dependency>
 				<groupId>org.jboss.logging</groupId>
 				<artifactId>jboss-logging-spi</artifactId>
-				<version>2.1.0.GA</version>
+				<version>${version.org.jboss.logging}</version>
+				<scope>provided</scope>
 			</dependency>
 			<dependency>
 				<groupId>org.jboss.logging</groupId>
-				<artifactId>jboss-logging-jdk</artifactId>
-				<version>2.1.0.GA</version>
-			</dependency>
-			<dependency>
-				<groupId>org.jboss.logging</groupId>
 				<artifactId>jboss-logging-log4j</artifactId>
-				<version>2.1.0.GA</version>
+				<version>${version.org.jboss.logging}</version>
+				<scope>provided</scope>
 				<exclusions>
 					<exclusion>
 						<groupId>apache-log4j</groupId>
@@ -188,6 +193,7 @@
 				<groupId>org.jboss</groupId>
 				<artifactId>jbossxb</artifactId>
 				<version>${version.org.jboss.jbossxb}</version>
+				<scope>provided</scope>
 				<exclusions>
 					<exclusion>
 						<groupId>jboss</groupId>
@@ -204,12 +210,21 @@
 				<groupId>org.jboss.microcontainer</groupId>
 				<artifactId>jboss-dependency</artifactId>
 				<version>${version.org.jboss.microcontainer}</version>
+				<scope>provided</scope>
 			</dependency>
 			<dependency>
 				<groupId>org.jboss.microcontainer</groupId>
 				<artifactId>jboss-kernel</artifactId>
 				<version>${version.org.jboss.microcontainer}</version>
+				<scope>provided</scope>
 			</dependency>
+			
+			<dependency>
+				<groupId>org.jboss.test</groupId>
+				<artifactId>jboss-test</artifactId>
+				<version>${version.jboss.test}</version>
+				<scope>test</scope>
+		    </dependency>
 
 			<dependency>
 				<groupId>org.jboss</groupId>

Modified: projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/NameMatcher.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/NameMatcher.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/NameMatcher.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -38,5 +38,5 @@
     * @param name - the name input from the client
     * @return
     */
-   public boolean matches(T comp, String name);
+   boolean matches(T comp, String name);
 }

Modified: projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/deploy/DeploymentManager.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/deploy/DeploymentManager.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/deploy/DeploymentManager.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -38,22 +38,6 @@
 {
    
    /**
-    * Load and associate the given profile with the DeploymentManager
-    * for future operations.
-    * 
-    * @param key - the profile to load
-    * @throws Exception for any error
-    */
-   public void loadProfile(ProfileKey key) throws Exception;
-
-   /**
-    * Release the previous loaded profile.
-    * 
-    * @throws Exception
-    */
-   public void releaseProfile() throws Exception;
-   
-   /**
     * Get a collection of profiles supporting deployment actions.
     * 
     * @return a collection of profiles keys

Modified: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/ProfileKey.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/ProfileKey.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/ProfileKey.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -177,8 +177,7 @@
    
    public int hashCode()
    {
-      int hash = domain.hashCode() + server.hashCode() + name.hashCode();
-      return hash;
+      return domain.hashCode() + server.hashCode() + name.hashCode();
    }
 
    public String toString()

Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ActionStatus.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ActionStatus.java	                        (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ActionStatus.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,45 @@
+/*
+* 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.spi.action;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public enum ActionStatus
+{
+
+   ACTIVE, 
+   ROLLBACK,
+   
+   PREPARED,
+   COMMITTED,
+   ROLLEDBACK,
+
+   PREPARING,
+   COMMITTING,
+   ROLLING_BACK,
+
+   UNKNOWN
+   
+}
+

Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationAction.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationAction.java	                        (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationAction.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,63 @@
+/*
+* 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.spi.action;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ProfileModificationAction<T extends ProfileModificationContext>
+{
+
+   /**
+    * Get the modification context.
+    * 
+    * @return the context.
+    */
+   T getContext();
+   
+   /**
+    * Cancel the action.
+    */
+   void cancel();
+   
+   /**
+    * Execute the action and if successful mark it as complete.
+    */
+   void complete();
+   
+   /**
+    * Gets whether {@link #complete()} has been invoked.
+    * 
+    * @return <code>true</code> if {@link #complete()} has been invoked
+    */
+   boolean isComplete();
+   
+   /**
+    * Gets whether {@link #complete()} has been invoked.
+    * 
+    * @return <code>true</code> if {@link #complete()} has been invoked
+    */
+   boolean isCancelled();
+   
+}
+

Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationContext.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationContext.java	                        (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationContext.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,41 @@
+/*
+* 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.spi.action;
+
+import org.jboss.profileservice.spi.ProfileKey;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ProfileModificationContext
+{
+
+   /**
+    * The target profile.
+    * 
+    * @return the target profile key
+    */
+   ProfileKey getTargetProfile();
+
+}
+

Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/TwoPhaseCommitProfileAction.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/TwoPhaseCommitProfileAction.java	                        (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/TwoPhaseCommitProfileAction.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,54 @@
+/*
+* 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.spi.action;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface TwoPhaseCommitProfileAction<T extends ProfileModificationContext> extends ProfileModificationAction<T>
+{
+
+   /**
+    * Get the current status.
+    * 
+    * @return the status
+    */
+   ActionStatus getStatus();
+   
+   /**
+    * Prepare this action.
+    */
+   void prepare();
+   
+   /**
+    * Attempt to commit this action.
+    */
+   void commit();
+   
+   /**
+    * Rolls back this action.
+    */
+   void rollback();
+   
+}
+

Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/deployment/DeploymentAction.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/deployment/DeploymentAction.java	                        (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/deployment/DeploymentAction.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,34 @@
+/*
+* 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.spi.action.deployment;
+
+import org.jboss.profileservice.spi.action.TwoPhaseCommitProfileAction;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface DeploymentAction<T extends DeploymentActionContext> extends TwoPhaseCommitProfileAction<T>
+{
+
+}
+

Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/deployment/DeploymentActionContext.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/deployment/DeploymentActionContext.java	                        (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/deployment/DeploymentActionContext.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,34 @@
+/*
+* 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.spi.action.deployment;
+
+import org.jboss.profileservice.spi.action.ProfileModificationContext;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface DeploymentActionContext extends ProfileModificationContext
+{
+
+}
+

Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/Engine.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/Engine.java	                        (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/Engine.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,46 @@
+/*
+* 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.spi.action.engine;
+
+import java.util.List;
+
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.action.ProfileModificationAction;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface Engine
+{
+
+   /**
+    * Perform a set of modification actions.
+    * 
+    * @param key the target profile key
+    * @param actions the modification actions
+    * @return the modification status
+    */
+   ModificationStatus perfom(ProfileKey key, List<ProfileModificationAction<?>> actions); 
+   
+}
+

Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/EventBus.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/EventBus.java	                        (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/EventBus.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,37 @@
+/*
+* 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.spi.action.engine;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface EventBus
+{
+
+   void addListener(ModificationListener listener);
+   void removeListener(ModificationListener listener);
+   
+   void fireModificationEvent(ModificationEvent event);
+   
+}
+

Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ModificationEvent.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ModificationEvent.java	                        (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ModificationEvent.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,32 @@
+/*
+* 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.spi.action.engine;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ModificationEvent
+{
+   
+}
+

Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ModificationListener.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ModificationListener.java	                        (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ModificationListener.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,32 @@
+/*
+* 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.spi.action.engine;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ModificationListener
+{
+   void notify(ModificationEvent event);
+}
+

Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ModificationStatus.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ModificationStatus.java	                        (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ModificationStatus.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,68 @@
+/*
+* 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.spi.action.engine;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ModificationStatus
+{
+
+   /**
+    * Get the children.
+    * 
+    * @return the children
+    */
+   Collection<ModificationStatus> getChildren();
+
+   /**
+    * Get the failure exception.
+    * @return any failure exception associated with reaching the FAILED state.
+    */
+   Exception getFailure();
+
+   /**
+    * Is the deployment complete
+    *
+    * @return true when complete, false otherwise
+    */
+   boolean isCompleted();
+
+   /**
+    * Has the deployment failed
+    *
+    * @return true when failed, false otherwise
+    */
+   boolean isFailed();
+   
+   /**
+    * Is the deployment in progress
+    *
+    * @return true when in progress, false otherwise
+    */
+   boolean isRunning();
+   
+}
+

Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/management/ManagementAction.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/management/ManagementAction.java	                        (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/management/ManagementAction.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,34 @@
+/*
+* 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.spi.action.management;
+
+import org.jboss.profileservice.spi.action.TwoPhaseCommitProfileAction;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ManagementAction<T extends ManagementActionContext> extends TwoPhaseCommitProfileAction<T>
+{
+
+}
+

Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/management/ManagementActionContext.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/management/ManagementActionContext.java	                        (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/management/ManagementActionContext.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -0,0 +1,34 @@
+/*
+* 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.spi.action.management;
+
+import org.jboss.profileservice.spi.action.ProfileModificationContext;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ManagementActionContext extends ProfileModificationContext
+{
+
+}
+

Modified: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/repository/MutableArtifactRepository.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/repository/MutableArtifactRepository.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/repository/MutableArtifactRepository.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -37,14 +37,14 @@
     * 
     * @param artifact the artifact to add
     */
-   public void addArtifact(Artifact<T> artifact) throws IOException;
+   void addArtifact(Artifact<T> artifact) throws IOException;
    
    /**
     * Remove a artifact from the repository.
     * 
     * @param artifactId the artifact id
     */
-   public void removeArtifact(T artifactId) throws IOException;
+   void removeArtifact(T artifactId) throws IOException;
    
 }
 

Modified: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/virtual/VirtualArtifactMetaData.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/virtual/VirtualArtifactMetaData.java	2009-10-19 09:08:57 UTC (rev 95098)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/virtual/VirtualArtifactMetaData.java	2009-10-19 09:58:43 UTC (rev 95099)
@@ -50,10 +50,10 @@
 
    /**
     * Is this a meta data location.
-    * TODO this should not be here
     * 
     * @return true if this is a meta data location, false otherwise
     */
    boolean isMetaDataPath();
+   
 }
 




More information about the jboss-cvs-commits mailing list