public EhCacheFactoryBean() { setMaxEntriesLocalHeap(10000); setMaxEntriesLocalDisk(10000000); setTimeToLiveSeconds(120); setTimeToIdleSeconds(120); }
public EhCacheFactoryBean() { setMaxEntriesLocalHeap(10000); setMaxEntriesLocalDisk(10000000); setTimeToLiveSeconds(120); setTimeToIdleSeconds(120); }
cacheFb.setMaxEntriesLocalHeap(5); cacheFb.setTimeToLive(8); cacheFb.setTimeToIdle(7);
@SuppressWarnings("deprecation") public EhCacheFactoryBean() { setMaxEntriesLocalHeap(10000); setMaxElementsOnDisk(10000000); setTimeToLiveSeconds(120); setTimeToIdleSeconds(120); }
private Ehcache buildCache(final TicketDefinition ticketDefinition) { val cache = casProperties.getTicket().getRegistry().getEhcache(); val configExists = ResourceUtils.doesResourceExist(cache.getConfigLocation()); val ehcacheProperties = casProperties.getTicket().getRegistry().getEhcache(); val bean = new EhCacheFactoryBean(); bean.setCacheName(ticketDefinition.getProperties().getStorageName()); LOGGER.debug("Constructing Ehcache cache [{}]", bean.getName()); if (configExists) { bean.setCacheEventListeners(CollectionUtils.wrapSet(ticketRMISynchronousCacheReplicator())); bean.setBootstrapCacheLoader(ticketCacheBootstrapCacheLoader()); } else { LOGGER.warn("In registering ticket definition [{}], Ehcache configuration file [{}] cannot be found " + "so no cache event listeners will be configured to bootstrap. " + "The ticket registry will operate in standalone mode", ticketDefinition.getPrefix(), cache.getConfigLocation()); } bean.setTimeToIdle((int) ticketDefinition.getProperties().getStorageTimeout()); bean.setTimeToLive((int) ticketDefinition.getProperties().getStorageTimeout()); bean.setDiskExpiryThreadIntervalSeconds(ehcacheProperties.getDiskExpiryThreadIntervalSeconds()); bean.setEternal(ehcacheProperties.isEternal()); bean.setMaxEntriesLocalHeap(ehcacheProperties.getMaxElementsInMemory()); bean.setMaxEntriesInCache(ehcacheProperties.getMaxElementsInCache()); bean.setMaxEntriesLocalDisk(ehcacheProperties.getMaxElementsOnDisk()); bean.setMemoryStoreEvictionPolicy(ehcacheProperties.getMemoryStoreEvictionPolicy()); val c = new PersistenceConfiguration(); c.strategy(ehcacheProperties.getPersistence()); c.setSynchronousWrites(ehcacheProperties.isSynchronousWrites()); bean.persistence(c); bean.afterPropertiesSet(); return bean.getObject(); }