Examples of DeploymentAspect


Examples of org.jboss.wsf.spi.deployment.DeploymentAspect

   private void throwSortException(List<DeploymentAspect> sortedAspects, List<DeploymentAspect> allAspects)
   {
      Set<String> providedConditions = new HashSet<String>();
      for (int i = 0; i < sortedAspects.size(); i++)
      {
         DeploymentAspect sortedAspect = sortedAspects.get(i);
         providedConditions.addAll(sortedAspect.getProvidesAsSet());
      }

      String exmsg = "Cannot add deployment aspect(s)";
      StringBuilder str = new StringBuilder(exmsg);
View Full Code Here

Examples of org.jboss.wsf.spi.deployment.DeploymentAspect

   {
      int index = -1;
      Set<String> providedConditions = new HashSet<String>(parentProvidedConditions);
      for (int i = 0; i < sortedAspects.size(); i++)
      {
         DeploymentAspect sortedAspect = sortedAspects.get(i);
         providedConditions.addAll(sortedAspect.getProvidesAsSet());
         if (providedConditions.containsAll(aspect.getRequiresAsSet()))
         {
            index = i + 1;
            break;
         }
View Full Code Here

Examples of org.jboss.wsf.spi.deployment.DeploymentAspect

   {
      // create the deployment
      Set<String> providedConditions = new HashSet<String>();
      for (int i = 0; i < getDeploymentAspects().size(); i++)
      {
         DeploymentAspect aspect = getDeploymentAspects().get(i);

         // Check that all required aspects are met
         /*
          TODO: This should done by adding all provided conditions to the Deployment
          when being executed. Otherwise we will miss the parent provided conditions here
         
          Set<String> requiredSet = aspect.getRequiresAsSet();
          requiredSet.remove(DeploymentAspect.LAST_DEPLOYMENT_ASPECT);
          if (providedConditions.containsAll(requiredSet) == false)
          throw new IllegalStateException("Required conditions '" + aspect.getRequires() + "' not satisfied by '" + providedConditions + "' for: " + aspect);
          */

         logInvocation(aspect, "Create");
         aspect.create(dep);

         providedConditions.addAll(aspect.getProvidesAsSet());
      }

      dep.setState(DeploymentState.CREATED);

      // start the deployment
      for (int i = 0; i < getDeploymentAspects().size(); i++)
      {
         DeploymentAspect aspect = getDeploymentAspects().get(i);
         try
         {
            logInvocation(aspect, "Start");
            aspect.start(dep);
         }
         catch (RuntimeException rte)
         {
            while (i-- >= 0)
            {
View Full Code Here

Examples of org.jboss.wsf.spi.deployment.DeploymentAspect

   public void undeploy(Deployment dep)
   {
      // stop the deployment
      for (int i = getDeploymentAspects().size(); 0 < i; i--)
      {
         DeploymentAspect aspect = getDeploymentAspects().get(i - 1);
         failsafeStop(aspect, dep);
      }

      dep.setState(DeploymentState.STOPPED);

      // destroy the deployment
      for (int i = getDeploymentAspects().size(); 0 < i; i--)
      {
         DeploymentAspect aspect = getDeploymentAspects().get(i - 1);
         failsafeDestroy(aspect, dep);
      }

      dep.setState(DeploymentState.DESTROYED);
   }
View Full Code Here

Examples of org.jboss.wsf.spi.deployment.DeploymentAspect

   {
      // create the deployment
      Set<String> providedConditions = new HashSet<String>();
      for (int i = 0; i < getDeploymentAspects().size(); i++)
      {
         DeploymentAspect aspect = getDeploymentAspects().get(i);

         // Check that all required aspects are met
         /*
          TODO: This should done by adding all provided conditions to the Deployment
          when being executed. Otherwise we will miss the parent provided conditions here

          Set<String> requiredSet = aspect.getRequiresAsSet();
          requiredSet.remove(DeploymentAspect.LAST_DEPLOYMENT_ASPECT);
          if (providedConditions.containsAll(requiredSet) == false)
          throw new IllegalStateException("Required conditions '" + aspect.getRequires() + "' not satisfied by '" + providedConditions + "' for: " + aspect);
          */

         logInvocation(aspect, "Create");        
         aspect.create(dep, runtime);

         providedConditions.addAll(aspect.getProvidesAsSet());
      }

      dep.setState(DeploymentState.CREATED);
   }
View Full Code Here

Examples of org.jboss.wsf.spi.deployment.DeploymentAspect

   public void start(Deployment dep, WSFRuntime runtime)
   {
      // start the deployment
      for (int i = 0; i < getDeploymentAspects().size(); i++)
      {
         DeploymentAspect aspect = getDeploymentAspects().get(i);
         try
         {
            logInvocation(aspect, "Start");
            aspect.start(dep, runtime);
         }
         catch (RuntimeException rte)
         {
            while (i-- >= 0)
            {
View Full Code Here

Examples of org.jboss.wsf.spi.deployment.DeploymentAspect

   public void stop(Deployment dep, WSFRuntime runtime)
   {
      // stop the deployment
      for (int i = getDeploymentAspects().size(); 0 < i; i--)
      {
         DeploymentAspect aspect = getDeploymentAspects().get(i - 1);
         failsafeStop(aspect, dep, runtime);
      }

      dep.setState(DeploymentState.STOPPED);
   }
View Full Code Here

Examples of org.jboss.wsf.spi.deployment.DeploymentAspect

   public void destroy(Deployment dep, WSFRuntime runtime)
   {
      // destroy the deployment
      for (int i = getDeploymentAspects().size(); 0 < i; i--)
      {
         DeploymentAspect aspect = getDeploymentAspects().get(i - 1);
         failsafeDestroy(aspect, dep, runtime);
      }

      dep.setState(DeploymentState.DESTROYED);
   }
View Full Code Here

Examples of org.jboss.wsf.spi.deployment.DeploymentAspect

         if (manager.getParent() != null)
         {
            Iterator<DeploymentAspect> it = manager.getParent().getDeploymentAspects().iterator();
            while (it.hasNext())
            {
               DeploymentAspect aspect = it.next();
               parentProvidedConditions.addAll(aspect.getProvidesAsSet());
            }
         }

         sortedAspects = new ArrayList<DeploymentAspect>();
         List<DeploymentAspect> allAspects = new ArrayList<DeploymentAspect>(unsortedAspects);

         // Add aspects with no requirements first
         Iterator<DeploymentAspect> itAll = allAspects.iterator();
         while (itAll.hasNext())
         {
            DeploymentAspect aspect = itAll.next();
            if (aspect.getRequires() == null || parentProvidedConditions.containsAll(aspect.getRequiresAsSet()))
            {
               sortedAspects.add(aspect);
               itAll.remove();
            }
         }

         // Add aspects that have requirements that already added aspects provide
         itAll = allAspects.iterator();
         while (itAll.hasNext())
         {
            DeploymentAspect aspect = itAll.next();
            int index = getAspectIndex(sortedAspects, aspect);
            if (index != -1)
            {
               sortedAspects.add(index, aspect);
               itAll.remove();

               itAll = allAspects.iterator(); // Hm,...
            }
         }

         // Add LAST_DEPLOYMENT_ASPECT
         itAll = allAspects.iterator();
         while (itAll.hasNext())
         {
            DeploymentAspect aspect = itAll.next();
            if (DeploymentAspect.LAST_DEPLOYMENT_ASPECT.equals(aspect.getRequires()))
            {
               sortedAspects.add(aspect);
               itAll.remove();
            }
         }
View Full Code Here

Examples of org.jboss.wsf.spi.deployment.DeploymentAspect

      List<DeploymentAspect> managerAspects = new ArrayList<DeploymentAspect>();
      managerAspects.addAll(manager.getDeploymentAspects());
      Iterator<DeploymentAspect> it = aspects.iterator();
      while (it.hasNext())
      {
         DeploymentAspect aspect = it.next();
         managerAspects.remove(aspect);
      }
      manager.setDeploymentAspects(managerAspects);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.