Examples of AddonRegistry


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

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 = 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

   }

   @Test
   public void testSidewaysCollision() throws Exception
   {
      AddonRegistry registry = LocalServices.getFurnace(getClass().getClassLoader())
               .getAddonRegistry();
      ClassLoader A = this.getClass().getClassLoader();
      ClassLoader B = registry.getAddon(AddonId.from("B", "1")).getClassLoader();
      ClassLoader C = registry.getAddon(AddonId.from("C", "1")).getClassLoader();

      Class<?> typeAction1 = B.loadClass(Action1.class.getName());
      Action action1 = getProxiedInstance(A, B, typeAction1);

      Class<?> typePayload1 = C.loadClass(Payload1.class.getName());
View Full Code Here

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

   }

   @Test
   public void testServiceProxiesCanBeInterrupted() throws Exception
   {
      AddonRegistry registry = LocalServices.getFurnace(getClass().getClassLoader())
               .getAddonRegistry();

      final MockSimpleCountService service = registry.getServices(MockSimpleCountService.class).get();
      final AtomicReference<ContainerException> exception = new AtomicReference<>();
      Thread t = new Thread(new Runnable()
      {
         @Override
         public void run()
View Full Code Here

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

   }

   @Test
   public void testSimpleFileProxy() throws Exception
   {
      AddonRegistry registry = LocalServices.getFurnace(getClass().getClassLoader())
               .getAddonRegistry();
      ClassLoader thisLoader = ClassLoaderAdapterJavaIOTest.class.getClassLoader();
      ClassLoader dep1Loader = registry.getAddon(AddonId.from("dep", "1")).getClassLoader();

      Class<?> foreignType = dep1Loader.loadClass(JavaIOFactory.class.getName());
      File file = (File) foreignType.getMethod("getFile")
               .invoke(foreignType.newInstance());
View Full Code Here

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

   }

   @Test
   public void testIterableTypesAreProxied() throws Exception
   {
      AddonRegistry registry = LocalServices.getFurnace(getClass().getClassLoader())
               .getAddonRegistry();
      ClassLoader thisLoader = CLACProxiedCollectionsTest.class.getClassLoader();
      ClassLoader dep1Loader = registry.getAddon(AddonId.from("dep", "1")).getClassLoader();

      Class<?> foreignType = dep1Loader.loadClass(ProfileCommand.class.getName());

      Object delegate = foreignType.newInstance();
      ProfileCommand enhanced = (ProfileCommand) ClassLoaderAdapterBuilder.callingLoader(thisLoader)
View Full Code Here

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

   }

   @Test
   public void testCollectionsReturnUnwrappedResultsIfUnwrappedTypeIsCompatible() throws Exception
   {
      AddonRegistry registry = LocalServices.getFurnace(getClass().getClassLoader())
               .getAddonRegistry();
      ClassLoader thisLoader = CLACProxiedCollectionsReturnTypeUnwrappingTest.class.getClassLoader();
      ClassLoader dep1Loader = registry.getAddon(AddonId.from("dep1", "1")).getClassLoader();
      ClassLoader dep2Loader = registry.getAddon(AddonId.from("dep2", "2")).getClassLoader();

      Class<?> foreignProfileType = dep1Loader.loadClass(ProfileFactory.class.getName());
      Object delegate = foreignProfileType.newInstance();
      ProfileFactory factory = (ProfileFactory) ClassLoaderAdapterBuilder.callingLoader(thisLoader)
               .delegateLoader(dep1Loader).whitelist(Sets.toSet(Arrays.asList(dep1Loader, dep2Loader)))
View Full Code Here

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

   @Test
   public void testExportedInstanceExposesServiceTypeAndSourceAddon() throws Exception
   {
      Furnace furnace = LocalServices.getFurnace(getClass().getClassLoader());
      Assert.assertNotNull(furnace);
      AddonRegistry registry = furnace.getAddonRegistry();
      boolean found = false;
      for (Addon addon : registry.getAddons())
      {
         ExportedInstance<ExportedInstanceApiTest> instance = addon.getServiceRegistry()
                  .getExportedInstance(ExportedInstanceApiTest.class);
         if (instance != null)
         {
View Full Code Here

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

   }

   @Test
   public void testIterableTypesAreProxied() throws Exception
   {
      AddonRegistry registry = LocalServices.getFurnace(getClass().getClassLoader())
               .getAddonRegistry();
      ClassLoader thisLoader = CLACProxiedIterableTest.class.getClassLoader();
      ClassLoader dep1Loader = registry.getAddon(AddonId.from("dep", "1")).getClassLoader();

      Class<?> foreignType = dep1Loader.loadClass(IterableFactory.class.getName());
      Iterable<?> proxy = (Iterable<?>) foreignType.getMethod("getIterable")
               .invoke(foreignType.newInstance());
      Assert.assertFalse(Proxies.isForgeProxy(proxy));
View Full Code Here

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

   }

   @Test
   public void testCustomIterableTypesAreProxied() throws Exception
   {
      AddonRegistry registry = LocalServices.getFurnace(getClass().getClassLoader())
               .getAddonRegistry();
      ClassLoader thisLoader = CLACProxiedIterableTest.class.getClassLoader();
      ClassLoader dep1Loader = registry.getAddon(AddonId.from("dep", "1")).getClassLoader();

      Class<?> foreignType = dep1Loader.loadClass(IterableFactory.class.getName());
      Iterable<?> proxy = (Iterable<?>) foreignType.getMethod("getIterable")
               .invoke(foreignType.newInstance());
      Assert.assertFalse(Proxies.isForgeProxy(proxy));
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.