Package org.jboss.profileservice.spi

Examples of org.jboss.profileservice.spi.ProfileDeployment


         String deploymentName = getDeploymentName();
         // in case there is already a deployment, lock the contents.
         // TODO this might should not be done here ?
         if(getProfile().hasDeployment(deploymentName))
         {
            ProfileDeployment deployment = getProfile().getDeployment(deploymentName);
            deployment.getDeploymentInfo().setFlag(ProfileDeploymentFlag.LOCKED);
         }
        
         String repositoryName = deploymentRepository.addDeploymentContent(deploymentName, contentIS, getDeploymentID().getDeploymentOptions());
        
         // FIXME make deployment visible to management view
         VirtualFile vf = deploymentRepository.getDeploymentContent(repositoryName);
        
         // FIXME
         ProfileKey key = getProfile().getKey();
         String profileName = key.getName();
         String repoDeploymentName = createDeploymentName(vf);
         deploymentRepository.lockDeploymentContent(repoDeploymentName);
         // Don't try to re-mount
         if(deploymentRepository.getDeploymentNames().contains(repoDeploymentName) == false)
         {
            ProfileDeployment deployment = createDeployment(profileName, repoDeploymentName, vf);
            // Mark it as locked, so we can add contents after
            deployment.getDeploymentInfo().setFlag(ProfileDeploymentFlag.LOCKED);
            // Add deployment
            deploymentRepository.addDeployment(deployment.getName(), deployment);
         }
        
         // Notify
         response.fireModificationEvent(ProfileModificationEvent.create(ProfileModificationType.ADD, getProfile().getKey()));
      }
View Full Code Here


       
         Collection<ModificationInfo> modifiedDeployments = activeProfile.getModifiedDeployments();
         Collection<String> checkNames = new ArrayList<String>();
         for (ModificationInfo info : modifiedDeployments)
         {
            ProfileDeployment ctx = info.getDeployment();
            try
            {
               switch (info.getStatus())
               {
                  case ADDED:
                  case MODIFIED:
                     deployer.addDeployment(ctx);
                     checkNames.add(ctx.getName());
                     break;
                  case REMOVED:
                     deployer.removeDeployment(ctx);
                     break;
               }
            }
            catch(DeploymentException e)
            {
               log.warn("Failed to add deployment: " + ctx.getName(), e);
            }
         }
         try
         {
            // Process the changes
View Full Code Here

      {
         throw new RuntimeException("Cannot acquire global lock");
      }
      try
      {
         ProfileDeployment deployment = getDeployment(vfsPath);
         if (deployment != null)
         {
            VirtualFile vf = VFS.getChild(vfsPath);
            for (Map.Entry<String, URI> entry : namedURIMap.entrySet())
            {
               String relativePath = null;
               VirtualFile root = VFS.getChild(entry.getValue());
               try
               {
                  relativePath = vf.getPathNameRelativeTo(root);
               }
               catch (IllegalArgumentException notParent)
               {
                  continue;
               }
               this.clusteringHandler.removeDeploymentContent(entry.getKey(), relativePath);
            }
           
            return super.removeDeployment(deployment.getName());
         }
         else
         {
            return null;
         }
View Full Code Here

   {
      if(vfsPath == null)
         throw new IllegalArgumentException("Null vfsPath");
     
      // Get the deployment
      ProfileDeployment deployment = getDeployment(vfsPath);
      String deploymentName = deployment.getName();
      // Remove the entries
      this.applicationCtxs.remove(deploymentName);
      cleanupDeployment(deploymentName);
      // Update last modified
      updateLastModfied();
View Full Code Here

   {
      ArrayList<VirtualFile> added = new ArrayList<VirtualFile>();
      addedDeployment(added, applicationDir);
      for (VirtualFile vf : added)
      {
         ProfileDeployment vfCtx = createDeployment(vf);
         addDeployment(vfCtx.getName(), vfCtx);
      }
   }
View Full Code Here

         if (apps != null)
         {
            Iterator<ProfileDeployment> iter = apps.iterator();
            while (iter.hasNext())
            {
               ProfileDeployment ctx = iter.next();
               VirtualFile root = ctx.getRoot();
               String pathName = ctx.getName();
               // Ignore locked or disabled applications
               if (this.hasDeploymentContentFlags(pathName, ignoreFlags))
               {
                  if (trace)
                     log.trace("Ignoring locked application: " + root);
View Full Code Here

      {
         String pathName = createDeploymentName(vf);
         if(modified.containsKey(pathName) == false)
         {
            // Create deployment
            ProfileDeployment ctx = createDeployment(vf);
            // Create modification info
            ModificationInfo info = new ModificationInfo(ctx, vf.getLastModified(), ModifyStatus.ADDED);
            // Add
            modified.put(pathName, info);
            internalAddDeployment(ctx.getName(), ctx);
            getChecker().addStructureRoot(vf);
         }
      }
   }
View Full Code Here

   {
      if(vfsPath == null)
         throw new IllegalArgumentException("Null vfsPath");
     
      // Get the deployment
      ProfileDeployment deployment = super.removeDeployment(vfsPath);
      // Return
      return deployment;
   }
View Full Code Here

   public ProfileDeployment getDeployment(String vfsPath) throws NoSuchDeploymentException
   {
      if(vfsPath == null)
         throw new IllegalArgumentException("Null vfsPath");
     
      ProfileDeployment ctx = super.getDeployment(vfsPath);
      if(ctx == null)
      {
         List<String> names = findDeploymentContent(vfsPath);
         if(names.size() == 1)
         {
View Full Code Here

         log.trace("Aquiring content write lock");
      lockWrite();
      try
      {
         // Remove the deployment from the filesystem
         ProfileDeployment deployment = getDeployment(vfsPath);
         VirtualFile root = deployment.getRoot();
        
         if(deleteFile && root != null && root.exists())
         {
            // Delete the file
            if(VFSUtils.recursiveDelete(root) == false)
               throw new IOException("Failed to delete: " + root);
           
            cleanUpRoot(root)
         }
        
         // Cleanup
         return super.removeDeployment(deployment.getName());
      }
      finally
      {
         unlockWrite();
         if (log.isTraceEnabled())
View Full Code Here

TOP

Related Classes of org.jboss.profileservice.spi.ProfileDeployment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.