Examples of FactoryConfiguration


Examples of net.sf.ehcache.config.FactoryConfiguration

      url = this.getClass().getResource( Environment.DEFAULT_CONFIG );
    }
    final Configuration configuration = ConfigurationFactory.parseConfiguration( url );
    if ( jtaPlatform != null ) {
      OgmTransactionManagerLookupDelegate.transactionManager = jtaPlatform.retrieveTransactionManager();
      final FactoryConfiguration transactionManagerLookupParameter = new FactoryConfiguration();
      transactionManagerLookupParameter.setClass( OgmTransactionManagerLookupDelegate.class.getName() );
      configuration.addTransactionManagerLookup( transactionManagerLookupParameter );
    }
    cacheManager = CacheManager.create( url );
  }
View Full Code Here

Examples of net.sf.ehcache.config.FactoryConfiguration

  @Override
  public void start() {
    final Configuration configuration = ConfigurationFactory.parseConfiguration( config.getUrl() );
    if ( jtaPlatform != null ) {
      OgmTransactionManagerLookupDelegate.transactionManager = jtaPlatform.retrieveTransactionManager();
      final FactoryConfiguration transactionManagerLookupParameter = new FactoryConfiguration();
      transactionManagerLookupParameter.setClass( OgmTransactionManagerLookupDelegate.class.getName() );
      configuration.addTransactionManagerLookup( transactionManagerLookupParameter );
    }
    cacheManager = CacheManager.create( config.getUrl() );

    entityCache = new Cache<SerializableKey>( cacheManager.getCache( DefaultDatastoreNames.ENTITY_STORE ) );
View Full Code Here

Examples of net.sf.ehcache.config.FactoryConfiguration

        // add the child elements
        DiskStoreConfiguration diskStoreConfiguration = configuration.getDiskStoreConfiguration();
        if (diskStoreConfiguration != null) {
            addChildElement(new DiskStoreConfigurationElement(this, diskStoreConfiguration));
        }
        FactoryConfiguration transactionManagerLookupConfiguration = configuration.getTransactionManagerLookupConfiguration();
        if (transactionManagerLookupConfiguration != null
                && !transactionManagerLookupConfiguration.equals(Configuration.DEFAULT_TRANSACTION_MANAGER_LOOKUP_CONFIG)) {
            addChildElement(new FactoryConfigurationElement(this, "transactionManagerLookup", transactionManagerLookupConfiguration));
        }
        FactoryConfiguration cacheManagerEventListenerFactoryConfiguration = configuration
                .getCacheManagerEventListenerFactoryConfiguration();
        if (cacheManagerEventListenerFactoryConfiguration != null) {
            addChildElement(new FactoryConfigurationElement(this, "cacheManagerEventListenerFactory",
                    cacheManagerEventListenerFactoryConfiguration));
        }
View Full Code Here

Examples of net.sf.ehcache.config.FactoryConfiguration

            LOG.warn("One or more caches require a DiskStore but there is no diskStore element configured."
                    + " Using the default disk store path of " + DiskStoreConfiguration.getDefaultPath()
                    + ". Please explicitly configure the diskStore element in ehcache.xml.");
        }

        FactoryConfiguration lookupConfiguration = configuration.getTransactionManagerLookupConfiguration();
        try {
            Properties properties = PropertyUtil.parseProperties(lookupConfiguration.getProperties(), lookupConfiguration
                    .getPropertySeparator());
            Class<TransactionManagerLookup> transactionManagerLookupClass = (Class<TransactionManagerLookup>) Class
                    .forName(lookupConfiguration.getFullyQualifiedClassPath());
            this.transactionManagerLookup = transactionManagerLookupClass.newInstance();
            this.transactionManagerLookup.setProperties(properties);
        } catch (Exception e) {
            LOG.error("could not instantiate transaction manager lookup class: {}", lookupConfiguration.getFullyQualifiedClassPath(), e);
        }

        detectAndFixDiskStorePathConflict(configurationHelper);

        cacheManagerEventListenerRegistry.registerListener(configurationHelper.createCacheManagerEventListener());
View Full Code Here

Examples of org.apache.velocity.tools.config.FactoryConfiguration

    }


    protected void configure(final ServletConfig config, final ToolboxFactory factory)
    {
        FactoryConfiguration factoryConfig = new FactoryConfiguration();

        boolean hasOldToolbox = false;
        if (this.deprecationSupportMode)
        {
            FactoryConfiguration oldToolbox = getDeprecatedConfig(config);
            if (oldToolbox != null)
            {
                hasOldToolbox = true;
                factoryConfig.addConfiguration(oldToolbox);
            }
View Full Code Here

Examples of org.apache.velocity.tools.config.FactoryConfiguration

    protected FactoryConfiguration getDeprecatedConfig(ServletConfig config)
    {
        // check for deprecated user configuration at the old conventional
        // location.  be silent if missing, log deprecation warning otherwise
        String oldPath = DEPRECATED_USER_TOOLS_PATH;
        FactoryConfiguration toolbox = getConfiguration(oldPath);
        if (toolbox == null)
        {
            // look for an alternate path under the deprecated toolbox key
            oldPath = findInitParameter(DEPRECATED_TOOLS_KEY, config);
            if (oldPath != null)
View Full Code Here

Examples of org.apache.velocity.tools.config.FactoryConfiguration

        }

        // this will throw an exception if require is true and there
        // is no tool config at the path.  if require is false, this
        // will return null when there's no tool config at the path
        FactoryConfiguration config = getConfiguration(path, require);
        if (config == null)
        {
            return false;
        }
View Full Code Here

Examples of org.apache.velocity.tools.config.FactoryConfiguration

        }
    }

    public void autoConfigure(boolean includeDefaults)
    {
        FactoryConfiguration config =
            ConfigurationUtils.getAutoLoaded(includeDefaults);

        // look for any specified via system property
        FactoryConfiguration sys = ConfigurationUtils.findFromSystemProperty();
        if (sys != null)
        {
            config.addConfiguration(sys);
        }
        configure(config);
View Full Code Here

Examples of org.apache.velocity.tools.config.FactoryConfiguration

        this.factory.configure(config);
    }

    public void configure(String path)
    {
        FactoryConfiguration config = findConfig(path);
        if (config != null)
        {
            configure(config);
        }
        else
View Full Code Here

Examples of org.apache.velocity.tools.config.FactoryConfiguration

     * {@code org.apache.velocity.tools.cleanConfiguration} init-param to true in
     * either your servlet or servletContext init-params.
     */
    protected void configure(final ServletConfig config, final ToolboxFactory factory)
    {
        FactoryConfiguration factoryConfig = new FactoryConfiguration();

        boolean hasOldToolbox = false;
        if (this.deprecationSupportMode)
        {
            FactoryConfiguration oldToolbox = getDeprecatedConfig(config);
            if (oldToolbox != null)
            {
                hasOldToolbox = true;
                factoryConfig.addConfiguration(oldToolbox);
            }
        }

        // only load the default tools if they have explicitly said to
        // or if they are not using an old toolbox and have said nothing
        String loadDefaults = findInitParameter(LOAD_DEFAULTS_KEY, config);
        if ((!hasOldToolbox && loadDefaults == null) ||
            "true".equalsIgnoreCase(loadDefaults))
        {
            // add all available default tools
            getLog().trace("Loading default tools configuration...");
            factoryConfig.addConfiguration(ConfigurationUtils.getDefaultTools());
        }
        else
        {
            // let the user know that the defaults were suppressed
            getLog().debug("Default tools configuration has been suppressed"
                           + (hasOldToolbox ?
                              " to avoid conflicts with older application's context and toolbox definition."
                              : "."));
        }

        // this gets the auto loaded config from the classpath
        // this doesn't include defaults since they're handled already
        // and it could theoretically pick up an auto-loaded config from the
        // filesystem, but that is highly unlikely to happen in a webapp env
        FactoryConfiguration autoLoaded = ConfigurationUtils.getAutoLoaded(false);
        factoryConfig.addConfiguration(autoLoaded);

        // check for application-wide user config in the context init params
        String appToolsPath = servletContext.getInitParameter(TOOLS_KEY);
        setConfig(factoryConfig, appToolsPath, true);
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.