Package net.sf.ehcache.config

Examples of net.sf.ehcache.config.CopyStrategyConfiguration


    private CacheConfiguration toEhcacheConfig(final String name, final Configuration configuration) {
        final int maxSize = cacheManager.getConfiguration().isMaxBytesLocalHeapSet() ? 0 : DEFAULT_SIZE;
        CacheConfiguration cfg = new CacheConfiguration(name, maxSize);
        cfg.setClassLoader(cacheManager.getConfiguration().getClassLoader());
        if(configuration.isStoreByValue()) {
            final CopyStrategyConfiguration copyStrategyConfiguration = new CopyStrategyConfiguration();
            copyStrategyConfiguration.setCopyStrategyInstance(new JCacheCopyOnWriteStrategy());
            cfg.copyOnRead(true).copyOnWrite(true)
                .addCopyStrategy(copyStrategyConfiguration);
        }
        if(configuration instanceof CompleteConfiguration) {
            if(((CompleteConfiguration)configuration).isWriteThrough()) {
View Full Code Here


    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("CorrectionToInstant")
                                                        .className("com.opengamma.master.cache.InstantExtractor"));
    cacheConfiguration.addSearchable(uidToDocumentCacheSearchable);

    // Make copies of cached objects
    CopyStrategyConfiguration copyStrategyConfiguration = new CopyStrategyConfiguration();
    copyStrategyConfiguration.setClass("com.opengamma.master.cache.JodaBeanCopyStrategy");
    cacheConfiguration.addCopyStrategy(copyStrategyConfiguration);
    cacheConfiguration.setCopyOnRead(true);
    cacheConfiguration.setCopyOnWrite(true);

    cacheConfiguration.setStatistics(true);
View Full Code Here

                .getCacheExceptionHandlerFactoryConfiguration();
        if (cacheExceptionHandlerFactoryConfiguration != null) {
            element.addChildElement(new FactoryConfigurationElement(element, "cacheExceptionHandlerFactory",
                    cacheExceptionHandlerFactoryConfiguration));
        }
        CopyStrategyConfiguration copyStrategyConfiguration = cacheConfiguration.getCopyStrategyConfiguration();
        if (copyStrategyConfiguration != null &&
                !copyStrategyConfiguration.equals(CacheConfiguration.DEFAULT_COPY_STRATEGY_CONFIGURATION)) {
            element.addChildElement(new CopyStrategyConfigurationElement(element, copyStrategyConfiguration));
        }
        ElementValueComparatorConfiguration elementValueComparatorConfiguration = cacheConfiguration
                .getElementValueComparatorConfiguration();
        if (elementValueComparatorConfiguration != null
View Full Code Here

TOP

Related Classes of net.sf.ehcache.config.CopyStrategyConfiguration

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.