target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testInitialiseFailures() { final String name = "testInitialiseFailures2"; Cache cache = new Cache(name, 1, false, false, 5, 1); manager.addCache(cache); try { cache.initialise(); fail("Calling cache.initialise() multiple times should fail with IllegalStateException"); } catch (IllegalStateException e)...
public void initialise() { synchronized (this) { final ClassLoader loader = getCacheConfiguration().getClassLoader(); if (loader != cacheManager.getConfiguration().getClassLoader()) { if (!getName().startsWith(CacheManager.LOCAL_CACHE_NAME_PREFIX)) { throw new CacheException("This cache (" + getName() + ") is configura...
Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { final ClassLoader loader = getCacheConfiguration().getClassLoader(); if (loader != cacheManager.getConfiguration().getClassLoader()) { if (!getName().startsWith(CacheManager.LOCAL_CACHE_NAME_PREFIX)) { throw new CacheExce...
Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { final ClassLoader loader = getCacheConfiguration().getClassLoader(); if (loader != cacheManager.getConfiguration().getClassLoader()) { if (!getName().startsWith(CacheManager.LOCAL_CACHE_NAME_PREFIX)) { throw new CacheExce...
Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { final ClassLoader loader = getCacheConfiguration().getClassLoader(); if (loader != cacheManager.getConfiguration().getClassLoader()) { if (!getName().startsWith(CacheManager.LOCAL_CACHE_NAME_PREFIX)) { throw new CacheExce...
Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { final ClassLoader loader = getCacheConfiguration().getClassLoader(); if (loader != cacheManager.getConfiguration().getClassLoader()) { if (!getName().startsWith(CacheManager.LOCAL_CACHE_NAME_PREFIX)) { throw new CacheExce...
@Test(expected = IllegalStateException.class) public void testNameIsNotDynamicallyChangeable() { Configuration configuration = new Configuration().name("ChangeMe"); try { configuration.setName("cantChangeThis!"); } catch (IllegalStateException e) { fail(); } CacheManager cm = new CacheManager(configuration); try { conf...
public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedException ie) { Thr...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
@Test public void testProgrammaticConfigurationWorksProperlyWhenNoDefaultCacheConfigured() { Configuration mgrConfig = new Configuration(); mgrConfig.setUpdateCheck(false); new CacheManager(mgrConfig).shutdown(); }
public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedException ie) { Thr...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
@Test public void testForCacheManagerThreadLeak() throws CacheException, InterruptedException { final Set<Thread> initialThreads = Collections.unmodifiableSet(Thread.getAllStackTraces().keySet()); Configuration config = new Configuration(); config.diskStore(new DiskStoreConfiguration().path("${java.io.tmpdir}/CacheMana...
public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedException ie) { Thr...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
@Test public void testMultipleCacheManagers() { CacheManager managerOne = new CacheManager(makeCacheManagerConfig("cm1")); try { new CacheManager(makeCacheManagerConfig("cm2")).shutdown(); } finally { managerOne.shutdown(); } }
public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedException ie) { Thr...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) { localTransactionsRecoveryThread.interrupt(); try { localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT); } catch (InterruptedExce...
@Test public void testClusterRejoined() { Toolkit toolkit = getMockToolkit(); ClusteredEntityManager entityManager = mock(ClusteredEntityManager.class); ClusteredCacheManager cmEntity = mock(ClusteredCacheManager.class); ClusteredCache cEntity = mock(ClusteredCache.class); when(cmEntity.getCache(CACHE_NAME)).thenReturn...
@Override public void clusterRejoined() { String cacheManagerName = entityNames.cacheManagerName; synchronized (entityNames) { ClusteredCacheManager clusteredCacheManager = clusteredEntityManager.getRootEntity(cacheManagerName, ClusteredCacheManager.class); if (clusteredCacheManager == null) { LOGGER.error("Cache Manag...
ToolkitInstanceFactoryImpl implements ToolkitInstanceFactory { @Override public void clusterRejoined() { String cacheManagerName = entityNames.cacheManagerName; synchronized (entityNames) { ClusteredCacheManager clusteredCacheManager = clusteredEntityManager.getRootEntity(cacheManagerName, ClusteredCacheManager.class);...
ToolkitInstanceFactoryImpl implements ToolkitInstanceFactory { @Override public void clusterRejoined() { String cacheManagerName = entityNames.cacheManagerName; synchronized (entityNames) { ClusteredCacheManager clusteredCacheManager = clusteredEntityManager.getRootEntity(cacheManagerName, ClusteredCacheManager.class);...
ToolkitInstanceFactoryImpl implements ToolkitInstanceFactory { @Override public void clusterRejoined() { String cacheManagerName = entityNames.cacheManagerName; synchronized (entityNames) { ClusteredCacheManager clusteredCacheManager = clusteredEntityManager.getRootEntity(cacheManagerName, ClusteredCacheManager.class);...
ToolkitInstanceFactoryImpl implements ToolkitInstanceFactory { @Override public void clusterRejoined() { String cacheManagerName = entityNames.cacheManagerName; synchronized (entityNames) { ClusteredCacheManager clusteredCacheManager = clusteredEntityManager.getRootEntity(cacheManagerName, ClusteredCacheManager.class);...
@SuppressWarnings("unchecked") @Test public void testPassesConcurrencyToAsyncCoordinatorOnStart() { asyncWriteBehind.start(null); verify(asyncCoordinator).start(any(CacheWriterProcessor.class), eq(CONCURRENCY), any(ItemScatterPolicy.class)); }
@Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); }
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } }
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); }
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); @Override void start(CacheWriter writer); @Override vo...
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); @Override void start(CacheWriter writer); @Override vo...
@Test public void testPassesItemScatterPolicyToAsyncCoordinatorOnStart() { asyncWriteBehind.start(null); verify(asyncCoordinator).start(any(CacheWriterProcessor.class), eq(CONCURRENCY), same(AsyncWriteBehind.POLICY)); }
@Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); }
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } }
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); }
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); @Override void start(CacheWriter writer); @Override vo...
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); @Override void start(CacheWriter writer); @Override vo...
@Test public void testClearCacheDisablesNonStop() throws Exception { repositoryService.clearCache("testCacheManager", "testCache1"); verify(clusteredInstanceFactory, times(2)).enableNonStopForCurrentThread(anyBoolean()); }
@Override public void clearCache(String cacheManagerName, String cacheName) { cacheManagerSamplerRepoLock.readLock().lock(); SamplerRepoEntry entry = cacheManagerSamplerRepo.get(cacheManagerName); try { enableNonStopFor(entry, false); if (entry != null) { entry.clearCache(cacheName); } } finally { enableNonStopFor(entr...
DfltSamplerRepositoryService implements ManagementServerLifecycle, EntityResourceFactory, CacheManagerService, CacheService, AgentService { @Override public void clearCache(String cacheManagerName, String cacheName) { cacheManagerSamplerRepoLock.readLock().lock(); SamplerRepoEntry entry = cacheManagerSamplerRepo.ge...
DfltSamplerRepositoryService implements ManagementServerLifecycle, EntityResourceFactory, CacheManagerService, CacheService, AgentService { @Override public void clearCache(String cacheManagerName, String cacheName) { cacheManagerSamplerRepoLock.readLock().lock(); SamplerRepoEntry entry = cacheManagerSamplerRepo.ge...
DfltSamplerRepositoryService implements ManagementServerLifecycle, EntityResourceFactory, CacheManagerService, CacheService, AgentService { @Override public void clearCache(String cacheManagerName, String cacheName) { cacheManagerSamplerRepoLock.readLock().lock(); SamplerRepoEntry entry = cacheManagerSamplerRepo.ge...
DfltSamplerRepositoryService implements ManagementServerLifecycle, EntityResourceFactory, CacheManagerService, CacheService, AgentService { @Override public void clearCache(String cacheManagerName, String cacheName) { cacheManagerSamplerRepoLock.readLock().lock(); SamplerRepoEntry entry = cacheManagerSamplerRepo.ge...
@Test public void testMultipleCacheManagers() throws Exception { ManagementService.registerMBeans(manager, mBeanServer, true, true, true, true, true); assertEquals(OBJECTS_IN_TEST_EHCACHE, mBeanServer.queryNames(new ObjectName("net.sf.ehcache:*"), null).size()); File file = new File(AbstractCacheTest.SRC_CONFIG_DIR + "...
public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics, boolean registerCacheStores) throws CacheException { ManagementService registry = new Manageme...
ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics, boolean registerCacheStores) throws C...
ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics, boolean registerCacheStores) throws C...
ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics, boolean registerCacheStores) throws C...
ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics, boolean registerCacheStores) throws C...
@Test public void testStatisticsMBeanUpdatesAsStatsChange() throws Exception { ManagementService.registerMBeans(manager, mBeanServer, false, false, false, true, false); Ehcache cache = manager.getCache("sampleCache1"); ObjectName name = CacheStatistics.createObjectName(manager.getName(), cache.getName()); assertEquals(...
public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics, boolean registerCacheStores) throws CacheException { ManagementService registry = new Manageme...
ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics, boolean registerCacheStores) throws C...
ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics, boolean registerCacheStores) throws C...
ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics, boolean registerCacheStores) throws C...
ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics, boolean registerCacheStores) throws C...
@Test public void testOperatesOnDedicatedThread() throws ParseException, IOException { final RotatingSnapshotFile rotatingSnapshotFile = mock(RotatingSnapshotFile.class); final TerracottaStore mock = mock(TerracottaStore.class); KeySnapshotter snapshotter = new KeySnapshotter(createFakeTcClusteredCache(mock), 10, true,...
void dispose(boolean immediately) { if (thread != null) { rotatingWriter.setShutdownOnThreadInterrupted(immediately); thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }
KeySnapshotter implements Runnable { void dispose(boolean immediately) { if (thread != null) { rotatingWriter.setShutdownOnThreadInterrupted(immediately); thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } }
KeySnapshotter implements Runnable { void dispose(boolean immediately) { if (thread != null) { rotatingWriter.setShutdownOnThreadInterrupted(immediately); thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } KeySnapshotter(final Ehcache cache, final long ...
KeySnapshotter implements Runnable { void dispose(boolean immediately) { if (thread != null) { rotatingWriter.setShutdownOnThreadInterrupted(immediately); thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } KeySnapshotter(final Ehcache cache, final long ...
KeySnapshotter implements Runnable { void dispose(boolean immediately) { if (thread != null) { rotatingWriter.setShutdownOnThreadInterrupted(immediately); thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } KeySnapshotter(final Ehcache cache, final long ...
@Test public void testDisposesProperlyImmediately() throws BrokenBarrierException, InterruptedException, IOException { deleteFolder(new File(DUMPS_DIRECTORY)); final RotatingSnapshotFile rotatingSnapshotFile = new RotatingSnapshotFile(DUMPS_DIRECTORY, "testingInterruptImmediate"); final TerracottaStore mockedTcStore = ...
void dispose(boolean immediately) { if (thread != null) { rotatingWriter.setShutdownOnThreadInterrupted(immediately); thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }
KeySnapshotter implements Runnable { void dispose(boolean immediately) { if (thread != null) { rotatingWriter.setShutdownOnThreadInterrupted(immediately); thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } }
KeySnapshotter implements Runnable { void dispose(boolean immediately) { if (thread != null) { rotatingWriter.setShutdownOnThreadInterrupted(immediately); thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } KeySnapshotter(final Ehcache cache, final long ...
KeySnapshotter implements Runnable { void dispose(boolean immediately) { if (thread != null) { rotatingWriter.setShutdownOnThreadInterrupted(immediately); thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } KeySnapshotter(final Ehcache cache, final long ...
KeySnapshotter implements Runnable { void dispose(boolean immediately) { if (thread != null) { rotatingWriter.setShutdownOnThreadInterrupted(immediately); thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } KeySnapshotter(final Ehcache cache, final long ...
@Test public void testDisposesProperlyButFinishes() throws BrokenBarrierException, InterruptedException, IOException { deleteFolder(new File(DUMPS_DIRECTORY)); final RotatingSnapshotFile rotatingSnapshotFile = new RotatingSnapshotFile(DUMPS_DIRECTORY, "testingInterruptFinishes"); final TerracottaStore mockedTcStore = m...
void dispose(boolean immediately) { if (thread != null) { rotatingWriter.setShutdownOnThreadInterrupted(immediately); thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }
KeySnapshotter implements Runnable { void dispose(boolean immediately) { if (thread != null) { rotatingWriter.setShutdownOnThreadInterrupted(immediately); thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } }
KeySnapshotter implements Runnable { void dispose(boolean immediately) { if (thread != null) { rotatingWriter.setShutdownOnThreadInterrupted(immediately); thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } KeySnapshotter(final Ehcache cache, final long ...
KeySnapshotter implements Runnable { void dispose(boolean immediately) { if (thread != null) { rotatingWriter.setShutdownOnThreadInterrupted(immediately); thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } KeySnapshotter(final Ehcache cache, final long ...
KeySnapshotter implements Runnable { void dispose(boolean immediately) { if (thread != null) { rotatingWriter.setShutdownOnThreadInterrupted(immediately); thread.interrupt(); try { thread.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } KeySnapshotter(final Ehcache cache, final long ...
@Test public void testComplainsOnNonTcClusteredCacheButDoesNotFail() { cacheLoader.load(new Cache(new CacheConfiguration("test", 0))); }
public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader! Cache " + "'{}' will not be bootstrapped and no keySet snapshot will be recorded...", ...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
@Test(expected = CacheException.class) public void testFailsWhenCacheIsNotAlive() { cacheLoader.load(new Cache(new CacheConfiguration("test", 0).terracotta(new TerracottaConfiguration()))); }
public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader! Cache " + "'{}' will not be bootstrapped and no keySet snapshot will be recorded...", ...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
@Test public void testBootstrapsWhenNoSnapshotPresent() { final Ehcache cache = mockCacheToBootStrap(); cacheLoader.load(cache); verify(cache, never()).get(Matchers.anyObject()); }
public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader! Cache " + "'{}' will not be bootstrapped and no keySet snapshot will be recorded...", ...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
@Test public void testBootstrapsWhenSnapshotPresent() throws IOException { RotatingSnapshotFile file = new RotatingSnapshotFile(DIRECTORY, MOCKED_CACHE_NAME); final List<Integer> localKeys = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9); file.writeAll(localKeys); final Ehcache cache = mockCacheToBootStrap(); cacheLoad...
public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader! Cache " + "'{}' will not be bootstrapped and no keySet snapshot will be recorded...", ...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
TerracottaBootstrapCacheLoader extends MemoryLimitedCacheLoader implements Disposable { public void load(final Ehcache cache) throws CacheException { if (!cache.getCacheConfiguration().isTerracottaClustered()) { LOG.error("You're trying to bootstrap a non Terracotta clustered cache with a TerracottaBootstrapCacheLoader...
@Override @Test public void testGetWithLoader() { super.testGetWithLoader(); }
@Override public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { throw new CacheException("This method is not appropriate for a Blocking Cache"); }
BlockingCache extends EhcacheDecoratorAdapter { @Override public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { throw new CacheException("This method is not appropriate for a Blocking Cache"); } }
BlockingCache extends EhcacheDecoratorAdapter { @Override public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { throw new CacheException("This method is not appropriate for a Blocking Cache"); } BlockingCache(final Ehcache cache, int numberOfStripes); BlockingCache...
BlockingCache extends EhcacheDecoratorAdapter { @Override public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { throw new CacheException("This method is not appropriate for a Blocking Cache"); } BlockingCache(final Ehcache cache, int numberOfStripes); BlockingCache...
BlockingCache extends EhcacheDecoratorAdapter { @Override public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { throw new CacheException("This method is not appropriate for a Blocking Cache"); } BlockingCache(final Ehcache cache, int numberOfStripes); BlockingCache...
@Test public void testLoadConfigurationFromClasspath() throws Exception { Configuration configuration = ConfigurationFactory.parseConfiguration(); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals(null, configurationHelper.getConfigurationBean().getName()); assertEq...
public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
@Test public void testLoadConfigurationFromFileNoCacheManagerListenerDefault() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-nolisteners.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, con...
public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
@Test public void testLoadConfigurationFromFileUnloadableCacheManagerListenerDefault() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-unloadablecachemanagerlistenerclass.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ...
public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
@Test public void testLoadConfigurationFromFileCountingCacheListener() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-countinglisteners.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, confi...
public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
@Test public void testEmptyPeerListManualDistributedConfiguration() { Configuration config = ConfigurationFactory.parseConfiguration( new File(TEST_CONFIG_DIR + "distribution/ehcache-manual-distributed3.xml")).name("new-name"); CacheManager cacheManager = new CacheManager(config); assertEquals(0, cacheManager.getCacheM...
public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
@Test public void testPassesWrappedWriterToAsyncCoordinatorOnStart() { final CacheWriter writer = mock(CacheWriter.class); asyncWriteBehind.start(writer); ArgumentCaptor<CacheWriterProcessor> captor = ArgumentCaptor.forClass(CacheWriterProcessor.class); verify(asyncCoordinator).start(captor.capture(), eq(CONCURRENCY), ...
@Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); }
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } }
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); }
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); @Override void start(CacheWriter writer); @Override vo...
AsyncWriteBehind implements WriteBehind { @Override public void start(CacheWriter writer) throws CacheException { async.start(new CacheWriterProcessor(writer), concurrency, POLICY); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); @Override void start(CacheWriter writer); @Override vo...
@Test public void testCopyConfiguration() { File file = new File(TEST_CONFIG_DIR + "ehcache-copy.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); Ehcache copyOnReadCache = configurationHelper.cr...
public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
@Test public void testElementValueComparatorConfiguration() { File file = new File(TEST_CONFIG_DIR + "ehcache-comparator.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); Ehcache cache = configur...
public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
@Test public void testDiskStorePath() { String name = "testTemp"; String path = "c:\\something\\temp"; CacheConfiguration cacheConfiguration = new CacheConfiguration(name, 0) .diskStorePath(path) .diskPersistent(true); cacheManager.addCache(new Cache(cacheConfiguration)); Cache cache = cacheManager.getCache(name); asse...
public final CacheConfiguration diskStorePath(String diskStorePath) { setDiskStorePath(diskStorePath); return this; }
CacheConfiguration implements Cloneable { public final CacheConfiguration diskStorePath(String diskStorePath) { setDiskStorePath(diskStorePath); return this; } }
CacheConfiguration implements Cloneable { public final CacheConfiguration diskStorePath(String diskStorePath) { setDiskStorePath(diskStorePath); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxEntriesLocalHeap); }
CacheConfiguration implements Cloneable { public final CacheConfiguration diskStorePath(String diskStorePath) { setDiskStorePath(diskStorePath); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxEntriesLocalHeap); @Override CacheConfiguration clone(); final void setName(String name); final Ca...
CacheConfiguration implements Cloneable { public final CacheConfiguration diskStorePath(String diskStorePath) { setDiskStorePath(diskStorePath); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxEntriesLocalHeap); @Override CacheConfiguration clone(); final void setName(String name); final Ca...
@Test public void testTransactionalMode() { CacheConfiguration configuration = new CacheConfiguration(); assertEquals(CacheConfiguration.TransactionalMode.OFF, configuration.getTransactionalMode()); try { configuration.setTransactionalMode(null); fail("expected IllegalArgumentException"); } catch (IllegalArgumentExcept...
public final CacheConfiguration transactionalMode(String transactionalMode) { setTransactionalMode(transactionalMode); return this; }
CacheConfiguration implements Cloneable { public final CacheConfiguration transactionalMode(String transactionalMode) { setTransactionalMode(transactionalMode); return this; } }
CacheConfiguration implements Cloneable { public final CacheConfiguration transactionalMode(String transactionalMode) { setTransactionalMode(transactionalMode); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxEntriesLocalHeap); }
CacheConfiguration implements Cloneable { public final CacheConfiguration transactionalMode(String transactionalMode) { setTransactionalMode(transactionalMode); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxEntriesLocalHeap); @Override CacheConfiguration clone(); final void setName(String...
CacheConfiguration implements Cloneable { public final CacheConfiguration transactionalMode(String transactionalMode) { setTransactionalMode(transactionalMode); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxEntriesLocalHeap); @Override CacheConfiguration clone(); final void setName(String...
@Test public void testContainsKey() { final Object key = new Object(); assertThat(store.containsKey(key), is(false)); store.setPinned(key, true); assertThat(store.get(key), nullValue()); assertThat(store.containsKey(key), is(false)); }
public final boolean containsKey(Object key) { return map.containsKey(key); }
LruMemoryStore extends AbstractStore { public final boolean containsKey(Object key) { return map.containsKey(key); } }
LruMemoryStore extends AbstractStore { public final boolean containsKey(Object key) { return map.containsKey(key); } LruMemoryStore(Ehcache cache, Store diskStore); }
LruMemoryStore extends AbstractStore { public final boolean containsKey(Object key) { return map.containsKey(key); } LruMemoryStore(Ehcache cache, Store diskStore); synchronized void unpinAll(); synchronized boolean isPinned(Object key); synchronized void setPinned(Object key, boolean pinned); final boolean put(Element...
LruMemoryStore extends AbstractStore { public final boolean containsKey(Object key) { return map.containsKey(key); } LruMemoryStore(Ehcache cache, Store diskStore); synchronized void unpinAll(); synchronized boolean isPinned(Object key); synchronized void setPinned(Object key, boolean pinned); final boolean put(Element...
@Test public void testGetKeys() throws InterruptedException { int unpinCount = 500; int pinCount = 500; Set<Object> pinnedKeys = new HashSet<Object>(); Set<Object> removedPinnedKeys = new HashSet<Object>(); Set<Object> unpinnedKeys = new HashSet<Object>(); Object key = null; for (int i = 0; i < unpinCount; i++) { key =...
public List getKeys() { return new ArrayList(keySet()); }
DiskStore extends AbstractStore implements TierableStore, PoolableStore, StripedReadWriteLockProvider { public List getKeys() { return new ArrayList(keySet()); } }
DiskStore extends AbstractStore implements TierableStore, PoolableStore, StripedReadWriteLockProvider { public List getKeys() { return new ArrayList(keySet()); } private DiskStore(DiskStorageFactory disk, Ehcache cache, Pool onHeapPool, Pool onDiskPool); }
DiskStore extends AbstractStore implements TierableStore, PoolableStore, StripedReadWriteLockProvider { public List getKeys() { return new ArrayList(keySet()); } private DiskStore(DiskStorageFactory disk, Ehcache cache, Pool onHeapPool, Pool onDiskPool); static DiskStore create(Ehcache cache, String diskStorePath, Poo...
DiskStore extends AbstractStore implements TierableStore, PoolableStore, StripedReadWriteLockProvider { public List getKeys() { return new ArrayList(keySet()); } private DiskStore(DiskStorageFactory disk, Ehcache cache, Pool onHeapPool, Pool onDiskPool); static DiskStore create(Ehcache cache, String diskStorePath, Poo...
@Test public void testSizeOf() throws Exception { Assume.assumeThat(CURRENT_JVM_INFORMATION.getMinimumObjectSize(), is(CURRENT_JVM_INFORMATION.getObjectAlignment())); SizeOf sizeOf = new CrossCheckingSizeOf(); if (System.getProperty("java.version").startsWith("1.5")) { if (IS_64_BIT) { verify64bitSizes(sizeOf); assertT...
public SizeOf(SizeOfFilter fieldFilter, boolean caching) { ObjectGraphWalker.Visitor visitor; if (caching) { visitor = new CachingSizeOfVisitor(); } else { visitor = new SizeOfVisitor(); } this.walker = new ObjectGraphWalker(visitor, fieldFilter); }
SizeOf { public SizeOf(SizeOfFilter fieldFilter, boolean caching) { ObjectGraphWalker.Visitor visitor; if (caching) { visitor = new CachingSizeOfVisitor(); } else { visitor = new SizeOfVisitor(); } this.walker = new ObjectGraphWalker(visitor, fieldFilter); } }
SizeOf { public SizeOf(SizeOfFilter fieldFilter, boolean caching) { ObjectGraphWalker.Visitor visitor; if (caching) { visitor = new CachingSizeOfVisitor(); } else { visitor = new SizeOfVisitor(); } this.walker = new ObjectGraphWalker(visitor, fieldFilter); } SizeOf(SizeOfFilter fieldFilter, boolean caching); }
SizeOf { public SizeOf(SizeOfFilter fieldFilter, boolean caching) { ObjectGraphWalker.Visitor visitor; if (caching) { visitor = new CachingSizeOfVisitor(); } else { visitor = new SizeOfVisitor(); } this.walker = new ObjectGraphWalker(visitor, fieldFilter); } SizeOf(SizeOfFilter fieldFilter, boolean caching); abstract l...
SizeOf { public SizeOf(SizeOfFilter fieldFilter, boolean caching) { ObjectGraphWalker.Visitor visitor; if (caching) { visitor = new CachingSizeOfVisitor(); } else { visitor = new SizeOfVisitor(); } this.walker = new ObjectGraphWalker(visitor, fieldFilter); } SizeOf(SizeOfFilter fieldFilter, boolean caching); abstract l...
@Test public void testOnHeapConsumption() throws Exception { SizeOf sizeOf = new CrossCheckingSizeOf(); int size = 80000; for (int j = 0; j < 5; j++) { container = new Object[size]; long usedBefore = measureMemoryUse(); for (int i = 0; i < size; i++) { container[i] = new EvilPair(new Object(), new SomeClass(i % 2 == 0)...
public Size deepSizeOf(int maxDepth, boolean abortWhenMaxDepthExceeded, Object... obj) { try { return new Size(walker.walk(maxDepth, abortWhenMaxDepthExceeded, obj), true); } catch (MaxDepthExceededException e) { LOG.warn(e.getMessage()); return new Size(e.getMeasuredSize(), false); } }
SizeOf { public Size deepSizeOf(int maxDepth, boolean abortWhenMaxDepthExceeded, Object... obj) { try { return new Size(walker.walk(maxDepth, abortWhenMaxDepthExceeded, obj), true); } catch (MaxDepthExceededException e) { LOG.warn(e.getMessage()); return new Size(e.getMeasuredSize(), false); } } }
SizeOf { public Size deepSizeOf(int maxDepth, boolean abortWhenMaxDepthExceeded, Object... obj) { try { return new Size(walker.walk(maxDepth, abortWhenMaxDepthExceeded, obj), true); } catch (MaxDepthExceededException e) { LOG.warn(e.getMessage()); return new Size(e.getMeasuredSize(), false); } } SizeOf(SizeOfFilter fie...
SizeOf { public Size deepSizeOf(int maxDepth, boolean abortWhenMaxDepthExceeded, Object... obj) { try { return new Size(walker.walk(maxDepth, abortWhenMaxDepthExceeded, obj), true); } catch (MaxDepthExceededException e) { LOG.warn(e.getMessage()); return new Size(e.getMeasuredSize(), false); } } SizeOf(SizeOfFilter fie...
SizeOf { public Size deepSizeOf(int maxDepth, boolean abortWhenMaxDepthExceeded, Object... obj) { try { return new Size(walker.walk(maxDepth, abortWhenMaxDepthExceeded, obj), true); } catch (MaxDepthExceededException e) { LOG.warn(e.getMessage()); return new Size(e.getMeasuredSize(), false); } } SizeOf(SizeOfFilter fie...
@Test public void testCantSwitchPool() throws Exception { Configuration configuration = new Configuration(); CacheManager cacheManager = new CacheManager(configuration.maxBytesLocalHeap(10, MemoryUnit.MEGABYTES).name("new-cacheManager")); CacheConfiguration cacheConfiguration = new CacheConfiguration("one", 0); cacheMa...
public CacheConfiguration getCacheConfiguration() { return configuration; }
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } }
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
@Test(expected = InvalidConfigurationException.class) public void testLocalHeapCantSwitchToCountBased() { manager.addCache(new Cache(new CacheConfiguration().name("sizeBased").maxBytesLocalHeap(10, MemoryUnit.MEGABYTES))); Cache sizeBased = manager.getCache("sizeBased"); sizeBased.getCacheConfiguration().setMaxEntriesL...
public CacheConfiguration getCacheConfiguration() { return configuration; }
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } }
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
@Test(expected = InvalidConfigurationException.class) public void testLocalHeapCantSwitchToSizeBased() { manager.addCache(new Cache(new CacheConfiguration().name("countBased").maxEntriesLocalHeap(10))); Cache sizeBased = manager.getCache("countBased"); sizeBased.getCacheConfiguration().maxBytesLocalHeap(10, MemoryUnit....
public CacheConfiguration getCacheConfiguration() { return configuration; }
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } }
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
@Test(expected = InvalidConfigurationException.class) public void testLocalDiskCantSwitchToCountBased() { manager.addCache(new Cache(new CacheConfiguration().name("sizeBased").maxBytesLocalDisk(10, MemoryUnit.MEGABYTES))); Cache sizeBased = manager.getCache("sizeBased"); sizeBased.getCacheConfiguration().setMaxEntriesL...
public CacheConfiguration getCacheConfiguration() { return configuration; }
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } }
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
@Test(expected = InvalidConfigurationException.class) public void testLocalDiskCantSwitchToSizeBased() { manager.addCache(new Cache(new CacheConfiguration().name("countBased").maxEntriesLocalDisk(10))); Cache sizeBased = manager.getCache("countBased"); sizeBased.getCacheConfiguration().maxBytesLocalDisk(10, MemoryUnit....
public CacheConfiguration getCacheConfiguration() { return configuration; }
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } }
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
@Test public void testAdjustsPoolSizeDynamically() throws Exception { Configuration configuration = new Configuration(); CacheManager cacheManager = new CacheManager(configuration.maxBytesLocalHeap(10, MemoryUnit.MEGABYTES).name("new-cacheManager")); CacheConfiguration cacheConfiguration = new CacheConfiguration("three...
public CacheConfiguration getCacheConfiguration() { return configuration; }
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } }
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
@Test public void testMultipleDispose() { Ehcache cache = new Cache("testCache", 1, true, false, 5, 2); manager.addCache(cache); cache.dispose(); for (int i = 0; i < 10; i++) { cache.dispose(); } }
public synchronized void dispose() throws IllegalStateException { if (checkStatusAlreadyDisposed()) { return; } if (bootstrapCacheLoader != null && bootstrapCacheLoader instanceof Disposable) { ((Disposable)bootstrapCacheLoader).dispose(); } if (executorService != null) { executorService.shutdown(); } disposeRegistered...
Cache implements InternalEhcache, StoreListener { public synchronized void dispose() throws IllegalStateException { if (checkStatusAlreadyDisposed()) { return; } if (bootstrapCacheLoader != null && bootstrapCacheLoader instanceof Disposable) { ((Disposable)bootstrapCacheLoader).dispose(); } if (executorService != null)...
Cache implements InternalEhcache, StoreListener { public synchronized void dispose() throws IllegalStateException { if (checkStatusAlreadyDisposed()) { return; } if (bootstrapCacheLoader != null && bootstrapCacheLoader instanceof Disposable) { ((Disposable)bootstrapCacheLoader).dispose(); } if (executorService != null)...
Cache implements InternalEhcache, StoreListener { public synchronized void dispose() throws IllegalStateException { if (checkStatusAlreadyDisposed()) { return; } if (bootstrapCacheLoader != null && bootstrapCacheLoader instanceof Disposable) { ((Disposable)bootstrapCacheLoader).dispose(); } if (executorService != null)...
Cache implements InternalEhcache, StoreListener { public synchronized void dispose() throws IllegalStateException { if (checkStatusAlreadyDisposed()) { return; } if (bootstrapCacheLoader != null && bootstrapCacheLoader instanceof Disposable) { ((Disposable)bootstrapCacheLoader).dispose(); } if (executorService != null)...
@Test public void testSetCacheName() throws CacheException { Ehcache cache = new Cache("testCache", 1, true, false, 5, 2); try { cache.setName(null); fail(); } catch (IllegalArgumentException e) { } cache.setName("name/with/slash"); manager.addCache(cache); try { cache.setName("trying_to_change_name_after_initialised")...
public final void setName(String name) throws IllegalArgumentException { if (!cacheStatus.isUninitialized()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); }
Cache implements InternalEhcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!cacheStatus.isUninitialized()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } }
Cache implements InternalEhcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!cacheStatus.isUninitialized()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(CacheConfiguration cacheConfigur...
Cache implements InternalEhcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!cacheStatus.isUninitialized()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(CacheConfiguration cacheConfigur...
Cache implements InternalEhcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!cacheStatus.isUninitialized()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(CacheConfiguration cacheConfigur...
@Test public void testAutoOverflowsToDisk() { manager.addCache(new Cache(new CacheConfiguration("overflow1", 10).maxBytesLocalDisk(10, MemoryUnit.MEGABYTES))); assertThat(manager.getCache("overflow1").getCacheConfiguration().isOverflowToDisk(), is(true)); CacheManager cacheManager = new CacheManager(new Configuration()...
public CacheConfiguration getCacheConfiguration() { return configuration; }
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } }
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventListeners, BootstrapCacheLoa...
@Test public void testInitialiseFailures() { final String name = "testInitialiseFailures2"; Cache cache = new Cache(name, 1, false, false, 5, 1); cache.initialise(); try { cache.initialise(); fail("Calling cache.initialise() multiple times should fail with IllegalStateException"); } catch (IllegalStateException e) { if...
public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } Pool onHeapPool; if (configuration.getMaxBytesLocalHeap() > 0) { PoolEvictor<PoolableStore...
Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } Pool onHeapPool; if (configuration.getMa...
Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } Pool onHeapPool; if (configuration.getMa...
Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } Pool onHeapPool; if (configuration.getMa...
Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } Pool onHeapPool; if (configuration.getMa...
@Test public void testGetDiskStoreSize() throws Exception { Cache cache = new Cache("testGetDiskStoreSize", 1, true, false, 100, 200); manager.addCache(cache); assertEquals(0, cache.getDiskStoreSize()); cache.put(new Element("key1", "value1")); RetryAssert.assertBy(1, TimeUnit.SECONDS, new GetCacheDiskSize(cache), is(1...
public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return compoundStore.getTerracottaClusteredSize(); } else { return compoundStore.getOnDiskSize(); } }
Cache implements InternalEhcache, StoreListener { public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return compoundStore.getTerracottaClusteredSize(); } else { return compoundStore.getOnDiskSize(); } } }
Cache implements InternalEhcache, StoreListener { public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return compoundStore.getTerracottaClusteredSize(); } else { return compoundStore.getOnDiskSize(); } } Cache(CacheConfiguration cacheConfiguration); Cache(Ca...
Cache implements InternalEhcache, StoreListener { public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return compoundStore.getTerracottaClusteredSize(); } else { return compoundStore.getOnDiskSize(); } } Cache(CacheConfiguration cacheConfiguration); Cache(Ca...
Cache implements InternalEhcache, StoreListener { public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return compoundStore.getTerracottaClusteredSize(); } else { return compoundStore.getOnDiskSize(); } } Cache(CacheConfiguration cacheConfiguration); Cache(Ca...
@Test public void testCloneFailures() throws Exception { Cache cache = new Cache("testGetMemoryStore", 10, false, false, 100, 200); manager.addCache(cache); try { cache.clone(); fail("Should have thrown CloneNotSupportedException"); } catch (CloneNotSupportedException e) { } }
@Override public final Cache clone() throws CloneNotSupportedException { if (compoundStore != null) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.liveCacheStatisticsData = new LiveCacheStatisticsWrapper(copy); copy.sampledCacheStatistics = new S...
Cache implements InternalEhcache, StoreListener { @Override public final Cache clone() throws CloneNotSupportedException { if (compoundStore != null) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.liveCacheStatisticsData = new LiveCacheStatistics...
Cache implements InternalEhcache, StoreListener { @Override public final Cache clone() throws CloneNotSupportedException { if (compoundStore != null) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.liveCacheStatisticsData = new LiveCacheStatistics...
Cache implements InternalEhcache, StoreListener { @Override public final Cache clone() throws CloneNotSupportedException { if (compoundStore != null) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.liveCacheStatisticsData = new LiveCacheStatistics...
Cache implements InternalEhcache, StoreListener { @Override public final Cache clone() throws CloneNotSupportedException { if (compoundStore != null) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.liveCacheStatisticsData = new LiveCacheStatistics...
@Test public void testToString() { Ehcache cache = new Cache("testGetMemoryStore", 10, false, false, 100, 200); assertTrue(cache.toString().indexOf("testGetMemoryStore") > -1); }
@Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(cacheStatus.getStatus()) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk = ").append(configuration.isOverflow...
Cache implements InternalEhcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(cacheStatus.getStatus()) .append(" eternal = ").append(configuration.isEternal()) .append(" o...
Cache implements InternalEhcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(cacheStatus.getStatus()) .append(" eternal = ").append(configuration.isEternal()) .append(" o...
Cache implements InternalEhcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(cacheStatus.getStatus()) .append(" eternal = ").append(configuration.isEternal()) .append(" o...
Cache implements InternalEhcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(cacheStatus.getStatus()) .append(" eternal = ").append(configuration.isEternal()) .append(" o...
@Test public void testEquals() throws CacheException, InterruptedException, ExecutionException, NoSuchFieldException, IllegalAccessException { Cache cache = new Cache("cache", 1, true, false, 100, 200, false, 1); manager.addCache(cache); Assume.assumeThat(cache.getStore(), IsInstanceOf.instanceOf(FrontEndCacheTier.clas...
@Override public boolean equals(Object object) { if (object == null) { return false; } if (!(object instanceof Ehcache)) { return false; } Ehcache other = (Ehcache) object; return guid.equals(other.getGuid()); }
Cache implements InternalEhcache, StoreListener { @Override public boolean equals(Object object) { if (object == null) { return false; } if (!(object instanceof Ehcache)) { return false; } Ehcache other = (Ehcache) object; return guid.equals(other.getGuid()); } }
Cache implements InternalEhcache, StoreListener { @Override public boolean equals(Object object) { if (object == null) { return false; } if (!(object instanceof Ehcache)) { return false; } Ehcache other = (Ehcache) object; return guid.equals(other.getGuid()); } Cache(CacheConfiguration cacheConfiguration); Cache(Cache...
Cache implements InternalEhcache, StoreListener { @Override public boolean equals(Object object) { if (object == null) { return false; } if (!(object instanceof Ehcache)) { return false; } Ehcache other = (Ehcache) object; return guid.equals(other.getGuid()); } Cache(CacheConfiguration cacheConfiguration); Cache(Cache...
Cache implements InternalEhcache, StoreListener { @Override public boolean equals(Object object) { if (object == null) { return false; } if (!(object instanceof Ehcache)) { return false; } Ehcache other = (Ehcache) object; return guid.equals(other.getGuid()); } Cache(CacheConfiguration cacheConfiguration); Cache(Cache...
@Test public void testIsKeyInCache() throws CacheException, InterruptedException { Cache cache = new Cache("cache", 1, true, false, 100, 200, false, 1); manager.addCache(cache); Element element1 = new Element("1", new Date()); Element element2 = new Element("2", new Date()); cache.put(element1); cache.put(element2); as...
public boolean isKeyInCache(Object key) { if (key == null) { return false; } return compoundStore.containsKey(key); }
Cache implements InternalEhcache, StoreListener { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return compoundStore.containsKey(key); } }
Cache implements InternalEhcache, StoreListener { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return compoundStore.containsKey(key); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventLis...
Cache implements InternalEhcache, StoreListener { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return compoundStore.containsKey(key); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventLis...
Cache implements InternalEhcache, StoreListener { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return compoundStore.containsKey(key); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registeredEventLis...
@Test public void testGetQuietFromFinalize() throws InterruptedException { final Cache cache = new Cache("test", 1, true, false, 5, 2); manager.addCache(cache); cache.put(new Element("key", "value")); cache.put(new Element("key2", "value")); cache.put(new Element("key3", "value")); cache.put(new Element("key4", "value"...
public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); }
Cache implements InternalEhcache, StoreListener { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } }
Cache implements InternalEhcache, StoreListener { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners r...
Cache implements InternalEhcache, StoreListener { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners r...
Cache implements InternalEhcache, StoreListener { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners r...
@Test public void testGetWithLoader() { class TestCacheLoader implements CacheLoader { public Object load(Object key, Object argument) throws CacheException { LOG.info("load1 " + key); return key; } public Map loadAll(Collection keys, Object argument) throws CacheException { return null; } public String getName() { ret...
public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { Element element = get(key); if (element != null) { return element; } if (registeredCacheLoaders.size() == 0 && loader == null) { return null; } try { element = getQuiet(key); if (element != null) { return element...
Cache implements InternalEhcache, StoreListener { public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { Element element = get(key); if (element != null) { return element; } if (registeredCacheLoaders.size() == 0 && loader == null) { return null; } try { element = ge...
Cache implements InternalEhcache, StoreListener { public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { Element element = get(key); if (element != null) { return element; } if (registeredCacheLoaders.size() == 0 && loader == null) { return null; } try { element = ge...
Cache implements InternalEhcache, StoreListener { public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { Element element = get(key); if (element != null) { return element; } if (registeredCacheLoaders.size() == 0 && loader == null) { return null; } try { element = ge...
Cache implements InternalEhcache, StoreListener { public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { Element element = get(key); if (element != null) { return element; } if (registeredCacheLoaders.size() == 0 && loader == null) { return null; } try { element = ge...
@Test public void testAsynchronousLoad() throws InterruptedException, ExecutionException { CountingCacheLoader countingCacheLoader = new CountingCacheLoader(); Cache cache = manager.getCache("sampleCache1"); cache.registerCacheLoader(countingCacheLoader); ExecutorService executorService = cache.getExecutorService(); Fu...
Future<AtomicReference<Object>> asynchronousLoad(final Object key, final CacheLoader specificLoader, final Object argument) { final AtomicReference<Object> result = new AtomicReference<Object>(); return getExecutorService().submit(new Runnable() { public void run() throws CacheException { try { boolean existsOnRun = is...
Cache implements InternalEhcache, StoreListener { Future<AtomicReference<Object>> asynchronousLoad(final Object key, final CacheLoader specificLoader, final Object argument) { final AtomicReference<Object> result = new AtomicReference<Object>(); return getExecutorService().submit(new Runnable() { public void run() thro...
Cache implements InternalEhcache, StoreListener { Future<AtomicReference<Object>> asynchronousLoad(final Object key, final CacheLoader specificLoader, final Object argument) { final AtomicReference<Object> result = new AtomicReference<Object>(); return getExecutorService().submit(new Runnable() { public void run() thro...
Cache implements InternalEhcache, StoreListener { Future<AtomicReference<Object>> asynchronousLoad(final Object key, final CacheLoader specificLoader, final Object argument) { final AtomicReference<Object> result = new AtomicReference<Object>(); return getExecutorService().submit(new Runnable() { public void run() thro...
Cache implements InternalEhcache, StoreListener { Future<AtomicReference<Object>> asynchronousLoad(final Object key, final CacheLoader specificLoader, final Object argument) { final AtomicReference<Object> result = new AtomicReference<Object>(); return getExecutorService().submit(new Runnable() { public void run() thro...
@Test public void testAsynchronousLoadAll() throws InterruptedException, ExecutionException { CountingCacheLoader countingCacheLoader = new CountingCacheLoader(); Cache cache = manager.getCache("sampleCache1"); cache.registerCacheLoader(countingCacheLoader); ExecutorService executorService = cache.getExecutorService();...
Future asynchronousLoadAll(final Collection keys, final Object argument) { return getExecutorService().submit(new Runnable() { public void run() { try { Set<Object> nonLoadedKeys = new HashSet<Object>(); for (Object key : keys) { if (!isKeyInCache(key)) { nonLoadedKeys.add(key); } } Map<?, ?> map = loadWithRegisteredLo...
Cache implements InternalEhcache, StoreListener { Future asynchronousLoadAll(final Collection keys, final Object argument) { return getExecutorService().submit(new Runnable() { public void run() { try { Set<Object> nonLoadedKeys = new HashSet<Object>(); for (Object key : keys) { if (!isKeyInCache(key)) { nonLoadedKeys....
Cache implements InternalEhcache, StoreListener { Future asynchronousLoadAll(final Collection keys, final Object argument) { return getExecutorService().submit(new Runnable() { public void run() { try { Set<Object> nonLoadedKeys = new HashSet<Object>(); for (Object key : keys) { if (!isKeyInCache(key)) { nonLoadedKeys....
Cache implements InternalEhcache, StoreListener { Future asynchronousLoadAll(final Collection keys, final Object argument) { return getExecutorService().submit(new Runnable() { public void run() { try { Set<Object> nonLoadedKeys = new HashSet<Object>(); for (Object key : keys) { if (!isKeyInCache(key)) { nonLoadedKeys....
Cache implements InternalEhcache, StoreListener { Future asynchronousLoadAll(final Collection keys, final Object argument) { return getExecutorService().submit(new Runnable() { public void run() { try { Set<Object> nonLoadedKeys = new HashSet<Object>(); for (Object key : keys) { if (!isKeyInCache(key)) { nonLoadedKeys....
@Test public void testProgrammaticConfigurationFailsProperlyWhenNoDefaultCacheConfigured() { Configuration mgrConfig = new Configuration(); mgrConfig.setUpdateCheck(false); CacheManager cacheManager = null; try { cacheManager = new CacheManager(mgrConfig); Assert.assertNotNull(cacheManager); } catch (Exception e) { fai...
public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManagerPeerProvider....
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag...
@Test public void testForCacheManagerThreadLeak() throws CacheException, InterruptedException { int startingThreadCount = countThreads(); URL secondCacheConfiguration = this.getClass().getResource( "/ehcache-2.xml"); for (int i = 0; i < 100; i++) { instanceManager = new CacheManager(secondCacheConfiguration); instanceM...
public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManagerPeerProvider....
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag...
@Test public void testCacheManagerThreads() throws CacheException, InterruptedException { singletonManager = CacheManager .create(AbstractCacheTest.TEST_CONFIG_DIR + "ehcache-big.xml"); int threads = countThreads(); assertTrue("More than 145 threads: " + threads, countThreads() <= 145); }
public static CacheManager create() throws CacheException { if (singleton != null) { LOG.debug("Attempting to create an existing singleton. Existing singleton returned."); return singleton; } synchronized (CacheManager.class) { if (singleton == null) { singleton = newInstance(); } else { LOG.debug("Attempting to create...
CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { LOG.debug("Attempting to create an existing singleton. Existing singleton returned."); return singleton; } synchronized (CacheManager.class) { if (singleton == null) { singleton = newInstance(); } else { LOG.debug("Attem...
CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { LOG.debug("Attempting to create an existing singleton. Existing singleton returned."); return singleton; } synchronized (CacheManager.class) { if (singleton == null) { singleton = newInstance(); } else { LOG.debug("Attem...
CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { LOG.debug("Attempting to create an existing singleton. Existing singleton returned."); return singleton; } synchronized (CacheManager.class) { if (singleton == null) { singleton = newInstance(); } else { LOG.debug("Attem...
CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { LOG.debug("Attempting to create an existing singleton. Existing singleton returned."); return singleton; } synchronized (CacheManager.class) { if (singleton == null) { singleton = newInstance(); } else { LOG.debug("Attem...
@Test public void testGetCache() throws CacheException { instanceManager = CacheManager.create(); Ehcache cache = instanceManager.getCache("sampleCache1"); assertNotNull(cache); }
public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); Ehcache ehcache = ehcaches.get(name); return ehcache instanceof Cache ? (Cache) ehcache : null; }
CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); Ehcache ehcache = ehcaches.get(name); return ehcache instanceof Cache ? (Cache) ehcache : null; } }
CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); Ehcache ehcache = ehcaches.get(name); return ehcache instanceof Cache ? (Cache) ehcache : null; } CacheManager(Configuration configuration); CacheManager(String configurationFileName); CacheManager(URL ...
CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); Ehcache ehcache = ehcaches.get(name); return ehcache instanceof Cache ? (Cache) ehcache : null; } CacheManager(Configuration configuration); CacheManager(String configurationFileName); CacheManager(URL ...
CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); Ehcache ehcache = ehcaches.get(name); return ehcache instanceof Cache ? (Cache) ehcache : null; } CacheManager(Configuration configuration); CacheManager(String configurationFileName); CacheManager(URL ...
@Test public void testRemoveCache() throws CacheException { singletonManager = CacheManager.create(); assertEquals(15, singletonManager.getConfiguration().getCacheConfigurations().size()); Ehcache cache = singletonManager.getCache("sampleCache1"); assertNotNull(cache); singletonManager.removeCache("sampleCache1"); cach...
public synchronized void removeCache(String cacheName) throws IllegalStateException { checkStatus(); if (cacheName == null || cacheName.length() == 0) { return; } Ehcache cache = ehcaches.remove(cacheName); if (cache != null && cache.getStatus().equals(Status.STATUS_ALIVE)) { cache.dispose(); runtimeCfg.removeCache(cac...
CacheManager { public synchronized void removeCache(String cacheName) throws IllegalStateException { checkStatus(); if (cacheName == null || cacheName.length() == 0) { return; } Ehcache cache = ehcaches.remove(cacheName); if (cache != null && cache.getStatus().equals(Status.STATUS_ALIVE)) { cache.dispose(); runtimeCfg....
CacheManager { public synchronized void removeCache(String cacheName) throws IllegalStateException { checkStatus(); if (cacheName == null || cacheName.length() == 0) { return; } Ehcache cache = ehcaches.remove(cacheName); if (cache != null && cache.getStatus().equals(Status.STATUS_ALIVE)) { cache.dispose(); runtimeCfg....
CacheManager { public synchronized void removeCache(String cacheName) throws IllegalStateException { checkStatus(); if (cacheName == null || cacheName.length() == 0) { return; } Ehcache cache = ehcaches.remove(cacheName); if (cache != null && cache.getStatus().equals(Status.STATUS_ALIVE)) { cache.dispose(); runtimeCfg....
CacheManager { public synchronized void removeCache(String cacheName) throws IllegalStateException { checkStatus(); if (cacheName == null || cacheName.length() == 0) { return; } Ehcache cache = ehcaches.remove(cacheName); if (cache != null && cache.getStatus().equals(Status.STATUS_ALIVE)) { cache.dispose(); runtimeCfg....
@Test public void testAddCache() throws CacheException { singletonManager = CacheManager.create(); assertEquals(15, singletonManager.getConfiguration().getCacheConfigurations().size()); singletonManager.addCache("test"); singletonManager.addCache("test2"); assertEquals(17, singletonManager.getConfiguration().getCacheCo...
public synchronized void addCache(String cacheName) throws IllegalStateException, ObjectExistsException, CacheException { checkStatus(); if (cacheName == null || cacheName.length() == 0) { return; } if (ehcaches.get(cacheName) != null) { throw new ObjectExistsException("Cache " + cacheName + " already exists"); } Ehcac...
CacheManager { public synchronized void addCache(String cacheName) throws IllegalStateException, ObjectExistsException, CacheException { checkStatus(); if (cacheName == null || cacheName.length() == 0) { return; } if (ehcaches.get(cacheName) != null) { throw new ObjectExistsException("Cache " + cacheName + " already ex...
CacheManager { public synchronized void addCache(String cacheName) throws IllegalStateException, ObjectExistsException, CacheException { checkStatus(); if (cacheName == null || cacheName.length() == 0) { return; } if (ehcaches.get(cacheName) != null) { throw new ObjectExistsException("Cache " + cacheName + " already ex...
CacheManager { public synchronized void addCache(String cacheName) throws IllegalStateException, ObjectExistsException, CacheException { checkStatus(); if (cacheName == null || cacheName.length() == 0) { return; } if (ehcaches.get(cacheName) != null) { throw new ObjectExistsException("Cache " + cacheName + " already ex...
CacheManager { public synchronized void addCache(String cacheName) throws IllegalStateException, ObjectExistsException, CacheException { checkStatus(); if (cacheName == null || cacheName.length() == 0) { return; } if (ehcaches.get(cacheName) != null) { throw new ObjectExistsException("Cache " + cacheName + " already ex...
@Test public void testAddCacheIfAbsent() { singletonManager = CacheManager.create(); singletonManager.addCache("present"); assertTrue(singletonManager.getCache("present") == singletonManager.addCacheIfAbsent(new Cache(new CacheConfiguration("present", 1000)))); Cache theCache = new Cache(new CacheConfiguration("absent"...
public synchronized Ehcache addCacheIfAbsent(final Ehcache cache) { checkStatus(); return cache == null ? null : addCacheNoCheck(cache, false); }
CacheManager { public synchronized Ehcache addCacheIfAbsent(final Ehcache cache) { checkStatus(); return cache == null ? null : addCacheNoCheck(cache, false); } }
CacheManager { public synchronized Ehcache addCacheIfAbsent(final Ehcache cache) { checkStatus(); return cache == null ? null : addCacheNoCheck(cache, false); } CacheManager(Configuration configuration); CacheManager(String configurationFileName); CacheManager(URL configurationURL); CacheManager(InputStream configur...
CacheManager { public synchronized Ehcache addCacheIfAbsent(final Ehcache cache) { checkStatus(); return cache == null ? null : addCacheNoCheck(cache, false); } CacheManager(Configuration configuration); CacheManager(String configurationFileName); CacheManager(URL configurationURL); CacheManager(InputStream configur...
CacheManager { public synchronized Ehcache addCacheIfAbsent(final Ehcache cache) { checkStatus(); return cache == null ? null : addCacheNoCheck(cache, false); } CacheManager(Configuration configuration); CacheManager(String configurationFileName); CacheManager(URL configurationURL); CacheManager(InputStream configur...
@Test public void testMultipleCacheManagers() { CacheManager[] managers = new CacheManager[2]; managers[0] = new CacheManager(makeCacheManagerConfig("cm1")); managers[1] = new CacheManager(makeCacheManagerConfig("cm2")); managers[0].shutdown(); managers[1].shutdown(); }
public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManagerPeerProvider....
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag...
CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag...
@Test public void testClearStatistics() throws InterruptedException { Cache cache = new Cache("test", 1, true, false, 5, 2); manager.addCache(cache); cache.setStatisticsEnabled(true); cache.put(new Element("key1", "value1")); cache.put(new Element("key2", "value1")); Thread.sleep(100); cache.get("key1"); cache.get("key...
public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); }
Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } }
Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } Statistics(Ehcache cache, int statisticsAccuracy, long cacheHits, long onDiskHits, long offHeapHits, ...
Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } Statistics(Ehcache cache, int statisticsAccuracy, long cacheHits, long onDiskHits, long offHeapHits, ...
Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } Statistics(Ehcache cache, int statisticsAccuracy, long cacheHits, long onDiskHits, long offHeapHits, ...
@Test public void testDelegatesDeleteToAsyncCoordinator() { final Element element = new Element("foo", "bar"); asyncWriteBehind.delete(new CacheEntry(element.getObjectKey(), element)); ArgumentCaptor<SingleAsyncOperation> captor = ArgumentCaptor.forClass(SingleAsyncOperation.class); verify(asyncCoordinator).add(captor....
@Override public void delete(CacheEntry entry) { async.add(new DeleteAsyncOperation(entry.getKey(), entry.getElement())); }
AsyncWriteBehind implements WriteBehind { @Override public void delete(CacheEntry entry) { async.add(new DeleteAsyncOperation(entry.getKey(), entry.getElement())); } }
AsyncWriteBehind implements WriteBehind { @Override public void delete(CacheEntry entry) { async.add(new DeleteAsyncOperation(entry.getKey(), entry.getElement())); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); }
AsyncWriteBehind implements WriteBehind { @Override public void delete(CacheEntry entry) { async.add(new DeleteAsyncOperation(entry.getKey(), entry.getElement())); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); @Override void start(CacheWriter writer); @Override void write(Element e...
AsyncWriteBehind implements WriteBehind { @Override public void delete(CacheEntry entry) { async.add(new DeleteAsyncOperation(entry.getKey(), entry.getElement())); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); @Override void start(CacheWriter writer); @Override void write(Element e...
@Test public void testFetch() throws Exception { LOG.error("."); final Element element = selfPopulatingCache.get("key"); assertEquals("value", element.getValue()); }
@Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new Element(key, null); throw new CacheException...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
@Test public void testFetchUnknown() throws Exception { final CacheEntryFactory factory = new CountingCacheEntryFactory(null); selfPopulatingCache = new SelfPopulatingCache(cache, factory); assertNull(cache.get("key")); }
@Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new Element(key, null); throw new CacheException...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
@Test public void testFetchFail() throws Exception { final Object value = new Object(); final Exception exception = new Exception("Failed."); final AtomicBoolean throwException = new AtomicBoolean(true); final CacheEntryFactory factory = new CacheEntryFactory() { public Object createEntry(final Object key) throws Excep...
@Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new Element(key, null); throw new CacheException...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
@Test public void testDelegatesWriteToAsyncCoordinator() { final Element element = new Element("foo", "bar"); asyncWriteBehind.write(element); ArgumentCaptor<SingleAsyncOperation> captor = ArgumentCaptor.forClass(SingleAsyncOperation.class); verify(asyncCoordinator).add(captor.capture()); assertThat(captor.getAllValues...
@Override public void write(Element element) { async.add(new WriteAsyncOperation(element)); }
AsyncWriteBehind implements WriteBehind { @Override public void write(Element element) { async.add(new WriteAsyncOperation(element)); } }
AsyncWriteBehind implements WriteBehind { @Override public void write(Element element) { async.add(new WriteAsyncOperation(element)); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); }
AsyncWriteBehind implements WriteBehind { @Override public void write(Element element) { async.add(new WriteAsyncOperation(element)); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); @Override void start(CacheWriter writer); @Override void write(Element element); @Override void delete...
AsyncWriteBehind implements WriteBehind { @Override public void write(Element element) { async.add(new WriteAsyncOperation(element)); } AsyncWriteBehind(final AsyncCoordinator async, final int writeBehindConcurrency); @Override void start(CacheWriter writer); @Override void write(Element element); @Override void delete...
@Test public void testFetch() throws Exception { LOG.error("."); final Element element = selfPopulatingCache.get("key"); assertEquals("value", element.getValue()); }
@Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeoutException e) { String message = "Timeout aft...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
@Test public void testFetchUnknown() throws Exception { final CacheEntryFactory factory = new CountingCacheEntryFactory(null); selfPopulatingCache = new SelfPopulatingCache(cache, factory); assertNull(cache.get("key")); }
@Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeoutException e) { String message = "Timeout aft...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
@Test public void testFetchFail() throws Exception { final Exception exception = new Exception("Failed."); final CacheEntryFactory factory = new CacheEntryFactory() { public Object createEntry(final Object key) throws Exception { throw exception; } }; selfPopulatingCache = new SelfPopulatingCache(cache, factory); try {...
@Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeoutException e) { String message = "Timeout aft...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
@Test public void testCreateOnce() throws Exception { final String value = "value"; final CountingCacheEntryFactory factory = new CountingCacheEntryFactory(value); selfPopulatingCache = new SelfPopulatingCache(cache, factory); for (int i = 0; i < 5; i++) { assertSame(value, selfPopulatingCache.get("key").getObjectValue...
@Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeoutException e) { String message = "Timeout aft...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
@Test public void testCacheEntryFactoryReturningElementMake() throws Exception { final long specialVersionNumber = 54321L; final CacheEntryFactory elementReturningFactory = new CacheEntryFactory() { public Object createEntry(final Object key) throws Exception { Element e = new Element(key, "V_" + key); e.setVersion(spe...
@Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeoutException e) { String message = "Timeout aft...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
@Test public void testCacheEntryFactoryReturningElementBadKey() throws Exception { final CacheEntryFactory elementReturningFactory = new CacheEntryFactory() { public Object createEntry(final Object key) throws Exception { Object modifiedKey = key.toString() + "XX"; Element e = new Element(modifiedKey, "V_" + modifiedKe...
@Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeoutException e) { String message = "Timeout aft...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout...
@Test public void testCreateOnce() throws Exception { final String value = "value"; final CountingCacheEntryFactory factory = new CountingCacheEntryFactory(value); final Cache cache = manager.getCache("sampleCacheNoIdle"); final Ehcache selfPopulatingCache = new SelfPopulatingCache(cache, factory); for (int i = 0; i < ...
@Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new Element(key, null); throw new CacheException...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
@Test(expected = IllegalArgumentException.class) public void testNullWriteMode() { CacheWriterConfiguration config = new CacheWriterConfiguration() .writeMode((CacheWriterConfiguration.WriteMode) null); }
public CacheWriterConfiguration writeMode(String writeMode) { setWriteMode(writeMode); return this; }
CacheWriterConfiguration implements Cloneable { public CacheWriterConfiguration writeMode(String writeMode) { setWriteMode(writeMode); return this; } }
CacheWriterConfiguration implements Cloneable { public CacheWriterConfiguration writeMode(String writeMode) { setWriteMode(writeMode); return this; } }
CacheWriterConfiguration implements Cloneable { public CacheWriterConfiguration writeMode(String writeMode) { setWriteMode(writeMode); return this; } @Override CacheWriterConfiguration clone(); void setWriteMode(String writeMode); CacheWriterConfiguration writeMode(String writeMode); CacheWriterConfiguration writeMode...
CacheWriterConfiguration implements Cloneable { public CacheWriterConfiguration writeMode(String writeMode) { setWriteMode(writeMode); return this; } @Override CacheWriterConfiguration clone(); void setWriteMode(String writeMode); CacheWriterConfiguration writeMode(String writeMode); CacheWriterConfiguration writeMode...
@Test(expected = IllegalArgumentException.class) public void testInvalidWriteMode() { CacheWriterConfiguration config = new CacheWriterConfiguration() .writeMode("invalid"); }
public CacheWriterConfiguration writeMode(String writeMode) { setWriteMode(writeMode); return this; }
CacheWriterConfiguration implements Cloneable { public CacheWriterConfiguration writeMode(String writeMode) { setWriteMode(writeMode); return this; } }
CacheWriterConfiguration implements Cloneable { public CacheWriterConfiguration writeMode(String writeMode) { setWriteMode(writeMode); return this; } }
CacheWriterConfiguration implements Cloneable { public CacheWriterConfiguration writeMode(String writeMode) { setWriteMode(writeMode); return this; } @Override CacheWriterConfiguration clone(); void setWriteMode(String writeMode); CacheWriterConfiguration writeMode(String writeMode); CacheWriterConfiguration writeMode...
CacheWriterConfiguration implements Cloneable { public CacheWriterConfiguration writeMode(String writeMode) { setWriteMode(writeMode); return this; } @Override CacheWriterConfiguration clone(); void setWriteMode(String writeMode); CacheWriterConfiguration writeMode(String writeMode); CacheWriterConfiguration writeMode...
@Test public void testRefresh() throws Exception { final String value = "value"; final CountingCacheEntryFactory factory = new CountingCacheEntryFactory(value); selfPopulatingCache = new SelfPopulatingCache(cache, factory); assertSame(value, selfPopulatingCache.get("key").getObjectValue()); assertEquals(1, factory.getC...
public void refresh() throws CacheException { refresh(true); }
SelfPopulatingCache extends BlockingCache { public void refresh() throws CacheException { refresh(true); } }
SelfPopulatingCache extends BlockingCache { public void refresh() throws CacheException { refresh(true); } SelfPopulatingCache(final Ehcache cache, final CacheEntryFactory factory); }
SelfPopulatingCache extends BlockingCache { public void refresh() throws CacheException { refresh(true); } SelfPopulatingCache(final Ehcache cache, final CacheEntryFactory factory); @Override Element get(final Object key); void refresh(); void refresh(boolean quiet); Element refresh(Object key); Element refresh(Object ...
SelfPopulatingCache extends BlockingCache { public void refresh() throws CacheException { refresh(true); } SelfPopulatingCache(final Ehcache cache, final CacheEntryFactory factory); @Override Element get(final Object key); void refresh(); void refresh(boolean quiet); Element refresh(Object key); Element refresh(Object ...
@Test public void testLoadConfigurationFromFileNoDefault() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-nodefault.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEqu...
public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
@Test public void testCacheEntryFactoryReturningElementMake() throws Exception { final long specialVersionNumber = 54321L; final CacheEntryFactory elementReturningFactory = new CacheEntryFactory() { public Object createEntry(final Object key) throws Exception { Element e = new Element(key, "V_" + key); e.setVersion(spe...
@Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new Element(key, null); throw new CacheException...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
@Test public void testMatchPropertyTokensProperlyFormedUrl() { String example="<terracottaConfig url=\"${serverAndPort}\"/>"; Set propertyTokens = ConfigurationFactory.extractPropertyTokens(example); assertEquals(1, propertyTokens.size()); String firstPropertyToken = (String) (propertyTokens.toArray())[0]; assertEquals...
static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return propertyTokens; }
ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property...
ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property...
ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property...
ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property...
@Test public void testCopyConfiguration() { File file = new File(TEST_CONFIG_DIR + "ehcache-copy.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); Ehcache copyOnReadCache = configurationHelper.cr...
public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
@Test public void testTerracottaConfiguration() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals("tc", config...
public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
@Test public void testCacheEntryFactoryReturningElementBadKey() throws Exception { final CacheEntryFactory elementReturningFactory = new CacheEntryFactory() { public Object createEntry(final Object key) throws Exception { Object modifiedKey = key.toString() + "XX"; Element e = new Element(modifiedKey, "V_" + modifiedKe...
@Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new Element(key, null); throw new CacheException...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ...
@Test public void testTerracottaConfigRMIReplication() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-rmi.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); List configs = configuration.getCacheConfigurations().get("clustered").getCacheEventListenerConfiguration...
public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
@Test public void testTerracottaConfigJGroupsReplication() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-jgroups.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); List configs = configuration.getCacheConfigurations().get("clustered").getCacheEventListenerConfi...
public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
@Test public void testTerracottaInvalidConfig5() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-jms.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); List configs = configuration.getCacheConfigurations().get("clustered").getCacheEventListenerConfigurations(); a...
public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
@Test public void testWriterConfig() { File file = new File(TEST_CONFIG_DIR + "ehcache-writer.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); CacheWriterConfiguration defaultCacheWriterConfig =...
public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul...
@Test public void testRefreshElement() throws Exception { final IncrementingCacheEntryFactory factory = new IncrementingCacheEntryFactory(); selfPopulatingCache = new SelfPopulatingCache(cache, factory); Element e1 = selfPopulatingCache.get("key1"); Element e2 = selfPopulatingCache.get("key2"); assertEquals(2, selfPopu...
protected void refreshElement(final Element element, Ehcache backingCache) throws Exception { refreshElement(element, backingCache, true); }
SelfPopulatingCache extends BlockingCache { protected void refreshElement(final Element element, Ehcache backingCache) throws Exception { refreshElement(element, backingCache, true); } }
SelfPopulatingCache extends BlockingCache { protected void refreshElement(final Element element, Ehcache backingCache) throws Exception { refreshElement(element, backingCache, true); } SelfPopulatingCache(final Ehcache cache, final CacheEntryFactory factory); }
SelfPopulatingCache extends BlockingCache { protected void refreshElement(final Element element, Ehcache backingCache) throws Exception { refreshElement(element, backingCache, true); } SelfPopulatingCache(final Ehcache cache, final CacheEntryFactory factory); @Override Element get(final Object key); void refresh(); voi...
SelfPopulatingCache extends BlockingCache { protected void refreshElement(final Element element, Ehcache backingCache) throws Exception { refreshElement(element, backingCache, true); } SelfPopulatingCache(final Ehcache cache, final CacheEntryFactory factory); @Override Element get(final Object key); void refresh(); voi...
@Test public void testPutIfAbsent() throws Exception { transactionManager.begin(); assertEquals("Cache should be empty to start", 0, cache.getSize()); assertEquals("Cach1 should be empty to start", 0, cach1.getSize()); assertNull(cach1.putIfAbsent(new Element("key", "value1"))); assertNull(cache.putIfAbsent(new Element...
public Element putIfAbsent(Element element) throws NullPointerException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); if (previous == null) { context.addCommand(new StorePutIfAbsentCommand(element), element); } return previous; }
XATransactionalStore extends AbstractStore { public Element putIfAbsent(Element element) throws NullPointerException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); if (previous == null) { context.addCommand(new StorePutIfAbsentCommand(ele...
XATransactionalStore extends AbstractStore { public Element putIfAbsent(Element element) throws NullPointerException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); if (previous == null) { context.addCommand(new StorePutIfAbsentCommand(ele...
XATransactionalStore extends AbstractStore { public Element putIfAbsent(Element element) throws NullPointerException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); if (previous == null) { context.addCommand(new StorePutIfAbsentCommand(ele...
XATransactionalStore extends AbstractStore { public Element putIfAbsent(Element element) throws NullPointerException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); if (previous == null) { context.addCommand(new StorePutIfAbsentCommand(ele...
@Test public void testRemoveElement() throws Exception { transactionManager.begin(); assertEquals("Cache should be empty to start", 0, cache.getSize()); assertEquals("Cach1 should be empty to start", 0, cach1.getSize()); assertFalse(cache.removeElement(new Element("blah", "someValue"))); cache.put(new Element("blah", "...
public Element removeElement(Element element) throws NullPointerException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); if (previous != null && previous.getValue().equals(element.getValue())) { context.addCommand(new StoreRemoveElementCo...
XATransactionalStore extends AbstractStore { public Element removeElement(Element element) throws NullPointerException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); if (previous != null && previous.getValue().equals(element.getValue())) ...
XATransactionalStore extends AbstractStore { public Element removeElement(Element element) throws NullPointerException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); if (previous != null && previous.getValue().equals(element.getValue())) ...
XATransactionalStore extends AbstractStore { public Element removeElement(Element element) throws NullPointerException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); if (previous != null && previous.getValue().equals(element.getValue())) ...
XATransactionalStore extends AbstractStore { public Element removeElement(Element element) throws NullPointerException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); if (previous != null && previous.getValue().equals(element.getValue())) ...
@Test public void testReplace() throws Exception { transactionManager.begin(); assertEquals("Cache should be empty to start", 0, cache.getSize()); assertEquals("Cach1 should be empty to start", 0, cach1.getSize()); assertNull(cache.replace(new Element("blah", "someValue"))); cache.put(new Element("blah", "value")); ass...
public boolean replace(Element old, Element element) throws NullPointerException, IllegalArgumentException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); boolean replaced = false; if (previous != null && previous.getValue().equals(old.get...
XATransactionalStore extends AbstractStore { public boolean replace(Element old, Element element) throws NullPointerException, IllegalArgumentException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); boolean replaced = false; if (previous ...
XATransactionalStore extends AbstractStore { public boolean replace(Element old, Element element) throws NullPointerException, IllegalArgumentException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); boolean replaced = false; if (previous ...
XATransactionalStore extends AbstractStore { public boolean replace(Element old, Element element) throws NullPointerException, IllegalArgumentException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); boolean replaced = false; if (previous ...
XATransactionalStore extends AbstractStore { public boolean replace(Element old, Element element) throws NullPointerException, IllegalArgumentException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); boolean replaced = false; if (previous ...
@Test public void testMultipleDispose() { Ehcache cache = new Cache("testCache", 1, true, false, 5, 2); manager.addCache(cache); cache.dispose(); for (int i = 0; i < 10; i++) { cache.dispose(); } }
public synchronized void dispose() throws IllegalStateException { if (checkStatusAlreadyDisposed()) { return; } if (executorService != null) { executorService.shutdown(); } disposeRegisteredCacheExtensions(); disposeRegisteredCacheLoaders(); disposeRegisteredCacheWriter(); registeredEventListeners.dispose(); if (cacheW...
Cache implements Ehcache, StoreListener { public synchronized void dispose() throws IllegalStateException { if (checkStatusAlreadyDisposed()) { return; } if (executorService != null) { executorService.shutdown(); } disposeRegisteredCacheExtensions(); disposeRegisteredCacheLoaders(); disposeRegisteredCacheWriter(); regi...
Cache implements Ehcache, StoreListener { public synchronized void dispose() throws IllegalStateException { if (checkStatusAlreadyDisposed()) { return; } if (executorService != null) { executorService.shutdown(); } disposeRegisteredCacheExtensions(); disposeRegisteredCacheLoaders(); disposeRegisteredCacheWriter(); regi...
Cache implements Ehcache, StoreListener { public synchronized void dispose() throws IllegalStateException { if (checkStatusAlreadyDisposed()) { return; } if (executorService != null) { executorService.shutdown(); } disposeRegisteredCacheExtensions(); disposeRegisteredCacheLoaders(); disposeRegisteredCacheWriter(); regi...
Cache implements Ehcache, StoreListener { public synchronized void dispose() throws IllegalStateException { if (checkStatusAlreadyDisposed()) { return; } if (executorService != null) { executorService.shutdown(); } disposeRegisteredCacheExtensions(); disposeRegisteredCacheLoaders(); disposeRegisteredCacheWriter(); regi...
@Test public void testSetCacheName() throws CacheException { Ehcache cache = new Cache("testCache", 1, true, false, 5, 2); try { cache.setName(null); fail(); } catch (IllegalArgumentException e) { } cache.setName("name/with/slash"); manager.addCache(cache); try { cache.setName("trying_to_change_name_after_initialised")...
public final void setName(String name) throws IllegalArgumentException { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); }
Cache implements Ehcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } }
Cache implements Ehcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(CacheConfiguration cacheCon...
Cache implements Ehcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(CacheConfiguration cacheCon...
Cache implements Ehcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(CacheConfiguration cacheCon...
@Test public void testInitialiseFailures() { try { Cache cache = new Cache("testInitialiseFailures2", 1, false, false, 5, 1); cache.initialise(); cache.initialise(); fail("Should have thrown IllegalArgumentException"); } catch (IllegalStateException e) { } }
public void initialise() { synchronized (this) { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsInMemory() == 0) { LOG.warn("Cache: " + con...
Cache implements Ehcache, StoreListener { public void initialise() { synchronized (this) { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsI...
Cache implements Ehcache, StoreListener { public void initialise() { synchronized (this) { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsI...
Cache implements Ehcache, StoreListener { public void initialise() { synchronized (this) { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsI...
Cache implements Ehcache, StoreListener { public void initialise() { synchronized (this) { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsI...
@Test public void testGetDiskStoreSize() throws Exception { Cache cache = new Cache("testGetDiskStoreSize", 1, true, false, 100, 200); manager.addCache(cache); assertEquals(0, cache.getDiskStoreSize()); cache.put(new Element("key1", "value1")); Thread.sleep(100); assertEquals(0, cache.getDiskStoreSize()); assertEquals(...
public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return compoundStore.getTerracottaClusteredSize(); } else { return compoundStore.getOnDiskSize(); } }
Cache implements Ehcache, StoreListener { public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return compoundStore.getTerracottaClusteredSize(); } else { return compoundStore.getOnDiskSize(); } } }
Cache implements Ehcache, StoreListener { public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return compoundStore.getTerracottaClusteredSize(); } else { return compoundStore.getOnDiskSize(); } } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfi...
Cache implements Ehcache, StoreListener { public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return compoundStore.getTerracottaClusteredSize(); } else { return compoundStore.getOnDiskSize(); } } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfi...
Cache implements Ehcache, StoreListener { public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return compoundStore.getTerracottaClusteredSize(); } else { return compoundStore.getOnDiskSize(); } } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfi...
@Test public void testCloneFailures() throws Exception { Cache cache = new Cache("testGetMemoryStore", 10, false, false, 100, 200); manager.addCache(cache); try { cache.clone(); fail("Should have thrown CloneNotSupportedException"); } catch (CloneNotSupportedException e) { } }
@Override public final Cache clone() throws CloneNotSupportedException { if (compoundStore != null) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.liveCacheStatisticsData = new LiveCacheStatisticsWrapper(copy); copy.sampledCacheStatistics = new S...
Cache implements Ehcache, StoreListener { @Override public final Cache clone() throws CloneNotSupportedException { if (compoundStore != null) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.liveCacheStatisticsData = new LiveCacheStatisticsWrapper(...
Cache implements Ehcache, StoreListener { @Override public final Cache clone() throws CloneNotSupportedException { if (compoundStore != null) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.liveCacheStatisticsData = new LiveCacheStatisticsWrapper(...
Cache implements Ehcache, StoreListener { @Override public final Cache clone() throws CloneNotSupportedException { if (compoundStore != null) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.liveCacheStatisticsData = new LiveCacheStatisticsWrapper(...
Cache implements Ehcache, StoreListener { @Override public final Cache clone() throws CloneNotSupportedException { if (compoundStore != null) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.liveCacheStatisticsData = new LiveCacheStatisticsWrapper(...
@Test public void testToString() { Ehcache cache = new Cache("testGetMemoryStore", 10, false, false, 100, 200); assertTrue(cache.toString().indexOf("testGetMemoryStore") > -1); assertEquals(410, cache.toString().length()); }
@Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(status) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk = ").append(configuration.isOverflowToDisk()) .append...
Cache implements Ehcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(status) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk = ").append...
Cache implements Ehcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(status) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk = ").append...
Cache implements Ehcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(status) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk = ").append...
Cache implements Ehcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(status) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk = ").append...
@Test public void testEquals() throws CacheException, InterruptedException { Cache cache = new Cache("cache", 1, true, false, 100, 200, false, 1); manager.addCache(cache); Element element1 = new Element("1", new Date()); Element element2 = new Element("2", new Date()); cache.put(element1); cache.put(element2); Element ...
@Override public boolean equals(Object object) { if (object == null) { return false; } if (!(object instanceof Ehcache)) { return false; } Ehcache other = (Ehcache) object; return guid.equals(other.getGuid()); }
Cache implements Ehcache, StoreListener { @Override public boolean equals(Object object) { if (object == null) { return false; } if (!(object instanceof Ehcache)) { return false; } Ehcache other = (Ehcache) object; return guid.equals(other.getGuid()); } }
Cache implements Ehcache, StoreListener { @Override public boolean equals(Object object) { if (object == null) { return false; } if (!(object instanceof Ehcache)) { return false; } Ehcache other = (Ehcache) object; return guid.equals(other.getGuid()); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfigur...
Cache implements Ehcache, StoreListener { @Override public boolean equals(Object object) { if (object == null) { return false; } if (!(object instanceof Ehcache)) { return false; } Ehcache other = (Ehcache) object; return guid.equals(other.getGuid()); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfigur...
Cache implements Ehcache, StoreListener { @Override public boolean equals(Object object) { if (object == null) { return false; } if (!(object instanceof Ehcache)) { return false; } Ehcache other = (Ehcache) object; return guid.equals(other.getGuid()); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfigur...
@Test public void testIsKeyInCache() throws CacheException, InterruptedException { Cache cache = new Cache("cache", 1, true, false, 100, 200, false, 1); manager.addCache(cache); Element element1 = new Element("1", new Date()); Element element2 = new Element("2", new Date()); cache.put(element1); cache.put(element2); as...
public boolean isKeyInCache(Object key) { if (key == null) { return false; } return isElementInMemory(key) || isElementOffHeap(key) || isElementOnDisk(key); }
Cache implements Ehcache, StoreListener { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return isElementInMemory(key) || isElementOffHeap(key) || isElementOnDisk(key); } }
Cache implements Ehcache, StoreListener { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return isElementInMemory(key) || isElementOffHeap(key) || isElementOnDisk(key); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, Registered...
Cache implements Ehcache, StoreListener { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return isElementInMemory(key) || isElementOffHeap(key) || isElementOnDisk(key); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, Registered...
Cache implements Ehcache, StoreListener { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return isElementInMemory(key) || isElementOffHeap(key) || isElementOnDisk(key); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, Registered...
@Test public void testGetQuietFromFinalize() throws InterruptedException { final Cache cache = new Cache("test", 1, true, false, 5, 2); manager.addCache(cache); cache.put(new Element("key", "value")); cache.put(new Element("key2", "value")); cache.put(new Element("key3", "value")); cache.put(new Element("key4", "value"...
public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); }
Cache implements Ehcache, StoreListener { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } }
Cache implements Ehcache, StoreListener { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registere...
Cache implements Ehcache, StoreListener { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registere...
Cache implements Ehcache, StoreListener { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration, RegisteredEventListeners registere...
@Test public void testGetWithLoader() { class TestCacheLoader implements CacheLoader { public Object load(Object key, Object argument) throws CacheException { LOG.info("load1 " + key); return key; } public Map loadAll(Collection keys, Object argument) throws CacheException { return null; } public String getName() { ret...
public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { Element element = get(key); if (element != null) { return element; } if (registeredCacheLoaders.size() == 0 && loader == null) { return null; } try { element = getQuiet(key); if (element != null) { return element...
Cache implements Ehcache, StoreListener { public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { Element element = get(key); if (element != null) { return element; } if (registeredCacheLoaders.size() == 0 && loader == null) { return null; } try { element = getQuiet(k...
Cache implements Ehcache, StoreListener { public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { Element element = get(key); if (element != null) { return element; } if (registeredCacheLoaders.size() == 0 && loader == null) { return null; } try { element = getQuiet(k...
Cache implements Ehcache, StoreListener { public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { Element element = get(key); if (element != null) { return element; } if (registeredCacheLoaders.size() == 0 && loader == null) { return null; } try { element = getQuiet(k...
Cache implements Ehcache, StoreListener { public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { Element element = get(key); if (element != null) { return element; } if (registeredCacheLoaders.size() == 0 && loader == null) { return null; } try { element = getQuiet(k...