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 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, ElementValueComparator comparator) throws NullPointerException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); if (previous != null && previous.getValue().equals(element.getValue())) { context.... | XATransactionalStore extends AbstractStore { public Element removeElement(Element element, ElementValueComparator comparator) throws NullPointerException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); if (previous != null && previous.getV... | XATransactionalStore extends AbstractStore { public Element removeElement(Element element, ElementValueComparator comparator) throws NullPointerException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); if (previous != null && previous.getV... | XATransactionalStore extends AbstractStore { public Element removeElement(Element element, ElementValueComparator comparator) throws NullPointerException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); if (previous != null && previous.getV... | XATransactionalStore extends AbstractStore { public Element removeElement(Element element, ElementValueComparator comparator) throws NullPointerException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); if (previous != null && previous.getV... |
@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, ElementValueComparator comparator) throws NullPointerException, IllegalArgumentException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); boolean replaced = false; if (previous != null &&... | XATransactionalStore extends AbstractStore { public boolean replace(Element old, Element element, ElementValueComparator comparator) throws NullPointerException, IllegalArgumentException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); bool... | XATransactionalStore extends AbstractStore { public boolean replace(Element old, Element element, ElementValueComparator comparator) throws NullPointerException, IllegalArgumentException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); bool... | XATransactionalStore extends AbstractStore { public boolean replace(Element old, Element element, ElementValueComparator comparator) throws NullPointerException, IllegalArgumentException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); bool... | XATransactionalStore extends AbstractStore { public boolean replace(Element old, Element element, ElementValueComparator comparator) throws NullPointerException, IllegalArgumentException { TransactionContext context = getOrCreateTransactionContext(); Element previous = getCurrentElement(element.getKey(), context); bool... |
@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.canInitialize()) { 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.canInitialize()) { 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.canInitialize()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(CacheConfiguration cacheConfiguration); Cache(... | Cache implements Ehcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!status.canInitialize()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(CacheConfiguration cacheConfiguration); Cache(... | Cache implements Ehcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!status.canInitialize()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(CacheConfiguration cacheConfiguration); Cache(... |
@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.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsInMemory() == 0) { LOG.warn("Cache: " + configuration.getName()... | Cache implements Ehcache, StoreListener { public void initialise() { synchronized (this) { if (!status.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsInMemory() == 0) { LO... | Cache implements Ehcache, StoreListener { public void initialise() { synchronized (this) { if (!status.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsInMemory() == 0) { LO... | Cache implements Ehcache, StoreListener { public void initialise() { synchronized (this) { if (!status.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsInMemory() == 0) { LO... | Cache implements Ehcache, StoreListener { public void initialise() { synchronized (this) { if (!status.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsInMemory() == 0) { LO... |
@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.getState()) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk = ").append(configuration.isOverflowToDisk... | Cache implements Ehcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(status.getState()) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk ... | Cache implements Ehcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(status.getState()) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk ... | Cache implements Ehcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(status.getState()) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk ... | Cache implements Ehcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(status.getState()) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk ... |
@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... |
@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 asynchronousLoad(final Object key, final CacheLoader specificLoader, final Object argument) { return getExecutorService().submit(new Runnable() { public void run() throws CacheException { try { boolean existsOnRun = isKeyInCache(key); if (!existsOnRun) { Object value; if (specificLoader == null) { if (registered... | Cache implements Ehcache, StoreListener { Future asynchronousLoad(final Object key, final CacheLoader specificLoader, final Object argument) { return getExecutorService().submit(new Runnable() { public void run() throws CacheException { try { boolean existsOnRun = isKeyInCache(key); if (!existsOnRun) { Object value; if... | Cache implements Ehcache, StoreListener { Future asynchronousLoad(final Object key, final CacheLoader specificLoader, final Object argument) { return getExecutorService().submit(new Runnable() { public void run() throws CacheException { try { boolean existsOnRun = isKeyInCache(key); if (!existsOnRun) { Object value; if... | Cache implements Ehcache, StoreListener { Future asynchronousLoad(final Object key, final CacheLoader specificLoader, final Object argument) { return getExecutorService().submit(new Runnable() { public void run() throws CacheException { try { boolean existsOnRun = isKeyInCache(key); if (!existsOnRun) { Object value; if... | Cache implements Ehcache, StoreListener { Future asynchronousLoad(final Object key, final CacheLoader specificLoader, final Object argument) { return getExecutorService().submit(new Runnable() { public void run() throws CacheException { try { boolean existsOnRun = isKeyInCache(key); if (!existsOnRun) { Object value; if... |
@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 = loadWithRegisteredLoaders(... | Cache implements Ehcache, 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.add(key)... | Cache implements Ehcache, 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.add(key)... | Cache implements Ehcache, 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.add(key)... | Cache implements Ehcache, 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.add(key)... |
@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 testAddCache() throws CacheException { singletonManager = CacheManager.create(); assertEquals(15, singletonManager.getConfiguration().getCacheConfigurations().size()); singletonManager.addCache("test"); singletonManager.addCache("test2"); assertEquals(17, singletonManager.getConfiguration().getCacheCo... | public 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"); } Ehcache clonedDefa... | CacheManager { public 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"); } Ehc... | CacheManager { public 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"); } Ehc... | CacheManager { public 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"); } Ehc... | CacheManager { public 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"); } Ehc... |
@Test public void testMultipleCacheManagers() { CacheManager[] managers = new CacheManager[2]; managers[0] = new CacheManager(makeCacheManagerConfig()); managers[1] = new CacheManager(makeCacheManagerConfig()); 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 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 testIsSerializable() { Element element = new Element(null, null); assertTrue(element.isSerializable()); Element elementWithNullValue = new Element("1", null); assertTrue(elementWithNullValue.isSerializable()); Element elementWithNullKey = new Element(null, "1"); assertTrue(elementWithNullValue.isSeria... | public final boolean isSerializable() { return isKeySerializable() && (value instanceof Serializable || value == null) && elementEvictionData.canParticipateInSerialization(); } | Element implements Serializable, Cloneable { public final boolean isSerializable() { return isKeySerializable() && (value instanceof Serializable || value == null) && elementEvictionData.canParticipateInSerialization(); } } | Element implements Serializable, Cloneable { public final boolean isSerializable() { return isKeySerializable() && (value instanceof Serializable || value == null) && elementEvictionData.canParticipateInSerialization(); } Element(final Serializable key, final Serializable value, final long version); Element(final Obje... | Element implements Serializable, Cloneable { public final boolean isSerializable() { return isKeySerializable() && (value instanceof Serializable || value == null) && elementEvictionData.canParticipateInSerialization(); } Element(final Serializable key, final Serializable value, final long version); Element(final Obje... | Element implements Serializable, Cloneable { public final boolean isSerializable() { return isKeySerializable() && (value instanceof Serializable || value == null) && elementEvictionData.canParticipateInSerialization(); } Element(final Serializable key, final Serializable value, final long version); Element(final Obje... |
@Test public void testEquals() { Element element = new Element("key", "value"); assertFalse(element.equals("dog")); assertTrue(element.equals(element)); assertFalse(element.equals(null)); assertFalse(element.equals(new Element("cat", "hat"))); } | @Override public final boolean equals(final Object object) { if (object == null || !(object instanceof Element)) { return false; } Element element = (Element) object; if (key == null || element.getObjectKey() == null) { return false; } return key.equals(element.getObjectKey()); } | Element implements Serializable, Cloneable { @Override public final boolean equals(final Object object) { if (object == null || !(object instanceof Element)) { return false; } Element element = (Element) object; if (key == null || element.getObjectKey() == null) { return false; } return key.equals(element.getObjectKey(... | Element implements Serializable, Cloneable { @Override public final boolean equals(final Object object) { if (object == null || !(object instanceof Element)) { return false; } Element element = (Element) object; if (key == null || element.getObjectKey() == null) { return false; } return key.equals(element.getObjectKey(... | Element implements Serializable, Cloneable { @Override public final boolean equals(final Object object) { if (object == null || !(object instanceof Element)) { return false; } Element element = (Element) object; if (key == null || element.getObjectKey() == null) { return false; } return key.equals(element.getObjectKey(... | Element implements Serializable, Cloneable { @Override public final boolean equals(final Object object) { if (object == null || !(object instanceof Element)) { return false; } Element element = (Element) object; if (key == null || element.getObjectKey() == null) { return false; } return key.equals(element.getObjectKey(... |
@Test public void testSizeOf() throws Exception { Assume.assumeThat(CURRENT_JVM_INFORMATION.getMinimumObjectSize(), is(CURRENT_JVM_INFORMATION.getObjectAlignment())); SizeOf sizeOf = new CrossCheckingSizeOf(); Assert.assertThat(deepSizeOf(sizeOf, TimeUnit.SECONDS), is(0L)); Assert.assertThat(deepSizeOf(sizeOf, Object.c... | 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 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 testMultipleCacheManagers() { CacheManager[] managers = new CacheManager[2]; managers[0] = new CacheManager(makeCacheManagerConfig()); managers[1] = new CacheManager(makeCacheManagerConfig()); 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 testOnHeapConsumption() throws Exception { SizeOf sizeOf = new CrossCheckingSizeOf(); int size = 80000; int perfectMatches = 0; 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(), n... | public Size deepSizeOf(int maxDepth, boolean abortWhenMaxDepthExceeded, Object... obj) { return new Size(walker.walk(maxDepth, abortWhenMaxDepthExceeded, obj), true); } | SizeOf { public Size deepSizeOf(int maxDepth, boolean abortWhenMaxDepthExceeded, Object... obj) { return new Size(walker.walk(maxDepth, abortWhenMaxDepthExceeded, obj), true); } } | SizeOf { public Size deepSizeOf(int maxDepth, boolean abortWhenMaxDepthExceeded, Object... obj) { return new Size(walker.walk(maxDepth, abortWhenMaxDepthExceeded, obj), true); } SizeOf(SizeOfFilter fieldFilter, boolean caching); } | SizeOf { public Size deepSizeOf(int maxDepth, boolean abortWhenMaxDepthExceeded, Object... obj) { return new Size(walker.walk(maxDepth, abortWhenMaxDepthExceeded, obj), true); } SizeOf(SizeOfFilter fieldFilter, boolean caching); abstract long sizeOf(Object obj); Size deepSizeOf(int maxDepth, boolean abortWhenMaxDepthEx... | SizeOf { public Size deepSizeOf(int maxDepth, boolean abortWhenMaxDepthExceeded, Object... obj) { return new Size(walker.walk(maxDepth, abortWhenMaxDepthExceeded, obj), true); } SizeOf(SizeOfFilter fieldFilter, boolean caching); abstract long sizeOf(Object obj); Size deepSizeOf(int maxDepth, boolean abortWhenMaxDepthEx... |
@Test public void testRefresh() throws Exception { final String value = "value"; final CountingCacheEntryFactory factory = new CountingCacheEntryFactory(value); selfPopulatingCache = new SelfPopulatingCache(cache, factory); assertEquals(value, selfPopulatingCache.get("key").getObjectValue()); assertEquals(1, factory.ge... | 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 testRegistrationServiceFourTrue() throws Exception { ManagementService.registerMBeans(manager, mBeanServer, true, true, true, true); assertEquals(OBJECTS_IN_TEST_EHCACHE, mBeanServer.queryNames(new ObjectName("net.sf.ehcache:*"), null).size()); } | public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementService registry = new ManagementService(cacheManager, mBean... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... |
@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 testRegistrationServiceFourTrueUsing14MBeanServer() throws Exception { mBeanServer = create14MBeanServer(); ManagementService.registerMBeans(manager, mBeanServer, true, true, true, true); assertEquals(OBJECTS_IN_TEST_EHCACHE, mBeanServer.queryNames(new ObjectName("net.sf.ehcache:*"), null).size()); } | public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementService registry = new ManagementService(cacheManager, mBean... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... |
@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 public void testProgrammaticConfigurationWorksProperlyWhenNoDefaultCacheConfigured() { Configuration mgrConfig = new Configuration(); mgrConfig.setUpdateCheck(false); new CacheManager(mgrConfig).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 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/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) { 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 testGetCache() throws CacheException { CacheManager manager = new CacheManager(new Configuration().cache(new CacheConfiguration("foo", 100))); try { assertNotNull(manager.getCache("foo")); } finally { manager.shutdown(); } } | public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); return ehcaches.get(name) instanceof Cache ? (Cache) ehcaches.get(name) : null; } | CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); return ehcaches.get(name) instanceof Cache ? (Cache) ehcaches.get(name) : null; } } | CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); return ehcaches.get(name) instanceof Cache ? (Cache) ehcaches.get(name) : null; } CacheManager(Configuration configuration); CacheManager(String configurationFileName); CacheManager(URL configurationURL... | CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); return ehcaches.get(name) instanceof Cache ? (Cache) ehcaches.get(name) : null; } CacheManager(Configuration configuration); CacheManager(String configurationFileName); CacheManager(URL configurationURL... | CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); return ehcaches.get(name) instanceof Cache ? (Cache) ehcaches.get(name) : null; } CacheManager(Configuration configuration); CacheManager(String configurationFileName); CacheManager(URL configurationURL... |
@Test public void testRemoveCache() throws CacheException { Configuration config = new Configuration().cache(new CacheConfiguration("foo", 100)); CacheManager manager = new CacheManager(config); try { assertEquals(1, manager.getConfiguration().getCacheConfigurations().size()); assertNotNull(manager.getCache("foo")); ma... | 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(); configuration.getCacheConf... | 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(); configurati... | 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(); configurati... | 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(); configurati... | 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(); configurati... |
@Test public void testAddCache() throws CacheException { Configuration config = new Configuration().defaultCache(new CacheConfiguration().maxElementsInMemory(0)); CacheManager manager = new CacheManager(config); try { assertEquals(0, manager.getConfiguration().getCacheConfigurations().size()); manager.addCache("test");... | 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() { Configuration config = new Configuration().defaultCache(new CacheConfiguration().maxElementsInMemory(100)); CacheManager manager = new CacheManager(config); try { manager.addCache("present"); assertThat(manager.addCacheIfAbsent(new Cache(new CacheConfiguration("present", 1000)... | 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 managerOne = new CacheManager(makeCacheManagerConfig()); try { new CacheManager(makeCacheManagerConfig()).shutdown(); } finally { managerOne.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 testRegistrationServiceFourTrueUsing14MBeanServerWithConstructorInjection() throws Exception { mBeanServer = create14MBeanServer(); ManagementService managementService = new ManagementService(manager, mBeanServer, true, true, true, true); managementService.init(); assertEquals(OBJECTS_IN_TEST_EHCACHE,... | public void init() throws CacheException { CacheManager cacheManager = new CacheManager(backingCacheManager); try { registerCacheManager(cacheManager); List caches = cacheManager.getCaches(); for (int i = 0; i < caches.size(); i++) { Cache cache = (Cache) caches.get(i); registerCachesIfRequired(cache); registerCacheSta... | ManagementService implements CacheManagerEventListener { public void init() throws CacheException { CacheManager cacheManager = new CacheManager(backingCacheManager); try { registerCacheManager(cacheManager); List caches = cacheManager.getCaches(); for (int i = 0; i < caches.size(); i++) { Cache cache = (Cache) caches.... | ManagementService implements CacheManagerEventListener { public void init() throws CacheException { CacheManager cacheManager = new CacheManager(backingCacheManager); try { registerCacheManager(cacheManager); List caches = cacheManager.getCaches(); for (int i = 0; i < caches.size(); i++) { Cache cache = (Cache) caches.... | ManagementService implements CacheManagerEventListener { public void init() throws CacheException { CacheManager cacheManager = new CacheManager(backingCacheManager); try { registerCacheManager(cacheManager); List caches = cacheManager.getCaches(); for (int i = 0; i < caches.size(); i++) { Cache cache = (Cache) caches.... | ManagementService implements CacheManagerEventListener { public void init() throws CacheException { CacheManager cacheManager = new CacheManager(backingCacheManager); try { registerCacheManager(cacheManager); List caches = cacheManager.getCaches(); for (int i = 0; i < caches.size(); i++) { Cache cache = (Cache) caches.... |
@Test public void testRegistrationServiceListensForCacheChanges() throws Exception { ManagementService.registerMBeans(manager, mBeanServer, true, true, true, true); assertEquals(OBJECTS_IN_TEST_EHCACHE, mBeanServer.queryNames(new ObjectName("net.sf.ehcache:*"), null).size()); manager.addCache("new cache"); assertEquals... | public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementService registry = new ManagementService(cacheManager, mBean... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... |
@Test public void testMultipleCacheManagers() throws Exception { ManagementService.registerMBeans(manager, mBeanServer, 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 + "ehcach... | public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementService registry = new ManagementService(cacheManager, mBean... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... |
@Test public void testStatisticsMBeanUpdatesAsStatsChange() throws Exception { ManagementService.registerMBeans(manager, mBeanServer, false, false, false, true); Ehcache cache = manager.getCache("sampleCache1"); ObjectName name = CacheStatistics.createObjectName(manager.getName(), cache.getName()); assertEquals(new Lon... | public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementService registry = new ManagementService(cacheManager, mBean... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... |
@Test public void testRegistrationServiceThreeTrue() throws Exception { ManagementService.registerMBeans(manager, mBeanServer, true, true, true, false); assertEquals(27, mBeanServer.queryNames(new ObjectName("net.sf.ehcache:*"), null).size()); } | public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementService registry = new ManagementService(cacheManager, mBean... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... |
@Test public void testRegistrationServiceTwoTrue() throws Exception { ManagementService.registerMBeans(manager, mBeanServer, true, true, false, false); assertEquals(14, mBeanServer.queryNames(new ObjectName("net.sf.ehcache:*"), null).size()); } | public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementService registry = new ManagementService(cacheManager, mBean... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... |
@Test public void testRegistrationServiceOneTrue() throws Exception { ManagementService.registerMBeans(manager, mBeanServer, true, false, false, false); assertEquals(1, mBeanServer.queryNames(new ObjectName("net.sf.ehcache:*"), null).size()); } | public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementService registry = new ManagementService(cacheManager, mBean... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... |
@Test public void testRegistrationServiceNoneTrue() throws Exception { ManagementService.registerMBeans(manager, mBeanServer, false, false, false, false); assertEquals(0, mBeanServer.queryNames(new ObjectName("net.sf.ehcache:*"), null).size()); } | public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementService registry = new ManagementService(cacheManager, mBean... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... |
@Test public void testRegisterCacheManager() throws Exception { Ehcache ehcache = new net.sf.ehcache.Cache("testNoOverflowToDisk", 1, false, true, 500, 200); manager.addCache(ehcache); ehcache.put(new Element("key1", "value1")); ehcache.put(new Element("key2", "value1")); assertNull(ehcache.get("key1")); assertNotNull(... | private void registerCacheManager(CacheManager cacheManager) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException { if (registerCacheManager) { mBeanServer.registerMBean(cacheManager, cacheManager.getObjectName()); } } | ManagementService implements CacheManagerEventListener { private void registerCacheManager(CacheManager cacheManager) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException { if (registerCacheManager) { mBeanServer.registerMBean(cacheManager, cacheManager.getObjectName()); } } } | ManagementService implements CacheManagerEventListener { private void registerCacheManager(CacheManager cacheManager) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException { if (registerCacheManager) { mBeanServer.registerMBean(cacheManager, cacheManager.getObjectName()); } } Man... | ManagementService implements CacheManagerEventListener { private void registerCacheManager(CacheManager cacheManager) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException { if (registerCacheManager) { mBeanServer.registerMBean(cacheManager, cacheManager.getObjectName()); } } Man... | ManagementService implements CacheManagerEventListener { private void registerCacheManager(CacheManager cacheManager) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException { if (registerCacheManager) { mBeanServer.registerMBean(cacheManager, cacheManager.getObjectName()); } } Man... |
@Test public void testListCachesFromManager() throws Exception { ManagementService.registerMBeans(manager, mBeanServer, true, false, false, false); Ehcache ehcache = manager.getCache("sampleCache1"); ehcache.put(new Element("key1", "value1")); ehcache.put(new Element("key2", "value1")); assertNotNull(ehcache.get("key1"... | public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementService registry = new ManagementService(cacheManager, mBean... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... |
@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 public void testJMXConnectorServer() throws Exception { ManagementService.registerMBeans(manager, mBeanServer, true, true, true, true); LocateRegistry.createRegistry(55000); String serverUrl = "service:jmx:rmi: JMXServiceURL url = new JMXServiceURL(serverUrl); JMXConnectorServer cs = JMXConnectorServerFactory.new... | public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementService registry = new ManagementService(cacheManager, mBean... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... | ManagementService implements CacheManagerEventListener { public static void registerMBeans( net.sf.ehcache.CacheManager cacheManager, MBeanServer mBeanServer, boolean registerCacheManager, boolean registerCaches, boolean registerCacheConfigurations, boolean registerCacheStatistics) throws CacheException { ManagementSer... |
@Test public void testFetch() throws Exception { LOG.log(Level.SEVERE, "."); System.out.println("-=-"); final Element element = selfPopulatingCache.get("key"); assertEquals("value", element.getValue()); } | 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 after " + tim... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... |
@Test public void testFetchUnknown() throws Exception { final CacheEntryFactory factory = new CountingCacheEntryFactory(null); selfPopulatingCache = new SelfPopulatingCache(cache, factory); assertNull(cache.get("key")); } | 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 after " + tim... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... |
@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 {... | 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 after " + tim... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... |
@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... | 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 after " + tim... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... |
@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 { Exception exception = null; Object keyWithException = null; final Collection keys = getKeys(); if (LOG.isLoggable(Level.FINE)) { LOG.fine(getName() + ": found " + keys.size() + " keys to refresh"); } for (Iterator iterator = keys.iterator(); iterator.hasNext();) { final Obj... | SelfPopulatingCache extends BlockingCache { public void refresh() throws CacheException { Exception exception = null; Object keyWithException = null; final Collection keys = getKeys(); if (LOG.isLoggable(Level.FINE)) { LOG.fine(getName() + ": found " + keys.size() + " keys to refresh"); } for (Iterator iterator = keys.... | SelfPopulatingCache extends BlockingCache { public void refresh() throws CacheException { Exception exception = null; Object keyWithException = null; final Collection keys = getKeys(); if (LOG.isLoggable(Level.FINE)) { LOG.fine(getName() + ": found " + keys.size() + " keys to refresh"); } for (Iterator iterator = keys.... | SelfPopulatingCache extends BlockingCache { public void refresh() throws CacheException { Exception exception = null; Object keyWithException = null; final Collection keys = getKeys(); if (LOG.isLoggable(Level.FINE)) { LOG.fine(getName() + ": found " + keys.size() + " keys to refresh"); } for (Iterator iterator = keys.... | SelfPopulatingCache extends BlockingCache { public void refresh() throws CacheException { Exception exception = null; Object keyWithException = null; final Collection keys = getKeys(); if (LOG.isLoggable(Level.FINE)) { LOG.fine(getName() + ": found " + keys.size() + " keys to refresh"); } for (Iterator iterator = keys.... |
@Test public void testCacheEntryFactoryReturningElementMake() throws Exception { final long SPECIAL_VERSION_NUMBER = 54321L; final CacheEntryFactory elementReturningFactory = new CacheEntryFactory() { public Object createEntry(final Object key) throws Exception { Element e = new Element(key, "V_" + key); e.setVersion(S... | 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 after " + tim... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... |
@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... | 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 after " + tim... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... | SelfPopulatingCache extends BlockingCache { 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 ... |
@Test public void testFetchAndUpdate() throws Exception { final String value = "value"; final CountingCacheEntryFactory factory = new CountingCacheEntryFactory(value); selfPopulatingCache = new UpdatingSelfPopulatingCache(cache, factory); Element element = selfPopulatingCache.get(null); element = selfPopulatingCache.ge... | public Element get(final Object key) throws LockTimeoutException { try { Ehcache backingCache = getCache(); Element element = backingCache.get(key); if (element == null) { element = super.get(key); } else { Mutex lock = stripedMutex.getMutexForKey(key); try { lock.acquire(); update(key); } finally { lock.release(); } }... | UpdatingSelfPopulatingCache extends SelfPopulatingCache { public Element get(final Object key) throws LockTimeoutException { try { Ehcache backingCache = getCache(); Element element = backingCache.get(key); if (element == null) { element = super.get(key); } else { Mutex lock = stripedMutex.getMutexForKey(key); try { lo... | UpdatingSelfPopulatingCache extends SelfPopulatingCache { public Element get(final Object key) throws LockTimeoutException { try { Ehcache backingCache = getCache(); Element element = backingCache.get(key); if (element == null) { element = super.get(key); } else { Mutex lock = stripedMutex.getMutexForKey(key); try { lo... | UpdatingSelfPopulatingCache extends SelfPopulatingCache { public Element get(final Object key) throws LockTimeoutException { try { Ehcache backingCache = getCache(); Element element = backingCache.get(key); if (element == null) { element = super.get(key); } else { Mutex lock = stripedMutex.getMutexForKey(key); try { lo... | UpdatingSelfPopulatingCache extends SelfPopulatingCache { public Element get(final Object key) throws LockTimeoutException { try { Ehcache backingCache = getCache(); Element element = backingCache.get(key); if (element == null) { element = super.get(key); } else { Mutex lock = stripedMutex.getMutexForKey(key); try { lo... |
@Test public void testFetchFail() throws Exception { final Exception exception = new Exception("Failed."); final UpdatingCacheEntryFactory factory = new UpdatingCacheEntryFactory() { public Object createEntry(final Object key) throws Exception { throw exception; } public void updateEntryValue(Object key, Object value) ... | public Element get(final Object key) throws LockTimeoutException { try { Ehcache backingCache = getCache(); Element element = backingCache.get(key); if (element == null) { element = super.get(key); } else { Mutex lock = stripedMutex.getMutexForKey(key); try { lock.acquire(); update(key); } finally { lock.release(); } }... | UpdatingSelfPopulatingCache extends SelfPopulatingCache { public Element get(final Object key) throws LockTimeoutException { try { Ehcache backingCache = getCache(); Element element = backingCache.get(key); if (element == null) { element = super.get(key); } else { Mutex lock = stripedMutex.getMutexForKey(key); try { lo... | UpdatingSelfPopulatingCache extends SelfPopulatingCache { public Element get(final Object key) throws LockTimeoutException { try { Ehcache backingCache = getCache(); Element element = backingCache.get(key); if (element == null) { element = super.get(key); } else { Mutex lock = stripedMutex.getMutexForKey(key); try { lo... | UpdatingSelfPopulatingCache extends SelfPopulatingCache { public Element get(final Object key) throws LockTimeoutException { try { Ehcache backingCache = getCache(); Element element = backingCache.get(key); if (element == null) { element = super.get(key); } else { Mutex lock = stripedMutex.getMutexForKey(key); try { lo... | UpdatingSelfPopulatingCache extends SelfPopulatingCache { public Element get(final Object key) throws LockTimeoutException { try { Ehcache backingCache = getCache(); Element element = backingCache.get(key); if (element == null) { element = super.get(key); } else { Mutex lock = stripedMutex.getMutexForKey(key); try { lo... |
@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 public void testDispose() throws Exception { clusteredStore.dispose(); verify(toolkitCacheInternal).disposeLocally(); verify(cacheCluster).removeTopologyListener(any(ClusterTopologyListener.class)); verify(toolkitCacheInternal).removeListener(any(ToolkitCacheListener.class)); } | @Override public void dispose() { dropLeaderStatus(); topology.removeTopologyListener(eventListenersRefresher); backend.removeListener(evictionListener); backend.disposeLocally(); cacheConfigChangeBridge.disconnectConfigs(); toolkitInstanceFactory.removeNonStopConfigforCache(cache); } | ClusteredStore implements TerracottaStore, StoreListener { @Override public void dispose() { dropLeaderStatus(); topology.removeTopologyListener(eventListenersRefresher); backend.removeListener(evictionListener); backend.disposeLocally(); cacheConfigChangeBridge.disconnectConfigs(); toolkitInstanceFactory.removeNonStop... | ClusteredStore implements TerracottaStore, StoreListener { @Override public void dispose() { dropLeaderStatus(); topology.removeTopologyListener(eventListenersRefresher); backend.removeListener(evictionListener); backend.disposeLocally(); cacheConfigChangeBridge.disconnectConfigs(); toolkitInstanceFactory.removeNonStop... | ClusteredStore implements TerracottaStore, StoreListener { @Override public void dispose() { dropLeaderStatus(); topology.removeTopologyListener(eventListenersRefresher); backend.removeListener(evictionListener); backend.disposeLocally(); cacheConfigChangeBridge.disconnectConfigs(); toolkitInstanceFactory.removeNonStop... | ClusteredStore implements TerracottaStore, StoreListener { @Override public void dispose() { dropLeaderStatus(); topology.removeTopologyListener(eventListenersRefresher); backend.removeListener(evictionListener); backend.disposeLocally(); cacheConfigChangeBridge.disconnectConfigs(); toolkitInstanceFactory.removeNonStop... |
@Test public void testCreateCacheStatisticSampleEntityDisablesNonStop() throws Exception { repositoryService.createCacheStatisticSampleEntity(Collections.singleton("testCacheManager"), Collections.singleton("testCache1"), Collections.singleton("Size")); verify(clusteredInstanceFactory, times(2)).enableNonStopForCurrent... | @Override public Collection<CacheStatisticSampleEntity> createCacheStatisticSampleEntity(Set<String> cacheManagerNames, Set<String> cacheNames, Set<String> sampleNames) { CacheStatisticSampleEntityBuilder builder = CacheStatisticSampleEntityBuilder.createWith(sampleNames); cacheManagerSamplerRepoLock.readLock().lock();... | DfltSamplerRepositoryService implements ManagementServerLifecycle,
EntityResourceFactory, CacheManagerService, CacheService, AgentService { @Override public Collection<CacheStatisticSampleEntity> createCacheStatisticSampleEntity(Set<String> cacheManagerNames, Set<String> cacheNames, Set<String> sampleNames) { Cache... | DfltSamplerRepositoryService implements ManagementServerLifecycle,
EntityResourceFactory, CacheManagerService, CacheService, AgentService { @Override public Collection<CacheStatisticSampleEntity> createCacheStatisticSampleEntity(Set<String> cacheManagerNames, Set<String> cacheNames, Set<String> sampleNames) { Cache... | DfltSamplerRepositoryService implements ManagementServerLifecycle,
EntityResourceFactory, CacheManagerService, CacheService, AgentService { @Override public Collection<CacheStatisticSampleEntity> createCacheStatisticSampleEntity(Set<String> cacheManagerNames, Set<String> cacheNames, Set<String> sampleNames) { Cache... | DfltSamplerRepositoryService implements ManagementServerLifecycle,
EntityResourceFactory, CacheManagerService, CacheService, AgentService { @Override public Collection<CacheStatisticSampleEntity> createCacheStatisticSampleEntity(Set<String> cacheManagerNames, Set<String> cacheNames, Set<String> sampleNames) { Cache... |
@Test public void testThrashBlockingCache() throws Exception { Ehcache cache = manager.getCache("sampleCache1"); blockingCache = new BlockingCache(cache); long duration = thrashCache(blockingCache, 50, 500L, 1000L); LOG.log(Level.FINE, "Thrash Duration:" + duration); } | protected Ehcache getCache() { return cache; } | BlockingCache implements Ehcache { protected Ehcache getCache() { return cache; } } | BlockingCache implements Ehcache { protected Ehcache getCache() { return cache; } BlockingCache(final Ehcache cache); } | BlockingCache implements Ehcache { protected Ehcache getCache() { return cache; } BlockingCache(final Ehcache cache); String getName(); void setName(String name); boolean isExpired(Element element); Object clone(); RegisteredEventListeners getCacheEventNotificationService(); boolean isElementInMemory(Serializable key);... | BlockingCache implements Ehcache { protected Ehcache getCache() { return cache; } BlockingCache(final Ehcache cache); String getName(); void setName(String name); boolean isExpired(Element element); Object clone(); RegisteredEventListeners getCacheEventNotificationService(); boolean isElementInMemory(Serializable key);... |
@Test public void testGetWithLoader() { super.testGetWithLoader(); } | public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { throw new CacheException("This method is not appropriate for a Blocking Cache"); } | BlockingCache implements Ehcache { public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { throw new CacheException("This method is not appropriate for a Blocking Cache"); } } | BlockingCache implements Ehcache { 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); } | BlockingCache implements Ehcache { 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); String getName(); void setName(String name); boolean isExp... | BlockingCache implements Ehcache { 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); String getName(); void setName(String name); boolean isExp... |
@Test public void testLoadConfigurationFromClasspath() throws Exception { Configuration configuration = ConfigurationFactory.parseConfiguration(); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals(System.getProperty("java.io.tmpdir"), configurationHelper.getDiskStor... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testLoadConfigurationFromFile() throws Exception { File file = new File(SRC_CONFIG_DIR + "ehcache.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals(System.getProper... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testLoadUTF8ConfigurationFromFile() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcacheUTF8.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); } | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testLoadConfigurationFromEhcache11File() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-1_1.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals(Sy... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@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."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@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."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@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."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@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 public void testLoadConfigurationFromFileDistribution() throws Exception { File file = new File(TEST_CONFIG_DIR + "distribution/ehcache-distributed1.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, config... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testLoadConfigurationFromFileNoBootstrapPropertiesSet() throws Exception { File file = new File(TEST_CONFIG_DIR + "distribution/ehcache-distributed1.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(man... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testLoadConfigurationFromFileWithSpecificPropertiesSet() throws Exception { File file = new File(TEST_CONFIG_DIR + "distribution/ehcache-distributed1.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(ma... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@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."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testDefaultValues() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-nodefault.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); Ehcache sampleCacheNoOptionalA... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@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 testLoadConfigurationFromFileNoDisk() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-nodisk.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals(nu... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testOptionalAttributeDefaultValues() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-nodisk.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals(nul... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testLoadConfigurationFromInputStream() throws Exception { InputStream fis = new FileInputStream(new File(SRC_CONFIG_DIR + "ehcache.xml").getAbsolutePath()); ConfigurationHelper configurationHelper; try { Configuration configuration = ConfigurationFactory.parseConfiguration(fis); configurationHelper = ... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@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; } if (this.standaloneRestServer != null) { try { standaloneRestServer.stop(); } catch (Exception e) { LOG.warn("Failed to shutdown the ManagementRESTService", e);... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } if (this.standaloneRestServer != null) { try { standaloneRestServer.stop(); } catch (Exception e) { LOG.warn("Failed to shutdown the ManagementRE... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } if (this.standaloneRestServer != null) { try { standaloneRestServer.stop(); } catch (Exception e) { LOG.warn("Failed to shutdown the ManagementRE... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } if (this.standaloneRestServer != null) { try { standaloneRestServer.stop(); } catch (Exception e) { LOG.warn("Failed to shutdown the ManagementRE... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } if (this.standaloneRestServer != null) { try { standaloneRestServer.stop(); } catch (Exception e) { LOG.warn("Failed to shutdown the ManagementRE... |
@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; } if (this.standaloneRestServer != null) { try { standaloneRestServer.stop(); } catch (Exception e) { LOG.warn("Failed to shutdown the ManagementRESTService", e);... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } if (this.standaloneRestServer != null) { try { standaloneRestServer.stop(); } catch (Exception e) { LOG.warn("Failed to shutdown the ManagementRE... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } if (this.standaloneRestServer != null) { try { standaloneRestServer.stop(); } catch (Exception e) { LOG.warn("Failed to shutdown the ManagementRE... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } if (this.standaloneRestServer != null) { try { standaloneRestServer.stop(); } catch (Exception e) { LOG.warn("Failed to shutdown the ManagementRE... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } if (this.standaloneRestServer != null) { try { standaloneRestServer.stop(); } catch (Exception e) { LOG.warn("Failed to shutdown the ManagementRE... |
@Test public void testLoadConfigurationFromFailsafe() throws Exception { try { File file = new File(AbstractCacheTest.TEST_CLASSES_DIR + "ehcache.xml"); file.renameTo(new File(AbstractCacheTest.TEST_CLASSES_DIR + "hideehcache.xml")); Configuration configuration = ConfigurationFactory.parseConfiguration(); Configuration... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@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; } if (this.standaloneRestServer != null) { try { standaloneRestServer.stop(); } catch (Exception e) { LOG.warn("Failed to shutdown the ManagementRESTService", e);... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } if (this.standaloneRestServer != null) { try { standaloneRestServer.stop(); } catch (Exception e) { LOG.warn("Failed to shutdown the ManagementRE... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } if (this.standaloneRestServer != null) { try { standaloneRestServer.stop(); } catch (Exception e) { LOG.warn("Failed to shutdown the ManagementRE... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } if (this.standaloneRestServer != null) { try { standaloneRestServer.stop(); } catch (Exception e) { LOG.warn("Failed to shutdown the ManagementRE... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } if (this.standaloneRestServer != null) { try { standaloneRestServer.stop(); } catch (Exception e) { LOG.warn("Failed to shutdown the ManagementRE... |
@Test public void testLoadConfigurationFromInvalidXMLFileWithDefaultCacheNameUsed() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-withdefaultset.xml"); try { Configuration configuration = ConfigurationFactory.parseConfiguration(file); } catch (CacheException e) { assertTrue(e.getMessage().contains(... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@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 testGetCaches() throws IOException, ParserConfigurationException, SAXException { HttpURLConnection result = HttpUtil.get("http: assertEquals(200, result.getResponseCode()); } | @GET public Caches getCaches() { LOG.info("GET Caches"); String[] cacheNames = CacheManager.getInstance().getCacheNames(); List<Cache> cacheList = new ArrayList<Cache>(); for (String cacheName : cacheNames) { URI cacheUri = uriInfo.getAbsolutePathBuilder().path(cacheName).build().normalize(); Cache cache = new Cache(ca... | CachesResource { @GET public Caches getCaches() { LOG.info("GET Caches"); String[] cacheNames = CacheManager.getInstance().getCacheNames(); List<Cache> cacheList = new ArrayList<Cache>(); for (String cacheName : cacheNames) { URI cacheUri = uriInfo.getAbsolutePathBuilder().path(cacheName).build().normalize(); Cache cac... | CachesResource { @GET public Caches getCaches() { LOG.info("GET Caches"); String[] cacheNames = CacheManager.getInstance().getCacheNames(); List<Cache> cacheList = new ArrayList<Cache>(); for (String cacheName : cacheNames) { URI cacheUri = uriInfo.getAbsolutePathBuilder().path(cacheName).build().normalize(); Cache cac... | CachesResource { @GET public Caches getCaches() { LOG.info("GET Caches"); String[] cacheNames = CacheManager.getInstance().getCacheNames(); List<Cache> cacheList = new ArrayList<Cache>(); for (String cacheName : cacheNames) { URI cacheUri = uriInfo.getAbsolutePathBuilder().path(cacheName).build().normalize(); Cache cac... | CachesResource { @GET public Caches getCaches() { LOG.info("GET Caches"); String[] cacheNames = CacheManager.getInstance().getCacheNames(); List<Cache> cacheList = new ArrayList<Cache>(); for (String cacheName : cacheNames) { URI cacheUri = uriInfo.getAbsolutePathBuilder().path(cacheName).build().normalize(); Cache cac... |
@Test public void testAddCache() throws CacheException_Exception, NoSuchCacheException_Exception, IllegalStateException_Exception, ObjectExistsException_Exception { cacheService.addCache("newcache1"); Cache cache = cacheService.getCache("newcache1"); assertNotNull(cache); try { cacheService.addCache("newcache1"); } cat... | @WebMethod public void addCache(String cacheName) throws IllegalStateException, ObjectExistsException, CacheException { manager.addCache(cacheName); } | EhcacheWebServiceEndpoint { @WebMethod public void addCache(String cacheName) throws IllegalStateException, ObjectExistsException, CacheException { manager.addCache(cacheName); } } | EhcacheWebServiceEndpoint { @WebMethod public void addCache(String cacheName) throws IllegalStateException, ObjectExistsException, CacheException { manager.addCache(cacheName); } } | EhcacheWebServiceEndpoint { @WebMethod public void addCache(String cacheName) throws IllegalStateException, ObjectExistsException, CacheException { manager.addCache(cacheName); } @WebMethod String ping(); @WebMethod Cache getCache(String cacheName); @WebMethod void addCache(String cacheName); @WebMethod void removeCac... | EhcacheWebServiceEndpoint { @WebMethod public void addCache(String cacheName) throws IllegalStateException, ObjectExistsException, CacheException { manager.addCache(cacheName); } @WebMethod String ping(); @WebMethod Cache getCache(String cacheName); @WebMethod void addCache(String cacheName); @WebMethod void removeCac... |
@Test public void testRemoveCache() throws CacheException_Exception, NoSuchCacheException_Exception, IllegalStateException_Exception, ObjectExistsException_Exception { cacheService.addCache("newcache2"); Cache cache = cacheService.getCache("newcache2"); assertNotNull(cache); cacheService.removeCache("newcache2"); cache... | @WebMethod public void removeCache(String cacheName) throws IllegalStateException { manager.removeCache(cacheName); } | EhcacheWebServiceEndpoint { @WebMethod public void removeCache(String cacheName) throws IllegalStateException { manager.removeCache(cacheName); } } | EhcacheWebServiceEndpoint { @WebMethod public void removeCache(String cacheName) throws IllegalStateException { manager.removeCache(cacheName); } } | EhcacheWebServiceEndpoint { @WebMethod public void removeCache(String cacheName) throws IllegalStateException { manager.removeCache(cacheName); } @WebMethod String ping(); @WebMethod Cache getCache(String cacheName); @WebMethod void addCache(String cacheName); @WebMethod void removeCache(String cacheName); @WebMethod ... | EhcacheWebServiceEndpoint { @WebMethod public void removeCache(String cacheName) throws IllegalStateException { manager.removeCache(cacheName); } @WebMethod String ping(); @WebMethod Cache getCache(String cacheName); @WebMethod void addCache(String cacheName); @WebMethod void removeCache(String cacheName); @WebMethod ... |
@Test public void testLoadConfigurationWithReplacement() throws Exception { System.setProperty("multicastGroupPort", "4446"); File file = new File(TEST_CONFIG_DIR + "ehcache-replacement.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new Conf... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuratio... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Con... |
@Test public void testCachePutNull() throws CacheException_Exception, NoSuchCacheException_Exception, IllegalStateException_Exception { Element element = new Element(); element.setKey("1"); cacheService.put("sampleCache1", element); element = getElementFromCache(); boolean equals = Arrays.equals(null, element.getValue(... | @WebMethod public void put(String cacheName, Element element) throws NoSuchCacheException, CacheException { net.sf.ehcache.Cache cache = lookupCache(cacheName); cache.put(element.getEhcacheElement()); } | EhcacheWebServiceEndpoint { @WebMethod public void put(String cacheName, Element element) throws NoSuchCacheException, CacheException { net.sf.ehcache.Cache cache = lookupCache(cacheName); cache.put(element.getEhcacheElement()); } } | EhcacheWebServiceEndpoint { @WebMethod public void put(String cacheName, Element element) throws NoSuchCacheException, CacheException { net.sf.ehcache.Cache cache = lookupCache(cacheName); cache.put(element.getEhcacheElement()); } } | EhcacheWebServiceEndpoint { @WebMethod public void put(String cacheName, Element element) throws NoSuchCacheException, CacheException { net.sf.ehcache.Cache cache = lookupCache(cacheName); cache.put(element.getEhcacheElement()); } @WebMethod String ping(); @WebMethod Cache getCache(String cacheName); @WebMethod void a... | EhcacheWebServiceEndpoint { @WebMethod public void put(String cacheName, Element element) throws NoSuchCacheException, CacheException { net.sf.ehcache.Cache cache = lookupCache(cacheName); cache.put(element.getEhcacheElement()); } @WebMethod String ping(); @WebMethod Cache getCache(String cacheName); @WebMethod void a... |
@Test public void testGetStatistics() throws NoSuchCacheException_Exception, CacheException_Exception, IllegalStateException_Exception { cacheService.clearStatistics("sampleCache1"); Statistics statistics = cacheService.getStatistics("sampleCache1"); assertEquals(0L, statistics.getCacheHits()); putElementIntoCache(); g... | @WebMethod public Statistics getStatistics(String cacheName) throws IllegalStateException { net.sf.ehcache.Cache cache = lookupCache(cacheName); return new Statistics(cache.getStatistics()); } | EhcacheWebServiceEndpoint { @WebMethod public Statistics getStatistics(String cacheName) throws IllegalStateException { net.sf.ehcache.Cache cache = lookupCache(cacheName); return new Statistics(cache.getStatistics()); } } | EhcacheWebServiceEndpoint { @WebMethod public Statistics getStatistics(String cacheName) throws IllegalStateException { net.sf.ehcache.Cache cache = lookupCache(cacheName); return new Statistics(cache.getStatistics()); } } | EhcacheWebServiceEndpoint { @WebMethod public Statistics getStatistics(String cacheName) throws IllegalStateException { net.sf.ehcache.Cache cache = lookupCache(cacheName); return new Statistics(cache.getStatistics()); } @WebMethod String ping(); @WebMethod Cache getCache(String cacheName); @WebMethod void addCache(St... | EhcacheWebServiceEndpoint { @WebMethod public Statistics getStatistics(String cacheName) throws IllegalStateException { net.sf.ehcache.Cache cache = lookupCache(cacheName); return new Statistics(cache.getStatistics()); } @WebMethod String ping(); @WebMethod Cache getCache(String cacheName); @WebMethod void addCache(St... |
@Test public void testClearStatistics() throws NoSuchCacheException_Exception, CacheException_Exception, IllegalStateException_Exception { putElementIntoCache(); getElementFromCache(); cacheService.clearStatistics("sampleCache1"); Statistics statistics = cacheService.getStatistics("sampleCache1"); assertEquals(0L, stat... | @WebMethod public void clearStatistics(String cacheName) { net.sf.ehcache.Cache cache = lookupCache(cacheName); cache.clearStatistics(); } | EhcacheWebServiceEndpoint { @WebMethod public void clearStatistics(String cacheName) { net.sf.ehcache.Cache cache = lookupCache(cacheName); cache.clearStatistics(); } } | EhcacheWebServiceEndpoint { @WebMethod public void clearStatistics(String cacheName) { net.sf.ehcache.Cache cache = lookupCache(cacheName); cache.clearStatistics(); } } | EhcacheWebServiceEndpoint { @WebMethod public void clearStatistics(String cacheName) { net.sf.ehcache.Cache cache = lookupCache(cacheName); cache.clearStatistics(); } @WebMethod String ping(); @WebMethod Cache getCache(String cacheName); @WebMethod void addCache(String cacheName); @WebMethod void removeCache(String ca... | EhcacheWebServiceEndpoint { @WebMethod public void clearStatistics(String cacheName) { net.sf.ehcache.Cache cache = lookupCache(cacheName); cache.clearStatistics(); } @WebMethod String ping(); @WebMethod Cache getCache(String cacheName); @WebMethod void addCache(String cacheName); @WebMethod void removeCache(String ca... |
@Test public void testGetWithLoad() throws NoSuchCacheException_Exception, CacheException_Exception, IllegalStateException_Exception { cacheService.getWithLoader("sampleCache1", "2"); } | @WebMethod public Element getWithLoader(String cacheName, String key) throws NoSuchCacheException { net.sf.ehcache.Cache cache = lookupCache(cacheName); net.sf.ehcache.Element element = cache.getWithLoader(key, null, null); if (element != null) { return new Element(element); } else { return null; } } | EhcacheWebServiceEndpoint { @WebMethod public Element getWithLoader(String cacheName, String key) throws NoSuchCacheException { net.sf.ehcache.Cache cache = lookupCache(cacheName); net.sf.ehcache.Element element = cache.getWithLoader(key, null, null); if (element != null) { return new Element(element); } else { return ... | EhcacheWebServiceEndpoint { @WebMethod public Element getWithLoader(String cacheName, String key) throws NoSuchCacheException { net.sf.ehcache.Cache cache = lookupCache(cacheName); net.sf.ehcache.Element element = cache.getWithLoader(key, null, null); if (element != null) { return new Element(element); } else { return ... | EhcacheWebServiceEndpoint { @WebMethod public Element getWithLoader(String cacheName, String key) throws NoSuchCacheException { net.sf.ehcache.Cache cache = lookupCache(cacheName); net.sf.ehcache.Element element = cache.getWithLoader(key, null, null); if (element != null) { return new Element(element); } else { return ... | EhcacheWebServiceEndpoint { @WebMethod public Element getWithLoader(String cacheName, String key) throws NoSuchCacheException { net.sf.ehcache.Cache cache = lookupCache(cacheName); net.sf.ehcache.Element element = cache.getWithLoader(key, null, null); if (element != null) { return new Element(element); } else { return ... |
@Test public void testStripingDistribution() { int[] lockIndexes = new int[2048]; for (int i = 0; i < 20480 * 3; i++) { String key = "" + i * 3 / 2 + i; key += key.hashCode(); int lock = ConcurrencyUtil.selectLock(key, 2048); lockIndexes[lock]++; } int outliers = 0; for (int i = 0; i < 2048; i++) { if (20 <= lockIndexe... | public static int selectLock(final Object key, int numberOfLocks) throws CacheException { int number = numberOfLocks & (numberOfLocks - 1); if (number != 0) { throw new CacheException("Lock number must be a power of two: " + numberOfLocks); } if (key == null) { return 0; } else { int hash = hash(key) & (numberOfLocks -... | ConcurrencyUtil { public static int selectLock(final Object key, int numberOfLocks) throws CacheException { int number = numberOfLocks & (numberOfLocks - 1); if (number != 0) { throw new CacheException("Lock number must be a power of two: " + numberOfLocks); } if (key == null) { return 0; } else { int hash = hash(key) ... | ConcurrencyUtil { public static int selectLock(final Object key, int numberOfLocks) throws CacheException { int number = numberOfLocks & (numberOfLocks - 1); if (number != 0) { throw new CacheException("Lock number must be a power of two: " + numberOfLocks); } if (key == null) { return 0; } else { int hash = hash(key) ... | ConcurrencyUtil { public static int selectLock(final Object key, int numberOfLocks) throws CacheException { int number = numberOfLocks & (numberOfLocks - 1); if (number != 0) { throw new CacheException("Lock number must be a power of two: " + numberOfLocks); } if (key == null) { return 0; } else { int hash = hash(key) ... | ConcurrencyUtil { public static int selectLock(final Object key, int numberOfLocks) throws CacheException { int number = numberOfLocks & (numberOfLocks - 1); if (number != 0) { throw new CacheException("Lock number must be a power of two: " + numberOfLocks); } if (key == null) { return 0; } else { int hash = hash(key) ... |
@Test public void testEqualsPerformance() { StopWatch stopWatch = new StopWatch(); stopWatch.getElapsedTime(); Status status2 = Status.STATUS_SHUTDOWN; for (int i = 0; i < 10000; i++) { status1.equals(status2); } stopWatch.getElapsedTime(); for (int i = 0; i < 10000; i++) { status1.equals(status2); } long statusCompare... | public boolean equals(Object object) { if (!(object instanceof Status)) { return false; } return ((Status) object).intValue == intValue; } | Status implements Serializable { public boolean equals(Object object) { if (!(object instanceof Status)) { return false; } return ((Status) object).intValue == intValue; } } | Status implements Serializable { public boolean equals(Object object) { if (!(object instanceof Status)) { return false; } return ((Status) object).intValue == intValue; } private Status(int intValue, String name); } | Status implements Serializable { public boolean equals(Object object) { if (!(object instanceof Status)) { return false; } return ((Status) object).intValue == intValue; } private Status(int intValue, String name); String toString(); static Status convertIntToStatus(int statusAsInt); int intValue(); boolean equals(Obj... | Status implements Serializable { public boolean equals(Object object) { if (!(object instanceof Status)) { return false; } return ((Status) object).intValue == intValue; } private Status(int intValue, String name); String toString(); static Status convertIntToStatus(int statusAsInt); int intValue(); boolean equals(Obj... |
@Test public void testObjectEqualsPerformance() { StopWatch stopWatch = new StopWatch(); stopWatch.getElapsedTime(); Object object = new Object(); for (int i = 0; i < 10000; i++) { status1.equals(object); } stopWatch.getElapsedTime(); for (int i = 0; i < 10000; i++) { status1.equals(object); } long objectCompareTime = ... | public boolean equals(Object object) { if (!(object instanceof Status)) { return false; } return ((Status) object).intValue == intValue; } | Status implements Serializable { public boolean equals(Object object) { if (!(object instanceof Status)) { return false; } return ((Status) object).intValue == intValue; } } | Status implements Serializable { public boolean equals(Object object) { if (!(object instanceof Status)) { return false; } return ((Status) object).intValue == intValue; } private Status(int intValue, String name); } | Status implements Serializable { public boolean equals(Object object) { if (!(object instanceof Status)) { return false; } return ((Status) object).intValue == intValue; } private Status(int intValue, String name); String toString(); static Status convertIntToStatus(int statusAsInt); int intValue(); boolean equals(Obj... | Status implements Serializable { public boolean equals(Object object) { if (!(object instanceof Status)) { return false; } return ((Status) object).intValue == intValue; } private Status(int intValue, String name); String toString(); static Status convertIntToStatus(int statusAsInt); int intValue(); boolean equals(Obj... |
@Test public void testAdjustsMemPoolSizeDynamically() throws Exception { Configuration configuration = new Configuration(); CacheManager cacheManager = new CacheManager(configuration.maxBytesLocalHeap(10, MemoryUnit.MEGABYTES).name("new-cacheManager")); CacheConfiguration cacheConfiguration = new CacheConfiguration("th... | 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 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 unitialised caches can have their names set."); } configuration.setName(name); } | Cache implements Ehcache { public final void setName(String name) throws IllegalArgumentException { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Only unitialised caches can have their names set."); } configuration.setName(name); } } | Cache implements Ehcache { public final void setName(String name) throws IllegalArgumentException { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Only unitialised caches can have their names set."); } configuration.setName(name); } Cache(String name, int maxElementsInMemory, boolea... | Cache implements Ehcache { public final void setName(String name) throws IllegalArgumentException { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Only unitialised caches can have their names set."); } configuration.setName(name); } Cache(String name, int maxElementsInMemory, boolea... | Cache implements Ehcache { public final void setName(String name) throws IllegalArgumentException { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Only unitialised caches can have their names set."); } configuration.setName(name); } Cache(String name, int maxElementsInMemory, boolea... |
@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) { if (LOG.isLoggable(Level... | Cache implements Ehcache { 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)... | Cache implements Ehcache { 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)... | Cache implements Ehcache { 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)... | Cache implements Ehcache { 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)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.