[jboss-cvs] JBossAS SVN: r84597 - in trunk: profileservice/src/main/org/jboss/profileservice/management/upload and 6 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Feb 22 07:00:34 EST 2009


Author: emuckenhuber
Date: 2009-02-22 07:00:34 -0500 (Sun, 22 Feb 2009)
New Revision: 84597

Modified:
   trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/AbstractDeployHandler.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java
   trunk/profileservice/src/resources/profileservice-jboss-beans.xml
   trunk/server/src/etc/conf/default/bootstrap/profile.xml
   trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractProfile.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractDeploymentRepository.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractProfileService.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/DefaultDeploymentRepositoryFactory.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/FilteredDeploymentRepositoryFactory.java
   trunk/system/src/tests/org/jboss/test/server/profileservice/test/BootstrapProfileFactoryUnitTestCase.java
   trunk/system/src/tests/org/jboss/test/server/profileservice/test/ProfileServiceUnitTestCase.java
Log:
[JBAS-6526] remove DeploymentPhase

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java	2009-02-22 11:57:44 UTC (rev 84596)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java	2009-02-22 12:00:34 UTC (rev 84597)
@@ -63,7 +63,6 @@
 import org.jboss.managed.api.MutableManagedComponent;
 import org.jboss.managed.api.MutableManagedObject;
 import org.jboss.managed.api.RunState;
-import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
 import org.jboss.managed.api.annotation.ManagementComponent;
 import org.jboss.managed.api.annotation.ManagementObject;
 import org.jboss.managed.api.annotation.ManagementObjectID;
@@ -81,6 +80,7 @@
 import org.jboss.metatype.api.values.MetaValue;
 import org.jboss.metatype.api.values.MetaValueFactory;
 import org.jboss.metatype.api.values.SimpleValue;
+import org.jboss.profileservice.spi.AttachmentStore;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
 import org.jboss.profileservice.spi.NoSuchProfileException;
 import org.jboss.profileservice.spi.Profile;
@@ -121,6 +121,8 @@
    
    /** The MainDeployer used to process profile changes */
    private MainDeployer mainDeployer;
+   /** The attachment store. */
+   private AttachmentStore store;
 
    private InvokerLocator locator;
 
@@ -217,13 +219,20 @@
          String msg = formatter.format(args);
          throw new NoSuchProfileException(msg);         
       }
-      
-      // Load the profiles
-      load();
    }
    
    public void load()
    {
+      // TODO there should be no need for an active profile
+      try
+      {
+         loadProfile(new ProfileKey(ProfileKey.DEFAULT));
+      }
+      catch(Exception e)
+      {
+         log.warn("failed to load default profile", e);
+      }
+      
       // If the profile is not modified do nothing
       if(isReload() == false)
       {
@@ -272,15 +281,9 @@
       this.runtimeMOs.clear();
       this.unresolvedRefs.clear();
       this.lastModified.clear();
+      this.deploymentsToProfile.clear();
    }
    
-   @Deprecated
-   public void reloadProfile() throws Exception
-   {
-      forceReload = true;
-      loadProfile(this.activeProfile.getKey());
-   }
-   
    protected void loadProfiles(boolean trace)
    {
       log.debug("reloading profiles: "+ this.ps.getActiveProfileKeys());
@@ -288,8 +291,12 @@
       {
          try
          {
+            // Get the active profile
             Profile profile = this.ps.getActiveProfile(key);
+            // Get the deployments
             Collection<ProfileDeployment> deployments = profile.getDeployments();
+            // Add the lastModified cache
+            this.lastModified.put(key, profile.getLastModified());
             // Process the deployments
             for(ProfileDeployment deployment : deployments)
             {
@@ -303,7 +310,6 @@
                   log.debug("Failed to create ManagedDeployment for: " + deployment.getName(), e);
                }
             }
-            this.lastModified.put(key, profile.getLastModified());
          }
          catch(Exception e)
          {
@@ -322,6 +328,9 @@
 
       for(ProfileKey key : this.ps.getActiveProfileKeys())
       {
+         if(this.lastModified.containsKey(key) == false)
+            return true;
+         
          try
          {
             Profile profile = this.ps.getActiveProfile(key);
@@ -664,6 +673,16 @@
       this.locator = locator;
    }
 
+   public AttachmentStore getAttachmentStore()
+   {
+      return store;
+   }
+   
+   public void setAttachmentStore(AttachmentStore store)
+   {
+      this.store = store;
+   }
+   
    public MainDeployer getMainDeployer()
    {
       return mainDeployer;
@@ -788,7 +807,7 @@
     * @param name the deployment name
     * @throws NoSuchDeploymentException if no matching deployment was found
     */
-   public ManagedDeployment getDeployment(String name, DeploymentPhase phase) throws NoSuchDeploymentException
+   public ManagedDeployment getDeployment(String name) throws NoSuchDeploymentException
    {
       if(name == null)
          throw new IllegalArgumentException("Null deployment name");
@@ -927,7 +946,7 @@
       return info;
    }
 
-   public void applyTemplate(DeploymentPhase phase, String deploymentBaseName, DeploymentTemplateInfo info)
+   public void applyTemplate(String deploymentBaseName, DeploymentTemplateInfo info)
       throws Exception
    {
       DeploymentTemplate template = templates.get(info.getName());
@@ -941,8 +960,9 @@
 
       // Create a deployment base from the template
       if( log.isTraceEnabled() )
-         log.trace("applyTemplate, profile="+activeProfile+", deploymentBaseName="+deploymentBaseName+", phase="+phase+", info="+info);
+         log.trace("applyTemplate, profile="+activeProfile+", deploymentBaseName="+deploymentBaseName +", info="+info);
       
+      
       // FIXME this should not be done in this way!
       VirtualFile vf = template.applyTemplate(templateRoot, deploymentBaseName, info);
       VFSDeployment ctx = deploymentFactory.createVFSDeployment(vf);
@@ -996,7 +1016,7 @@
 
       // Now apply the managed properties to get the deployment ManagedObjects
       Map<String, ManagedObject> mos = mainDeployer.getManagedObjects(ctx.getName());
-      log.debug("applyTemplate, profile="+activeProfile+", deploymentBaseName="+deploymentBaseName+", phase="+phase+", :"+mos);
+      log.debug("applyTemplate, profile="+activeProfile+", deploymentBaseName="+deploymentBaseName+", :"+mos);
       // Map the 
       String propName = info.getRootManagedPropertyName();
       if(propName != null)
@@ -1058,51 +1078,6 @@
       }
    }
 
-   public void removeDeployment(String deploymentName, DeploymentPhase phase)
-      throws NoSuchProfileException, NoSuchDeploymentException, Exception
-   {
-      log.debug("removeDeployment, "+deploymentName+", phase: "+phase);
-      ProfileDeployment ctx = getProfileDeployment(deploymentName);
-      if( ctx == null )
-      {
-         formatter.applyPattern(i18n.getString("ManagementView.NoSuchDeploymentException")); //$NON-NLS-1$
-         Object[] args = {deploymentName};
-         String msg = formatter.format(args);
-         throw new NoSuchDeploymentException(msg);
-      }
-
-      if( mainDeployer.removeDeployment(ctx.getName()) == false )
-      {
-         formatter.applyPattern(i18n.getString("ManagementView.MainDeployerRemoveException")); //$NON-NLS-1$
-         Object[] args = {deploymentName};
-         String msg = formatter.format(args);
-         throw new NoSuchDeploymentException(msg);
-         
-      }
-      // Remove the ManagedDeployment/ManagedComponents
-      ManagedDeployment md = managedDeployments.remove(deploymentName);
-      if(md != null)
-      {
-         log.debug("removeDeployment, md: "+md);
-         Map<String, ManagedComponent> comps = md.getComponents();
-         if(comps != null)
-         {
-            for(ManagedComponent mc : comps.values())
-            {
-               ComponentType type = mc.getType();
-               Set<ManagedComponent> compsForType = compByCompType.get(type);
-               if(compsForType != null)
-               {
-                  if(compsForType.remove(mc) == true)
-                     log.debug("Removed mc: "+mc);
-                  else
-                     log.debug(mc+" was not found in set: "+compsForType);
-               }
-            }
-         }
-      }
-   }
-
    /**
     * Process the changes made to the profile.
     * 
@@ -1209,10 +1184,8 @@
             dispatcher.set(componentName, ctxProp.getName(), metaValue);
       }
       
-      
-      // Update the repository deployment attachments
-      Profile deploymentProfile = getProfileForDeployment(compDeployment.getName());
-      deploymentProfile.updateDeployment(compDeployment, serverComp);
+      // Persist the changed values
+      this.store.updateDeployment(compDeployment, serverComp);
    }
 
    /**

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java	2009-02-22 11:57:44 UTC (rev 84596)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java	2009-02-22 12:00:34 UTC (rev 84597)
@@ -33,7 +33,6 @@
 import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
 import org.jboss.deployers.spi.management.deploy.DeploymentStatus.CommandType;
 import org.jboss.logging.Logger;
-import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
 import org.jboss.profileservice.management.upload.remoting.DeployHandler;
 import org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget;
 import org.jboss.profileservice.spi.DeploymentRepository;
@@ -143,14 +142,13 @@
       super.stop();
    }
 
-   public DeploymentProgress distribute(String name, DeploymentPhase phase, URL contentURL)
+   public DeploymentProgress distribute(String name, URL contentURL)
       throws Exception
    {
-      return distribute(name, phase, contentURL, true);
+      return distribute(name, contentURL, true);
    }
 
-   public DeploymentProgress distribute(String name, DeploymentPhase phase, URL contentURL, boolean copyContent)
-      throws Exception
+   public DeploymentProgress distribute(String name, URL contentURL, boolean copyContent)
    {
       if(name == null)
          throw new IllegalArgumentException("Null name.");
@@ -162,20 +160,20 @@
          formatter.applyPattern(i18n.getString("DeploymentManager.NoProfileLoadedException")); //$NON-NLS-1$
          Object[] args = {};
          String msg = formatter.format(args);
-         throw new NoSuchProfileException(msg);
+         throw new IllegalStateException(msg);
       }
 
       List<DeploymentTarget> targets = getDeploymentTargets();
-      SerializableDeploymentID deployment = new SerializableDeploymentID(name, phase, contentURL.toString());
+      SerializableDeploymentID deployment = new SerializableDeploymentID(name, contentURL.toString());
       deployment.setContentURL(contentURL);
       deployment.setCopyContent(copyContent);
       return new DeploymentProgressImpl(targets, deployment, CommandType.DISTRIBUTE);
    }
 
-   public String[] getRepositoryNames(String[] names, DeploymentPhase phase) throws Exception
+   public String[] getRepositoryNames(String[] names) throws Exception
    {
       List<DeploymentTarget> targets = getDeploymentTargets();
-      return targets.get(0).getRepositoryNames(names, phase);
+      return targets.get(0).getRepositoryNames(names);
    }
 
    public boolean isRedeploySupported()
@@ -223,72 +221,68 @@
       deployHandler.setTransientDeploymentRepository(null);
    }
 
-   public DeploymentProgress redeploy(String name, DeploymentPhase phase, URL contentURL)
-      throws Exception
+   public DeploymentProgress redeploy(String name)
    {
       if(name == null)
          throw new IllegalArgumentException("Null name.");
-      if(contentURL == null)
-         throw new IllegalArgumentException("Null contentURL.");
       
       if(activeProfile == null)
       {
          formatter.applyPattern(i18n.getString("DeploymentManager.NoProfileLoadedException")); //$NON-NLS-1$
          Object[] args = {};
          String msg = formatter.format(args);
-         throw new NoSuchProfileException(msg);
+         throw new IllegalStateException(msg);
       }
 
       List<DeploymentTarget> targets = getDeploymentTargets();
-      SerializableDeploymentID deployment = new SerializableDeploymentID(name, phase, null);
+      SerializableDeploymentID deployment = new SerializableDeploymentID(name, null);
       return new DeploymentProgressImpl(targets, deployment, CommandType.REDEPLOY);
    }
 
-   public DeploymentProgress prepare(DeploymentPhase phase, String... names) throws Exception
+   public DeploymentProgress prepare(String... names) throws Exception
    {
-      return doProgress(CommandType.PREPARE, phase, names);
+      return doProgress(CommandType.PREPARE, names);
    }
 
-   public DeploymentProgress start(DeploymentPhase phase, String... names) throws Exception
+   public DeploymentProgress start(String... names) 
    {
       if(names == null)
          throw new IllegalArgumentException("Null names.");
       
-      return doProgress(CommandType.START, phase, names);
+      return doProgress(CommandType.START, names);
    }
 
-   public DeploymentProgress stop(DeploymentPhase phase, String... names) throws Exception
+   public DeploymentProgress stop(String... names) 
    {
       if(names == null)
          throw new IllegalArgumentException("Null names.");
       
-      return doProgress(CommandType.STOP, phase, names);
+      return doProgress(CommandType.STOP, names);
    }
 
-   public DeploymentProgress undeploy(DeploymentPhase phase, String... names) throws Exception
+   public DeploymentProgress remove(String... names)
    {
       if(names == null)
          throw new IllegalArgumentException("Null names.");
       
-      return doProgress(CommandType.UNDEPLOY, phase, names);
+      return doProgress(CommandType.REMOVE, names);
    }
 
-   protected DeploymentProgress doProgress(CommandType type, DeploymentPhase phase, String... names)
-      throws Exception
+   protected DeploymentProgress doProgress(CommandType type, String... names)
    {
       if(activeProfile == null)
       {
          formatter.applyPattern(i18n.getString("DeploymentManager.NoProfileLoadedException")); //$NON-NLS-1$
          Object[] args = {};
          String msg = formatter.format(args);
-         throw new NoSuchProfileException(msg);
+         throw new IllegalStateException(msg);
       }
 
       if (names == null || names.length == 0)
          log.warn("Null or empty names.");
 
       List<DeploymentTarget> targets = getDeploymentTargets();
-      SerializableDeploymentID deployment = new SerializableDeploymentID(names, phase, null);
+      SerializableDeploymentID deployment = new SerializableDeploymentID(names, null);
       return new DeploymentProgressImpl(targets, deployment, type);
    }
 

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java	2009-02-22 11:57:44 UTC (rev 84596)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java	2009-02-22 12:00:34 UTC (rev 84597)
@@ -28,16 +28,16 @@
 import org.jboss.deployers.spi.management.deploy.DeploymentID;
 import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
 import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus.CommandType;
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus.StateType;
 import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
 import org.jboss.deployers.spi.management.deploy.ProgressEvent;
 import org.jboss.deployers.spi.management.deploy.ProgressListener;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus.CommandType;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus.StateType;
 
 /**
  * 
  * @author Scott.Stark at jboss.org
- * @version $Revision:$
+ * @version $Revision$
  */
 public class DeploymentProgressImpl implements DeploymentProgress, Serializable
 {
@@ -87,8 +87,8 @@
          case STOP:
             stop();
             break;
-         case UNDEPLOY:
-            undeploy();
+         case REMOVE:
+            remove();
             break;
          default:
             throw new IllegalStateException(command+" is not currently handled");
@@ -288,7 +288,7 @@
       }
    }
 
-   protected void undeploy()
+   protected void remove()
    {
       SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
       status.setMessage("Running undeploy to: "+targets);
@@ -309,7 +309,7 @@
 
          try
          {
-            target.undeploy(deployment);
+            target.remove(deployment);
             status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
             status.setTarget(target);
             status.setMessage("Completed undeploy for target: "+target);

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java	2009-02-22 11:57:44 UTC (rev 84596)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java	2009-02-22 12:00:34 UTC (rev 84597)
@@ -27,11 +27,10 @@
 import java.util.Arrays;
 
 import org.jboss.deployers.spi.management.deploy.DeploymentID;
-import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
 
 /**
  * @author Scott.Stark at jboss.org
- * @version $Revision:$
+ * @version $Revision$
  */
 public class SerializableDeploymentID implements DeploymentID, Serializable
 {
@@ -41,23 +40,21 @@
    private transient InputStream contentIS;
    private String[] deploymentNames;
    private String[] repositoryNames;
-   private DeploymentPhase phase;
    private String description;
    private URL contentURL;
    private boolean copyContent;
 
    public SerializableDeploymentID(DeploymentID deployment)
    {
-      this(deployment.getNames(), deployment.getPhase(), deployment.getDescription());
+      this(deployment.getNames(), deployment.getDescription());
    }
-   public SerializableDeploymentID(String name, DeploymentPhase phase, String description)
+   public SerializableDeploymentID(String name, String description)
    {
-      this(new String[]{name}, phase, description);
+      this(new String[]{name}, description);
    }
-   public SerializableDeploymentID(String[] names, DeploymentPhase phase, String description)
+   public SerializableDeploymentID(String[] names, String description)
    {
       this.deploymentNames = names;
-      this.phase = phase;
       this.description = description;
       this.copyContent = true; // by default we copy content
    }
@@ -77,10 +74,6 @@
    {
       this.repositoryNames = names;
    }
-   public DeploymentPhase getPhase()
-   {
-      return phase;
-   }
 
    public String getDescription()
    {
@@ -132,7 +125,6 @@
       // Only add the repositoryNames if it differs from deploymentNames
       if(getRepositoryNames() != getNames())
          buffer.append("repositoryNames=").append(Arrays.toString(getRepositoryNames()));
-      buffer.append("phase=").append(phase);
       buffer.append("copyContent=").append(copyContent);
       buffer.append("description=").append(description);
       return buffer.toString();

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/AbstractDeployHandler.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/AbstractDeployHandler.java	2009-02-22 11:57:44 UTC (rev 84596)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/AbstractDeployHandler.java	2009-02-22 12:00:34 UTC (rev 84597)
@@ -94,9 +94,8 @@
    {
       if(names == null || names.length == 0)
          return new String[0];
-      // TODO
-      // return this.deploymentRepository.getRepositoryNames(names);
-      return names;
+      
+      return this.deploymentRepository.getRepositoryNames(names);
    }
    
    public void addListener(InvokerCallbackHandler arg0)
@@ -204,8 +203,7 @@
    protected void start(DeploymentID dtID) throws Exception
    {
       String[] names = dtID.getNames();
-      DeploymentPhase phase = dtID.getPhase();
-      log.info("Begin start, "+Arrays.asList(names) + ", phase: " + phase);
+      log.info("Begin start, "+Arrays.asList(names));
       
       for(String name : names)
       {

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java	2009-02-22 11:57:44 UTC (rev 84596)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java	2009-02-22 12:00:34 UTC (rev 84597)
@@ -34,7 +34,6 @@
 import org.jboss.deployers.spi.management.deploy.DeploymentID;
 import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
 import org.jboss.logging.Logger;
-import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
 import org.jboss.profileservice.management.upload.SerializableDeploymentID;
 import org.jboss.remoting.Client;
 import org.jboss.remoting.InvokerLocator;
@@ -122,7 +121,7 @@
       }
    }
 
-   public String[] getRepositoryNames(String[] names, DeploymentPhase phase) throws Exception
+   public String[] getRepositoryNames(String[] names) throws Exception
    {
       Client client = getClient();
       try
@@ -130,7 +129,6 @@
          log.debug("Begin getRepositoryNames: " + Arrays.asList(names));
          HashMap<Object, Object> args = new HashMap<Object, Object>();
          args.put("names", names);
-         args.put("phase", phase);
          String[] rnames = (String[]) invoke(client, "getRepositoryNames", args);
          log.debug("End getRepositoryNames: " + Arrays.asList(rnames));
          return rnames;

Modified: trunk/profileservice/src/resources/profileservice-jboss-beans.xml
===================================================================
--- trunk/profileservice/src/resources/profileservice-jboss-beans.xml	2009-02-22 11:57:44 UTC (rev 84596)
+++ trunk/profileservice/src/resources/profileservice-jboss-beans.xml	2009-02-22 12:00:34 UTC (rev 84597)
@@ -113,6 +113,7 @@
         </uninstall>
         <property name="mainDeployer"><inject bean="MainDeployer"/></property>
         <property name="profileService"><inject bean="ProfileService"/></property>
+       	<property name="attachmentStore"><inject bean="AttachmentStore" /></property>
         <property name="locator"><inject bean="ConnectorMBean" property="invokerLocator"/></property>
         <property name="dispatcher"><inject bean="RuntimeComponentDispatcher"/></property>
         <property name="bootstrapManagedDeployments"><inject bean="ProfileServiceBootstrap" property="bootstrapMDs"/></property>

Modified: trunk/server/src/etc/conf/default/bootstrap/profile.xml
===================================================================
--- trunk/server/src/etc/conf/default/bootstrap/profile.xml	2009-02-22 11:57:44 UTC (rev 84596)
+++ trunk/server/src/etc/conf/default/bootstrap/profile.xml	2009-02-22 12:00:34 UTC (rev 84597)
@@ -79,7 +79,6 @@
 
 	<!-- The default deployment repository factory -->
 	<bean name="DefaultDeploymentRepositoryFactory" class="org.jboss.system.server.profileservice.repository.DefaultDeploymentRepositoryFactory">
-		<property name="attachmentStore"><inject bean="AttachmentStore" /></property>
 		<property name="deploymentFilter"><inject bean="DeploymentFilter" /></property>
 		<property name="checker"><inject bean="StructureModificationChecker" /></property>
 	</bean>

Modified: trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractProfile.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractProfile.java	2009-02-22 11:57:44 UTC (rev 84596)
+++ trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractProfile.java	2009-02-22 12:00:34 UTC (rev 84597)
@@ -26,7 +26,6 @@
 import java.util.List;
 import java.util.Set;
 
-import org.jboss.managed.api.ManagedComponent;
 import org.jboss.profileservice.spi.DeploymentRepository;
 import org.jboss.profileservice.spi.ModificationInfo;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
@@ -151,15 +150,6 @@
          throw new IllegalArgumentException("Null name.");
       return this.repository.removeDeployment(name);
    }
-
-   public void updateDeployment(ProfileDeployment d, ManagedComponent comp) throws Exception
-   {
-      if(d == null)
-         throw new IllegalArgumentException("Null deployment");
-      if(comp == null)
-         throw new IllegalArgumentException("Null managed component.");
-      this.repository.updateDeployment(d, comp);
-   }
    
    public void create() throws Exception
    {

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractDeploymentRepository.java	2009-02-22 11:57:44 UTC (rev 84596)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractDeploymentRepository.java	2009-02-22 12:00:34 UTC (rev 84597)
@@ -34,8 +34,6 @@
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.jboss.logging.Logger;
-import org.jboss.managed.api.ManagedComponent;
-import org.jboss.profileservice.spi.AttachmentStore;
 import org.jboss.profileservice.spi.DeploymentContentFlags;
 import org.jboss.profileservice.spi.DeploymentRepository;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
@@ -71,9 +69,6 @@
    
    /** The application phase deployment files keyed by VirtualFile URI string. */
    private final Map<String, VirtualFile> applicationVFCache = new ConcurrentHashMap<String, VirtualFile>();
-   
-   /** The attachmentStore. */
-   private AttachmentStore attachmentStore;
 
    /** The last time the profile was modified. */
    private volatile long lastModified;
@@ -100,16 +95,6 @@
    {
       return this.key;
    }
-   
-   public AttachmentStore getAttachmentStore()
-   {
-      return attachmentStore;
-   }
-   
-   public void setAttachmentStore(AttachmentStore attachmentStore)
-   {
-      this.attachmentStore = attachmentStore;
-   }
 
    public VirtualFileFilter getDeploymentFilter()
    {
@@ -128,8 +113,7 @@
    
    public void create() throws Exception
    {
-      if(this.attachmentStore == null)
-         throw new IllegalStateException("Null attachment store.");
+      //
    }
    
    public void unload()
@@ -278,7 +262,11 @@
       {
          for(String cacheName : this.applicationVFCache.keySet())
          {
-            if(cacheName.endsWith(name))
+            String fixedName = cacheName;
+            if(cacheName.endsWith("/"))
+               fixedName = cacheName.substring(0, cacheName.length() -1);
+            
+            if(fixedName.endsWith(name))
             {
                vf = this.applicationVFCache.get(cacheName);
                break;
@@ -291,7 +279,7 @@
       return vf;
    }
    
-   public String[] getRepositoryNames(String[] names) throws IOException
+   public String[] getRepositoryNames(String... names) throws IOException
    {
       if(names == null)
          throw new IllegalArgumentException("Null names[]");
@@ -376,21 +364,7 @@
    {
       return new AbstractProfileDeployment(vf);
    }
-   
-   public void updateDeployment(ProfileDeployment d, ManagedComponent comp) throws Exception
-   {
-      if(d == null)
-         throw new IllegalArgumentException("Null deployment");
 
-      if(comp != null)
-      {
-         // update component
-         attachmentStore.updateDeployment(d, comp);
-         // Update last modified
-         updateLastModfied();
-      }
-   }
-
    protected VirtualFile getCachedVirtualFile(URI uri) throws IOException 
    {
       VirtualFile vf = this.applicationVFCache.get(uri.toString());

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractProfileService.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractProfileService.java	2009-02-22 11:57:44 UTC (rev 84596)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractProfileService.java	2009-02-22 12:00:34 UTC (rev 84597)
@@ -302,7 +302,7 @@
       validate(context);
    }
    
-   public void validate(ProfileKey key) throws Exception
+   public void validateProfile(ProfileKey key) throws Exception
    {
       ProfileContext profile = this.registeredProfiles.get(key);
       if(profile == null)

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/DefaultDeploymentRepositoryFactory.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/DefaultDeploymentRepositoryFactory.java	2009-02-22 11:57:44 UTC (rev 84596)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/DefaultDeploymentRepositoryFactory.java	2009-02-22 12:00:34 UTC (rev 84597)
@@ -29,7 +29,6 @@
 import java.util.List;
 
 import org.jboss.deployers.vfs.spi.structure.modified.StructureModificationChecker;
-import org.jboss.profileservice.spi.AttachmentStore;
 import org.jboss.profileservice.spi.DeploymentRepository;
 import org.jboss.profileservice.spi.DeploymentRepositoryFactory;
 import org.jboss.profileservice.spi.ProfileKey;
@@ -54,9 +53,6 @@
   
    /** The repository types. */
    public final static Collection<String> types; 
-   
-   /** The attachment store. */
-   private AttachmentStore store;
 
    /** The deployment filter. */
    private VirtualFileFilter deploymentFilter;
@@ -74,16 +70,6 @@
       return types.toArray(new String[types.size()]);
    }
    
-   public AttachmentStore getAttachmentStore()
-   {
-      return store;
-   }
-   
-   public void setAttachmentStore(AttachmentStore store)
-   {
-      this.store = store;
-   }
-   
    public VirtualFileFilter getDeploymentFilter()
    {
       return deploymentFilter;
@@ -137,7 +123,6 @@
       {
          MutableDeploymentRepository repository = new MutableDeploymentRepository(key, uris);
          // Manually inject beans :)
-         repository.setAttachmentStore(store);
          repository.setDeploymentFilter(deploymentFilter);
          repository.setChecker(checker);
 
@@ -146,8 +131,6 @@
       else
       {
          ImmutableDeploymentRepository repository = new ImmutableDeploymentRepository(key, uris);
-         // Manually inject beans :)
-         repository.setAttachmentStore(store);
          repository.setDeploymentFilter(deploymentFilter);
          
          return repository;

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/FilteredDeploymentRepositoryFactory.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/FilteredDeploymentRepositoryFactory.java	2009-02-22 11:57:44 UTC (rev 84596)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/FilteredDeploymentRepositoryFactory.java	2009-02-22 12:00:34 UTC (rev 84597)
@@ -30,7 +30,6 @@
 import java.util.Collections;
 import java.util.List;
 
-import org.jboss.profileservice.spi.AttachmentStore;
 import org.jboss.profileservice.spi.DeploymentRepository;
 import org.jboss.profileservice.spi.DeploymentRepositoryFactory;
 import org.jboss.profileservice.spi.ModificationInfo;
@@ -56,23 +55,10 @@
    /** The filtered immutable type. */
    public final static String[] FACTORY_TYPE = new String[] { FilteredProfileSourceMetaData.class.getName() };
    
-   /** The attachment store. */
-   private AttachmentStore store;
-   
    public String[] getTypes()
    {
       return FACTORY_TYPE;
    }
-   
-   public AttachmentStore getAttachmentStore()
-   {
-      return store;
-   }
-   
-   public void setAttachmentStore(AttachmentStore store)
-   {
-      this.store = store;
-   }
 
    public DeploymentRepository createDeploymentRepository(ProfileKey key, ProfileSourceMetaData metaData)
    throws Exception
@@ -98,13 +84,7 @@
                deploymentList.add(deploymentName);
          }
       }
-      
-      // Create a filtered repository
-      FilteredRepository repository = new FilteredRepository(deploymentList, key, createUris(metaData) );
-      // Set attachment store
-      repository.setAttachmentStore(store);
-      
-      return repository; 
+      return new FilteredRepository(deploymentList, key, createUris(metaData)); 
    }
    
    protected URI[] createUris(ProfileSourceMetaData metaData) throws URISyntaxException

Modified: trunk/system/src/tests/org/jboss/test/server/profileservice/test/BootstrapProfileFactoryUnitTestCase.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/server/profileservice/test/BootstrapProfileFactoryUnitTestCase.java	2009-02-22 11:57:44 UTC (rev 84596)
+++ trunk/system/src/tests/org/jboss/test/server/profileservice/test/BootstrapProfileFactoryUnitTestCase.java	2009-02-22 12:00:34 UTC (rev 84597)
@@ -66,7 +66,6 @@
       
       // A filtered deployment factory
       FilteredDeploymentRepositoryFactory repositoryFactory = new FilteredDeploymentRepositoryFactory();
-      repositoryFactory.setAttachmentStore(createAttachmentStore());
       // The xml profile factory
       AbstractBootstrapProfileFactory profileFactory = new XmlProfileFactory(
             new URI[] { one.toURI(), two.toURI() });

Modified: trunk/system/src/tests/org/jboss/test/server/profileservice/test/ProfileServiceUnitTestCase.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/server/profileservice/test/ProfileServiceUnitTestCase.java	2009-02-22 11:57:44 UTC (rev 84596)
+++ trunk/system/src/tests/org/jboss/test/server/profileservice/test/ProfileServiceUnitTestCase.java	2009-02-22 12:00:34 UTC (rev 84597)
@@ -81,7 +81,6 @@
       
       // 
       FilteredDeploymentRepositoryFactory repositoryFactory = new FilteredDeploymentRepositoryFactory();
-      repositoryFactory.setAttachmentStore(createAttachmentStore());
       AbstractBootstrapProfileFactory profileFactory = new XmlProfileFactory(
             new URI[] { one.toURI(), two.toURI() });
       profileFactory.setProfileFactory(createProfileFactory(repositoryFactory));




More information about the jboss-cvs-commits mailing list