Package net.sf.ehcache.writer

Examples of net.sf.ehcache.writer.CacheWriter


    /**
     * {@inheritDoc}
     */
    public void put(Element element) throws CacheException {
        try {
            CacheWriter writer = cache.getRegisteredCacheWriter();
            if (writer != null) {
                writer.write(element);
            }
        } catch (RuntimeException e) {
            throw new CacheWriterManagerException(e);
        }
    }
View Full Code Here


    /**
     * {@inheritDoc}
     */
    public void remove(CacheEntry entry) throws CacheException {
        try {
            CacheWriter writer = cache.getRegisteredCacheWriter();
            if (writer != null) {
                writer.delete(entry);
            }
        } catch (RuntimeException e) {
            throw new CacheWriterManagerException(e);
        }
    }
View Full Code Here

     * @param cache              the cache
     */
    private static void registerCacheWriter(CacheConfiguration cacheConfiguration, Ehcache cache) {
        CacheWriterConfiguration config = cacheConfiguration.getCacheWriterConfiguration();
        if (config != null) {
            CacheWriter cacheWriter = createCacheWriter(config, cache);
            cache.registerCacheWriter(cacheWriter);
        }
    }
View Full Code Here

     *
     * @param config
     */
    private static CacheWriter createCacheWriter(CacheWriterConfiguration config, Ehcache cache) {
        String className = null;
        CacheWriter cacheWriter = null;
        CacheWriterConfiguration.CacheWriterFactoryConfiguration factoryConfiguration = config.getCacheWriterFactoryConfiguration();
        if (factoryConfiguration != null) {
            className = factoryConfiguration.getFullyQualifiedClassPath();
        }
        if (null == className) {
View Full Code Here

            cacheLoader.dispose();
        }
    }

    private void initialiseRegisteredCacheWriter() {
        CacheWriter writer = registeredCacheWriter;
        if (writer != null) {
            writer.init();
        }
    }
View Full Code Here

            writer.init();
        }
    }

    private void disposeRegisteredCacheWriter() {
        CacheWriter writer = registeredCacheWriter;
        if (writer != null) {
            writer.dispose();
        }
    }
View Full Code Here

            writeBehind = cache.getCacheManager().createTerracottaWriteBehind(cache);
        } else {
            writeBehind = new WriteBehindQueueManager(cache.getCacheConfiguration());
        }

        CacheWriter cacheWriter = cache.getRegisteredCacheWriter();
        if (null == cacheWriter) {
            throw new CacheException("No cache writer was registered for cache " + cache.getName());
        }

        if (cache.getCacheConfiguration().getCacheWriterConfiguration().getWriteCoalescing()) {
View Full Code Here

TOP

Related Classes of net.sf.ehcache.writer.CacheWriter

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.