Java 类net.sf.ehcache.bootstrap.BootstrapCacheLoader 实例源码

项目:concourseconnect-community    文件:CacheUtils.java   
public static Ehcache createInMemoryCache(String cacheName, CacheEntryFactory entryFactory, int maxElements) {
  CacheManager manager = CacheManager.getInstance();
  Ehcache cache = getCache(cacheName);
  if (cache == null) {
    // Create the cache
    cache = new Cache(cacheName,
        maxElements,
        memoryStoreEvictionPolicy, overflowToDisk,
        diskStorePath, eternal, timeToLive,
        timeToIdle, diskPersistent,
        diskExpiryThreadIntervalSeconds, null);
    // Associate the cacheEntryFactory with the cache
    SelfPopulatingCache selfPopulatingCache = new SelfPopulatingCache(cache,
        entryFactory);
    // Add any additional listener properties
    if (manager.getCachePeerListener("RMI") != null) {
      LOG.info("Setting RMI properties");
      Properties properties = new Properties();
      properties.put("replicateAsynchronously", "true");
      properties.put("replicatePuts", "false");
      properties.put("replicateUpdates", "true");
      properties.put("replicateRemovals", "true");
      properties.put("replicateUpdatesViaCopy", "false");
      properties.put("asynchronousReplicationIntervalMillis", "1000");
      RMICacheReplicatorFactory factory = new RMICacheReplicatorFactory();
      CacheEventListener listener = factory.createCacheEventListener(properties);
      selfPopulatingCache.getCacheEventNotificationService().registerListener(listener);
      RMIBootstrapCacheLoaderFactory bootstrapFactory = new RMIBootstrapCacheLoaderFactory();
      BootstrapCacheLoader bootstrapCacheLoader = bootstrapFactory.createBootstrapCacheLoader(new Properties());
      selfPopulatingCache.setBootstrapCacheLoader(bootstrapCacheLoader);
      LOG.debug("RMI enabled");
    }
    // Make the cache available
    manager.addCache(selfPopulatingCache);
    LOG.info("cache created: " + cache.getName());
  }
  return cache;
}
项目:ehcache-extensions    文件:CacheFailoverDecorator.java   
@Override
public final void setBootstrapCacheLoader(
        BootstrapCacheLoader bootstrapCacheLoader) throws CacheException {
    throw new UnsupportedOperationException("Cache is read-only...operation not supported");
}
项目:ehcache-extensions    文件:EhcacheDelegateAdapter.java   
@Override
public BootstrapCacheLoader getBootstrapCacheLoader() {
    init();
    return super.getBootstrapCacheLoader();
}
项目:ehcache-extensions    文件:EhcacheDelegateAdapter.java   
@Override
public void setBootstrapCacheLoader(
        BootstrapCacheLoader bootstrapCacheLoader) throws CacheException {
    init();
    super.setBootstrapCacheLoader(bootstrapCacheLoader);
}
项目:ehcache-extensions    文件:EhcacheDelegatedDecoratorAdapter.java   
@Override
public BootstrapCacheLoader getBootstrapCacheLoader() {
    init();
    return super.getBootstrapCacheLoader();
}
项目:ehcache-extensions    文件:EhcacheDelegatedDecoratorAdapter.java   
@Override
public void setBootstrapCacheLoader(
        BootstrapCacheLoader bootstrapCacheLoader) throws CacheException {
    init();
    super.setBootstrapCacheLoader(bootstrapCacheLoader);
}
项目:ehcache-extensions    文件:CachePartitionDecorator.java   
@Override
public final void setBootstrapCacheLoader(
        BootstrapCacheLoader bootstrapCacheLoader) throws CacheException {
    throw new UnsupportedOperationException("Cache is read-only...operation not supported");
}
项目:lams    文件:EhCacheFactoryBean.java   
/**
 * Set an EhCache {@link net.sf.ehcache.bootstrap.BootstrapCacheLoader}
 * for this cache, if any.
 */
public void setBootstrapCacheLoader(BootstrapCacheLoader bootstrapCacheLoader) {
    this.bootstrapCacheLoader = bootstrapCacheLoader;
}
项目:spring4-understanding    文件:EhCacheFactoryBean.java   
/**
 * Set an EhCache {@link net.sf.ehcache.bootstrap.BootstrapCacheLoader}
 * for this cache, if any.
 */
public void setBootstrapCacheLoader(BootstrapCacheLoader bootstrapCacheLoader) {
    this.bootstrapCacheLoader = bootstrapCacheLoader;
}
项目:sakai    文件:EhCacheFactoryBean.java   
/**
 * Set an EHCache {@link net.sf.ehcache.bootstrap.BootstrapCacheLoader}
 * for this cache, if any.
 */
public void setBootstrapCacheLoader(BootstrapCacheLoader bootstrapCacheLoader) {
    this.bootstrapCacheLoader = bootstrapCacheLoader;
}
项目:class-guard    文件:EhCacheFactoryBean.java   
/**
 * Set an EhCache {@link net.sf.ehcache.bootstrap.BootstrapCacheLoader}
 * for this cache, if any.
 */
public void setBootstrapCacheLoader(BootstrapCacheLoader bootstrapCacheLoader) {
    this.bootstrapCacheLoader = bootstrapCacheLoader;
}
项目:sakai    文件:EhCacheFactoryBean.java   
/**
 * Set an EHCache {@link net.sf.ehcache.bootstrap.BootstrapCacheLoader}
 * for this cache, if any.
 */
public void setBootstrapCacheLoader(BootstrapCacheLoader bootstrapCacheLoader) {
    this.bootstrapCacheLoader = bootstrapCacheLoader;
}