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

    private static DeploymentAspect parseDeploymentAspect(XMLStreamReader reader, ClassLoader loader) throws XMLStreamException {
        String deploymentAspectClass = reader.getAttributeValue(null, CLASS);
        if (deploymentAspectClass == null) {
            throw new IllegalStateException("Could not find class attribute for deployment aspect!");
        }
        DeploymentAspect deploymentAspect = null;
        try {
            @SuppressWarnings("unchecked")
            Class<? extends DeploymentAspect> clazz = (Class<? extends DeploymentAspect>) Class.forName(deploymentAspectClass, true, loader);
            ClassLoader orig = getContextClassLoader();
            try {
                setContextClassLoader(loader);
                deploymentAspect = clazz.newInstance();
            } finally {
                setContextClassLoader(orig);
            }
        } catch (Exception e) {
            throw new IllegalStateException("Could not create a deploymeny aspect of class: " + deploymentAspectClass, e);
        }
        String priority = reader.getAttributeValue(null, PRIORITY);
        if (priority != null) {
            deploymentAspect.setRelativeOrder(Integer.parseInt(priority.trim()));
        }
        while (reader.hasNext()) {
            switch (reader.nextTag()) {
                case XMLStreamConstants.END_ELEMENT: {
                    if (match(reader, NS, DEPLOYMENT_ASPECT)) {
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.