Package org.infinispan.configuration.parsing

Examples of org.infinispan.configuration.parsing.ParserRegistry


    * @param start               if true, the cache manager is started
    *
    * @throws java.io.IOException if there is a problem reading the configuration stream
    */
   public DefaultCacheManager(InputStream configurationStream, boolean start) throws IOException {
      this(new ParserRegistry(Thread.currentThread().getContextClassLoader()).parse(configurationStream), start);
   }
View Full Code Here


    * @throws java.io.IOException if there is a problem with the configuration file.
    */
   @Deprecated
   public DefaultCacheManager(String globalConfigurationFile, String defaultConfigurationFile, String namedCacheFile,
                              boolean start) throws IOException {
      ParserRegistry parserRegistry = new ParserRegistry(Thread.currentThread().getContextClassLoader());

      ConfigurationBuilderHolder globalConfigurationBuilderHolder = parserRegistry.parseFile(globalConfigurationFile);
      ConfigurationBuilderHolder defaultConfigurationBuilderHolder = parserRegistry.parseFile(defaultConfigurationFile);

      globalConfiguration = globalConfigurationBuilderHolder.getGlobalConfigurationBuilder().build();
      defaultConfiguration = defaultConfigurationBuilderHolder.getDefaultConfigurationBuilder().build();

      if (namedCacheFile != null) {
         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());
View Full Code Here

                    configStream = SCAActivator.class.getClassLoader().getResourceAsStream(cacheConfig);
                }

                ClassLoader cacheClassLoader = DefaultCacheManager.class.getClassLoader();
                Thread.currentThread().setContextClassLoader(cacheClassLoader);
                ConfigurationBuilderHolder holder = new ParserRegistry(cacheClassLoader).parse(configStream);
                if (jgroupsConfig != null) {
                    holder.getGlobalConfigurationBuilder()
                          .transport()
                          .defaultTransport()
                          .addProperty("configurationFile", jgroupsConfig);
View Full Code Here

  private final ParserRegistry configurationParser;
  private final ClassLoader ispnClassLoadr;

  public InfinispanConfigurationParser() {
    ispnClassLoadr = ParserRegistry.class.getClassLoader();
    configurationParser = new ParserRegistry( ispnClassLoadr );
  }
View Full Code Here

        // In some environments (ex: OSGi), hibernate-infinispan may not
        // be in the app CL.  It's important to also try this CL.
        classLoader = this.getClass().getClassLoader();
        is = FileLookupFactory.newInstance().lookupFileStrict( configLoc, classLoader );
      }
      final ParserRegistry parserRegistry = new ParserRegistry( classLoader );
      final ConfigurationBuilderHolder holder = parserRegistry.parse( is );

      // Override global jmx statistics exposure
      final String globalStats = extractProperty( INFINISPAN_GLOBAL_STATISTICS_PROP, properties );
      if ( globalStats != null ) {
        holder.getGlobalConfigurationBuilder().globalJmxStatistics()
View Full Code Here

  public InfinispanConfigurationParser(ClassLoader searchConfigClassloader) {
    this.searchConfigClassloader = searchConfigClassloader;
    //The parser itself loads extensions from the Infinispan modules so
    //needs to be pointed to the Infinispan module.
    ClassLoader ispnClassLoadr = ParserRegistry.class.getClassLoader();
    configurationParser = new ParserRegistry( ispnClassLoadr );
    this.userDeploymentClassloader = Thread.currentThread().getContextClassLoader();
  }
View Full Code Here

         String configLoc = ConfigurationHelper.getString(
               INFINISPAN_CONFIG_RESOURCE_PROP, properties, DEF_INFINISPAN_CONFIG_RESOURCE);
         ClassLoader classLoader = ClassLoaderHelper.getContextClassLoader();
         InputStream is = FileLookupFactory.newInstance().lookupFileStrict(
               configLoc, classLoader);
         ParserRegistry parserRegistry = new ParserRegistry(classLoader);
         ConfigurationBuilderHolder holder = parserRegistry.parse(is);

         // Override global jmx statistics exposure
         String globalStats = extractProperty(
               INFINISPAN_GLOBAL_STATISTICS_PROP, properties);
         if (globalStats != null)
View Full Code Here

    private static ConfigurationBuilderHolder load(String resource) {
        URL url = find(resource, CacheAdd.class.getClassLoader());
        log.debugf("Loading Infinispan defaults from %s", url.toString());
        try {
            InputStream input = url.openStream();
            ParserRegistry parser = new ParserRegistry(InfinispanExtension.class.getClassLoader());
            try {
                return parser.parse(input);
            } finally {
                try {
                    input.close();
                } catch (IOException e) {
                    log.warn(e.getLocalizedMessage(), e);
View Full Code Here

   @Override
   protected ConfigurationBuilderHolder createConfiguration(String configFile) throws FileNotFoundException {
      ClassLoader classLoader = getClass().getClassLoader();
      InputStream input = new FileLookup().lookupFileStrict(configFile, classLoader);
      return new ParserRegistry(classLoader).parse(input);
   }
View Full Code Here

   }

   @Override
   protected ConfigurationBuilderHolder createConfiguration(String configFile) throws FileNotFoundException {
      InputStream input = FileLookupFactory.newInstance().lookupFileStrict(configFile, Thread.currentThread().getContextClassLoader());
      return new ParserRegistry(Thread.currentThread().getContextClassLoader()).parse(input);
   }
View Full Code Here

TOP

Related Classes of org.infinispan.configuration.parsing.ParserRegistry

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.