Examples of AddonRegistry


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

         Object testInstance = null;
         Class<?> testClass = null;
         try
         {
            final AddonRegistry addonRegistry = furnace.getAddonRegistry();

            waitUntilStable(furnace);
            System.out.println("Searching for test [" + testClassName + "]");

            for (Addon addon : addonRegistry.getAddons())
            {
               if (addon.getStatus().isStarted())
               {
                  ServiceRegistry registry = addon.getServiceRegistry();
                  ExportedInstance<?> exportedInstance = registry.getExportedInstance(testClassName);
View Full Code Here

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

   }

   private void waitForDeploymentCompletion(Deployment deployment, final AddonId addonToDeploy)
            throws DeploymentException
   {
      AddonRegistry registry = runnable.getForge().getAddonRegistry();
      Addon addon = registry.getAddon(addonToDeploy);
      try
      {
         Future<Void> future = addon.getFuture();
         if (!future.isDone())
         {
View Full Code Here

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

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

      try
      {
         Addon addonToStop = registry.getAddon(addonToUndeploy);
         if (addonToStop.getStatus().isLoaded())
            ((MutableAddonRepository) addonToStop.getRepository()).disable(addonToUndeploy);
         Addons.waitUntilStopped(addonToStop);
      }
      catch (Exception e)
View Full Code Here

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

   @Test(timeout = 5000)
   public void testPreShutdownIsCalled() throws Exception
   {
      Furnace furnace = LocalServices.getFurnace(getClass().getClassLoader());
      AddonRegistry registry = furnace.getAddonRegistry();
      Addon dep2 = registry.getAddon(AddonId.from("dep2", "2"));
      RecordingEventManager manager = registry.getServices(RecordingEventManager.class).get();
      Assert.assertEquals(3, manager.getPostStartupCount());
      MutableAddonRepository repository = (MutableAddonRepository) furnace.getRepositories().get(0);
      repository.disable(dep2.getId());
      Addons.waitUntilStopped(dep2);
      Assert.assertEquals(1, manager.getPreShutdownCount());
View Full Code Here

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

   @Test
   public void testPostStartupIsCalled() throws Exception
   {
      Furnace furnace = LocalServices.getFurnace(getClass().getClassLoader());
      AddonRegistry registry = furnace.getAddonRegistry();
      RecordingEventManager manager = registry.getServices(RecordingEventManager.class).get();
      Assert.assertEquals(2, manager.getPostStartupCount());
   }
View Full Code Here

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

      Object testInstance = null;
      Class<?> testClass = null;
      try
      {
         final String testClassName = testMethodExecutor.getInstance().getClass().getName();
         final AddonRegistry addonRegistry = forge.getAddonRegistry();

         waitUntilStable(forge);
         System.out.println("Searching for test [" + testClassName + "]");

         for (Addon addon : addonRegistry.getAddons())
         {
            if (addon.getStatus().isStarted())
            {
               ServiceRegistry registry = addon.getServiceRegistry();
               ExportedInstance<?> exportedInstance = registry.getExportedInstance(testClassName);
View Full Code Here

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

      furnace.startAsync();

      while (!listener.isConfigurationScanned())
         Thread.sleep(100);

      AddonRegistry registry = furnace.getAddonRegistry();
      Addons.waitUntilStarted(registry.getAddon(one_dep_a), 10, TimeUnit.SECONDS);
      AddonRegistry leftRegistry = furnace.getAddonRegistry(left);

      Assert.assertNotNull(leftRegistry.getAddon(no_dep));
      Assert.assertTrue(registry.getAddon(no_dep).getStatus().isMissing());

      Assert.assertNotNull(registry.getAddon(no_dep2));
      Assert.assertTrue(leftRegistry.getAddon(no_dep2).getStatus().isMissing());

      registration.removeListener();

      furnace.stop();
   }
View Full Code Here

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

      furnace.startAsync();

      while (!listener.isConfigurationScanned())
         Thread.sleep(100);

      AddonRegistry registry = furnace.getAddonRegistry();
      Addons.waitUntilStarted(registry.getAddon(one_dep_a), 10, TimeUnit.SECONDS);
      AddonRegistry leftRegistry = furnace.getAddonRegistry(left);

      Addon addon = leftRegistry.getAddon(one_dep);
      Assert.assertNotNull(addon);

      registration.removeListener();

      furnace.stop();
View Full Code Here

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

   }

   private void waitForDeploymentCompletion(Deployment deployment, final AddonId addonToDeploy)
            throws DeploymentException
   {
      AddonRegistry registry = runnable.getForge().getAddonRegistry();
      Addon addon = registry.getAddon(addonToDeploy);
      try
      {
         Future<Void> future = addon.getFuture();
         future.get();
         if (addon.getStatus().isFailed())
View Full Code Here

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

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

      try
      {
         Addon addonToStop = registry.getAddon(addonToUndeploy);
         if (addonToStop.getStatus().isLoaded())
            ((MutableAddonRepository) addonToStop.getRepository()).disable(addonToUndeploy);
         Addons.waitUntilStopped(addonToStop);
      }
      catch (Exception e)
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.