Examples of GlobalComponentRegistry


Examples of org.infinispan.factories.GlobalComponentRegistry

      }
      return createCacheWrapper(cache);
   }

   private CacheCommandFactory getCacheCommandFactory(AdvancedCache cache) {
      GlobalComponentRegistry globalCr = cache.getComponentRegistry()
            .getGlobalComponentRegistry();

      Map<Byte, ModuleCommandFactory> factories =
         (Map<Byte, ModuleCommandFactory>) globalCr
               .getComponent("org.infinispan.modules.command.factories");

      for (ModuleCommandFactory factory : factories.values()) {
         if (factory instanceof CacheCommandFactory)
            return (CacheCommandFactory) factory;
View Full Code Here

Examples of org.infinispan.factories.GlobalComponentRegistry

    * @param start                if true, the cache manager is started
    */
   public DefaultCacheManager(GlobalConfiguration globalConfiguration, Configuration defaultConfiguration, boolean start) {
      this.globalConfiguration = globalConfiguration == null ? new GlobalConfiguration() : globalConfiguration.clone();
      this.globalConfiguration.setDefaultConfiguration(defaultConfiguration == null ? new Configuration() : defaultConfiguration.clone());
      globalComponentRegistry = new GlobalComponentRegistry(this.globalConfiguration, this);
      if (start) start();
   }
View Full Code Here

Examples of org.infinispan.factories.GlobalComponentRegistry

   }

   private void initialize(XmlConfigurationParser initializedParser) {
      globalConfiguration = initializedParser.parseGlobalConfiguration();
      configurationOverrides.putAll(initializedParser.parseNamedConfigurations());
      globalComponentRegistry = new GlobalComponentRegistry(globalConfiguration, this);
   }
View Full Code Here

Examples of org.infinispan.factories.GlobalComponentRegistry

    */
   public DefaultCacheManager(GlobalConfiguration globalConfiguration, Configuration defaultConfiguration,
                              boolean start) {
      this.globalConfiguration = globalConfiguration == null ? new GlobalConfigurationBuilder().build() : globalConfiguration;
      this.defaultConfiguration = defaultConfiguration == null ? new ConfigurationBuilder().build() : defaultConfiguration;
      this.globalComponentRegistry = new GlobalComponentRegistry(this.globalConfiguration, this, caches.keySet());
      if (start)
         start();
   }
View Full Code Here

Examples of org.infinispan.factories.GlobalComponentRegistry

         for (Entry<String, ConfigurationBuilder> entry : holder.getNamedConfigurationBuilders().entrySet()) {
            org.infinispan.configuration.cache.Configuration c = entry.getValue().build();
            configurationOverrides.put(entry.getKey(), c);
         }

         globalComponentRegistry = new GlobalComponentRegistry(globalConfiguration, this, caches.keySet());
      } catch (CacheConfigurationException ce) {
         throw ce;
      } catch (RuntimeException re) {
         throw new CacheConfigurationException(re);
      }
View Full Code Here

Examples of org.infinispan.factories.GlobalComponentRegistry

         ConfigurationBuilderHolder namedConfigurationBuilderHolder = parserRegistry.parseFile(namedCacheFile);
         Entry<String, ConfigurationBuilder> entry = namedConfigurationBuilderHolder.getNamedConfigurationBuilders().entrySet().iterator().next();
         configurationOverrides.put(entry.getKey(), entry.getValue().build());
      }

      globalComponentRegistry = new GlobalComponentRegistry(this.globalConfiguration, this, caches.keySet());
      if (start)
         start();
   }
View Full Code Here

Examples of org.infinispan.factories.GlobalComponentRegistry

      String key = key(site);
      String val = val(site);

      cache(site, 0).put(key, val);
      Cache<Object,Object> backup = backup(site);
      final GlobalComponentRegistry gcr = backup.getAdvancedCache().getComponentRegistry().getGlobalComponentRegistry();

      assertTrue(backup.getName().contains("lonBackup"));
      assertEquals(backup.get(key), val);
      assertTrue(backup.getStatus().allowInvocations());

      backup.stop();
      eventually(new Condition() {
         @Override
         public boolean isSatisfied() throws Exception {
            BackupReceiverRepositoryImpl component = (BackupReceiverRepositoryImpl) gcr.getComponent(BackupReceiverRepository.class);
            return component.getBackupReceiver(site, EmbeddedCacheManager.DEFAULT_CACHE_NAME) == null;
         }
      });

      assertFalse(backup.getStatus().allowInvocations());
View Full Code Here

Examples of org.infinispan.factories.GlobalComponentRegistry

      if (component instanceof SearchFactoryIntegrator) { //could be the placeholder Object REMOVED_REGISTRY_COMPONENT
         searchFactory = (SearchFactoryIntegrator) component;
      }
      //defend against multiple initialization:
      if (searchFactory==null) {
         GlobalComponentRegistry globalComponentRegistry = cr.getGlobalComponentRegistry();
         EmbeddedCacheManager uninitializedCacheManager = globalComponentRegistry.getComponent(EmbeddedCacheManager.class);
         indexingProperties = addMappingsForRemoteQuery(indexingProperties, cr, cl);
         // Set up the search factory for Hibernate Search first.
         SearchConfiguration config = new SearchableCacheConfiguration(new Class[0], indexingProperties, uninitializedCacheManager, cr);
         searchFactory = new SearchFactoryBuilder().configuration(config).buildSearchFactory();
         cr.registerComponent(searchFactory, SearchFactoryIntegrator.class);
View Full Code Here

Examples of org.infinispan.factories.GlobalComponentRegistry

      StreamingMarshaller marshaller = cr.getComponent(StreamingMarshaller.class, KnownComponentNames.CACHE_MARSHALLER);
      return (AbstractDelegatingMarshaller) marshaller;
   }

   public static AbstractDelegatingMarshaller extractGlobalMarshaller(EmbeddedCacheManager cm) {
      GlobalComponentRegistry gcr = (GlobalComponentRegistry) extractField(cm, "globalComponentRegistry");
      return (AbstractDelegatingMarshaller)
            gcr.getComponent(StreamingMarshaller.class, KnownComponentNames.GLOBAL_MARSHALLER);
   }
View Full Code Here

Examples of org.infinispan.factories.GlobalComponentRegistry

      return (AbstractDelegatingMarshaller)
            gcr.getComponent(StreamingMarshaller.class, KnownComponentNames.GLOBAL_MARSHALLER);
   }

   public static ExternalizerTable extractExtTable(CacheContainer cacheContainer) {
      GlobalComponentRegistry gcr = (GlobalComponentRegistry) extractField(cacheContainer, "globalComponentRegistry");
      return gcr.getComponent(ExternalizerTable.class);
   }
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.