Package org.jboss.forge.furnace.services

Examples of org.jboss.forge.furnace.services.ServiceRegistry


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

               if (exportedInstance != null)
               {
                  if (testInstance == null)
                  {
View Full Code Here


                  ClassLoader addonClassLoader = addon.getClassLoader();
                  if (!(event.getClass().getClassLoader().equals(addonClassLoader)
                           || contextClassLoader.equals(addonClassLoader)
                           || ClassLoader.getSystemClassLoader().equals(eventClassLoader)))
                  {
                     ServiceRegistry addonServiceRegistry = addon.getServiceRegistry();
                     BeanManager manager = addonServiceRegistry.getExportedInstance(BeanManager.class).get();
                     manager.fireEvent(event, qualifiers.toArray(new Annotation[] {}));
                  }
               }
            }
         }
View Full Code Here

               ServiceRegistryProducer serviceRegistryProducer = BeanManagerUtils.getContextualInstance(manager,
                        ServiceRegistryProducer.class);
               serviceRegistryProducer.setServiceRegistry(new ServiceRegistryImpl(forge.getLockManager(), addon,
                        manager, extension));

               ServiceRegistry registry = BeanManagerUtils.getContextualInstance(manager, ServiceRegistry.class);
               Assert.notNull(registry, "Service registry was null.");
               addon.setServiceRegistry(registry);

               logger.info("Services loaded from addon [" + addon.getId() + "] -  " + registry.getExportedTypes());

               shutdownCallback = new Callable<Object>()
               {
                  @Override
                  public Object call() throws Exception
View Full Code Here

         if (ClassLoaders.containsClass(addon.getClassLoader(), serviceType))
         {
            Addons.waitUntilStarted(addon);
            if (!addon.getStatus().isFailed())
            {
               ServiceRegistry serviceRegistry = addon.getServiceRegistry();
               if (serviceRegistry.hasService(serviceType))
               {
                  ExportedInstance<?> instance = serviceRegistry.getExportedInstance(serviceType);
                  Assert.notNull(instance, "Exported Instance of [" + serviceType.getName()
                           + "] not found in originating ServiceRegistry [" + addon.getId() + "].");
                  if (instance instanceof ExportedInstanceImpl)
                     // FIXME remove the need for this implementation coupling
                     result = ((ExportedInstanceImpl<?>) instance).get(new LocalServiceInjectionPoint(injectionPoint,
View Full Code Here

            Set<ExportedInstance<T>> result = new HashSet<ExportedInstance<T>>();
            for (Addon addon : tree)
            {
               if (AddonStatus.STARTED.equals(addon.getStatus()))
               {
                  ServiceRegistry serviceRegistry = addon.getServiceRegistry();
                  result.addAll(serviceRegistry.getExportedInstances(type));
               }
            }
            return result;
         }
      });
View Full Code Here

            Set<ExportedInstance<T>> result = new HashSet<ExportedInstance<T>>();
            for (Addon addon : tree)
            {
               if (addon.getStatus().isStarted())
               {
                  ServiceRegistry serviceRegistry = addon.getServiceRegistry();
                  Set<ExportedInstance<T>> remoteInstances = serviceRegistry.getExportedInstances(type);
                  result.addAll(remoteInstances);
               }
            }
            return result;
         }
View Full Code Here

            ExportedInstance<T> result = null;
            for (Addon addon : tree)
            {
               if (addon.getStatus().isStarted())
               {
                  ServiceRegistry serviceRegistry = addon.getServiceRegistry();
                  result = serviceRegistry.getExportedInstance(type);
                  if (result != null)
                  {
                     break;
                  }
               }
View Full Code Here

            ExportedInstance<T> result = null;
            for (Addon addon : tree)
            {
               if (addon.getStatus().isStarted())
               {
                  ServiceRegistry serviceRegistry = addon.getServiceRegistry();
                  result = serviceRegistry.getExportedInstance(type);
                  if (result != null)
                  {
                     break;
                  }
               }
View Full Code Here

            Set<Class<?>> result = new HashSet<Class<?>>();
            for (Addon addon : tree)
            {
               if (AddonStatus.STARTED.equals(addon.getStatus()))
               {
                  ServiceRegistry serviceRegistry = addon.getServiceRegistry();
                  result.addAll(serviceRegistry.getExportedTypes());
               }
            }
            return result;
         }
      });
View Full Code Here

            Set<Class<T>> result = new HashSet<Class<T>>();
            for (Addon addon : tree)
            {
               if (AddonStatus.STARTED.equals(addon.getStatus()))
               {
                  ServiceRegistry serviceRegistry = addon.getServiceRegistry();
                  result.addAll(serviceRegistry.getExportedTypes(type));
               }
            }
            return result;
         }
      });
View Full Code Here

TOP

Related Classes of org.jboss.forge.furnace.services.ServiceRegistry

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.