Package org.jboss.deployers.client.spi.main

Examples of org.jboss.deployers.client.spi.main.MainDeployer


      // Precondition checks and obtain as VDF impls
      final Collection<VdfDeployable> vdfDeployables = this.asVdfDeployables(deployables);

      // Get the MainDeployer
      //TODO Use ProfileService - EMB-39
      final MainDeployer mainDeployer = this.getMainDeployer();

      // Add each deployable
      for (final VdfDeployable vdfDeployable : vdfDeployables)
      {

         /*
          * Get the Deployers SPI Deployment
          */

         // Declare
         final Deployment deployment = vdfDeployable.getDeployment();

         // Add to the MainDeployer
         log.debug("Adding to " + mainDeployer + ": " + deployment);
         try
         {
            // Add the deployment to the MainDeployer
            mainDeployer.addDeployment(deployment);
         }
         catch (org.jboss.deployers.spi.DeploymentException de)
         {
            // Wrap in our own API's DeploymentException
            throw new DeploymentException(de);
View Full Code Here


         throw new IllegalArgumentException("At least one deployable must be specified");
      }

      // Get the MainDeployer
      //TODO Use ProfileService - EMB-39
      final MainDeployer mainDeployer = this.getMainDeployer();

      // Get the deployments for each deployable
      for (final Deployable deployable : deployables)
      {
         final Deployment deployment = this.getDeployablesToDeploymentsMap().get(deployable);
         if (deployment == null)
         {
            log.warn("Specified deployable " + deployable + " cannot be undeployed because it is not deployed.");
         }
         else
         {
            // Remove from MainDeployer
            try
            {
               mainDeployer.removeDeployment(deployment);
            }
            catch (org.jboss.deployers.spi.DeploymentException de)
            {
               // Wrap in our own API's DeploymentException
               throw new DeploymentException(de);
View Full Code Here

      if (context == null)
      {
         throw new IllegalStateException("Main deployer could not be found");
      }
      final Object target = context.getTarget();
      final MainDeployer mainDeployer = MainDeployer.class.cast(target);

      // Return
      return mainDeployer;
   }
View Full Code Here

         throw new IllegalArgumentException("deployables must not be null");
      }

      // Get the MainDeployer
      //TODO Use ProfileService - EMB-39
      final MainDeployer mainDeployer = this.getMainDeployer();

      // Record the deployments to be added
      final Map<Deployable, Deployment> deploymentsToBeAdded = new HashMap<Deployable, Deployment>();

      // For all Deployables
      for (final Deployable deployable : deployables)
      {

         // If already deployed
         if (deployed.containsKey(deployable))
         {
            log.warn("Attempting to re-deploy " + deployable + "; ignoring.");
         }

         // Make a VFS Deployment
         final URL target = deployable.getTarget();
         final VirtualFile vf;
         try
         {
            vf = VFS.getChild(target);
         }
         catch (final URISyntaxException e)
         {
            throw new RuntimeException("Could not create new VFS root from " + target, e);
         }
         final Deployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(vf);

         // Add to the MainDeployer
         log.debug("Adding to " + mainDeployer + ": " + deployment);
         try
         {
            // Add the deployment to the MainDeployer
            mainDeployer.addDeployment(deployment);
            deploymentsToBeAdded.put(deployable, deployment);
         }
         catch (final org.jboss.deployers.spi.DeploymentException de)
         {

            // Construct a new DeploymentException of this API
            final DeploymentException wrappedException = new DeploymentException(de);

            // Remove all previously-added deployables from further MainDeployer processing
            final Iterator<Entry<Deployable, Deployment>> it = deploymentsToBeAdded.entrySet().iterator();
            while (it.hasNext())
            {
               final Entry<Deployable, Deployment> next = it.next();
               final Deployable thisDeployable = next.getKey();
               try
               {
                  mainDeployer.removeDeployment(deploymentsToBeAdded.get(thisDeployable));
               }
               catch (org.jboss.deployers.spi.DeploymentException e)
               {
                  log.warn("Atomic deployment of " + Arrays.asList(deployables) + " failed due to " + de.getMessage()
                        + ", and we could not remove " + thisDeployable + " from further processing");
View Full Code Here

         throw new IllegalArgumentException("At least one deployable must be specified");
      }

      // Get the MainDeployer
      //TODO Use ProfileService - EMB-39
      final MainDeployer mainDeployer = this.getMainDeployer();

      // Record deployables to remove
      final Collection<Deployable> deployablesToRemove = new ArrayList<Deployable>();

      // Get the deployments for each deployable
      for (final Deployable deployable : deployables)
      {
         final Deployment deployment = this.deployed.get(deployable);
         if (deployment == null)
         {
            log.warn("Specified deployable " + deployable + " cannot be undeployed because it is not deployed.");
         }
         else
         {
            // Remove from MainDeployer
            try
            {
               mainDeployer.removeDeployment(deployment);
            }
            catch (org.jboss.deployers.spi.DeploymentException de)
            {
               // Wrap in our own API's DeploymentException
               throw new DeploymentException(de);
View Full Code Here

      if (context == null)
      {
         throw new IllegalStateException("Main deployer could not be found");
      }
      final Object target = context.getTarget();
      final MainDeployer mainDeployer = MainDeployer.class.cast(target);

      // Return
      return mainDeployer;
   }
View Full Code Here

    *
    * @return the main deployer
    */
   protected MainDeployer getMainDeployer()
   {
      MainDeployer result = getModule().getDeploymentUnit().getMainDeployer();
      if (result == null)
         throw new IllegalStateException("Unable to access main deployer");
      return result;
   }
View Full Code Here

    *
    * @return the changer or null if one isn't available
    */
   protected DeployerClientChangeExt getChanger()
   {
      MainDeployer main = getMainDeployer();
      if (main instanceof DeployerClientChangeExt)
         return (DeployerClientChangeExt) main;
      return null;
   }
View Full Code Here

      // Install the ShrinkWrapDeployer
      final URL shrinkwrapDeployerJBossBeans = Thread.currentThread().getContextClassLoader()
            .getResource(FILENAME_SHRINKWRAP_DEPLOYER_XML);
      assert shrinkwrapDeployerJBossBeans != null : "ShrinkWrap Deployer beans XML not found";
      final MainDeployer mainDeployer = (MainDeployer) server.getKernel().getController()
            .getContextByClass(MainDeployer.class).getTarget();
      final VirtualFile file;
      try
      {
         file = VFS.getChild(shrinkwrapDeployerJBossBeans);
      }
      catch (final URISyntaxException e)
      {
         throw new LifecycleException("Could not create virtual file for " + shrinkwrapDeployerJBossBeans, e);
      }
      if (file == null)
      {
         throw new IllegalStateException();
      }
      final VFSDeployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(file);
      try
      {
         mainDeployer.addDeployment(deployment);
         mainDeployer.process();
         mainDeployer.checkComplete();
      }
      catch (final org.jboss.deployers.spi.DeploymentException de)
      {
         throw new LifecycleException("Could not install ShrinkWrapDeployer", de);
      }
View Full Code Here

      }
      // Get Kernel
      final Kernel kernel = server.getKernel();

      // Obtain MainDeployer
      final MainDeployer mainDeployer = (MainDeployer) kernel.getController().getContextByClass(MainDeployer.class)
            .getTarget();
      assert mainDeployer != null : "MainDeployer found in Kernel was null";

      log.info("Started JBoss Embedded " + EJBContainer.class.getSimpleName());
      log.info("Modules for deployment: " + Arrays.asList(modules));
View Full Code Here

TOP

Related Classes of org.jboss.deployers.client.spi.main.MainDeployer

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.