Package org.jboss.forge.container.addons

Examples of org.jboss.forge.container.addons.AddonRegistry


      {
         throw new IllegalArgumentException(
                  "Invalid Archive type. Ensure that your @Deployment method returns type 'ForgeArchive'.");
      }

      AddonRegistry registry = runnable.getForge().getAddonRegistry();

      try
      {
         Future<Void> future = registry.start(addonToDeploy);
         future.get();
         Addon addon = registry.getAddon(addonToDeploy);
         if (addon.getStatus().isFailed())
         {
            ContainerException e = new ContainerException("Addon " + addonToDeploy + " failed to deploy.");
            deployment.deployedWithError(e);
            throw e;
View Full Code Here


   @Override
   public void undeploy(Archive<?> archive) throws DeploymentException
   {
      AddonId addonToUndeploy = getAddonEntry(deploymentInstance.get());
      AddonRegistry registry = runnable.getForge().getAddonRegistry();

      try
      {
         repository.disable(addonToUndeploy);
         Addon addonToStop = registry.getAddon(addonToUndeploy);
         registry.stop(addonToStop);
         Addons.waitUntilStopped(addonToStop);
      }
      catch (Exception e)
      {
         throw new DeploymentException("Failed to undeploy " + addonToUndeploy, e);
View Full Code Here

            catch (InterruptedException e)
            {
               e.printStackTrace();
            }
         }
         AddonRegistry registry = runnable.getForge().getAddonRegistry();
         try
         {
            Future<Void> future = registry.getAddon(addonToDeploy).getFuture();
            future.get();
            Addon addon = registry.getAddon(addonToDeploy);
            if (addon.getStatus().isFailed())
            {
               ContainerException e = new ContainerException("Addon " + addonToDeploy + " failed to deploy.");
               deployment.deployedWithError(e);
               throw e;
View Full Code Here

   @Override
   public void undeploy(Archive<?> archive) throws DeploymentException
   {
      AddonId addonToUndeploy = getAddonEntry(deploymentInstance.get());
      AddonRegistry registry = runnable.getForge().getAddonRegistry();
      System.out.println("Undeploying [" + addonToUndeploy + "] ... ");

      try
      {
         repository.disable(addonToUndeploy);
         Addon addonToStop = registry.getAddon(addonToUndeploy);
         Addons.waitUntilStopped(addonToStop);
      }
      catch (Exception e)
      {
         throw new DeploymentException("Failed to undeploy " + addonToUndeploy, e);
View Full Code Here

         {
            ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
            ClassLoader eventClassLoader = event.getClass().getClassLoader();
            if (contextClassLoader.equals(eventClassLoader))
            {
               AddonRegistry addonRegistry = CDI.current().select(AddonRegistry.class).get();
               for (Addon addon : addonRegistry.getAddons(AddonFilters.allStarted()))
               {
                  // Events should not be fired back into the container from which they originated
                  ClassLoader addonClassLoader = addon.getClassLoader();
                  if (!(event.getClass().getClassLoader().equals(addonClassLoader)
                           || contextClassLoader.equals(addonClassLoader)
View Full Code Here

TOP

Related Classes of org.jboss.forge.container.addons.AddonRegistry

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.