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 testMonitoringOn() { File file = new File(TEST_CONFIG_DIR + "ehcache-monitoring-on.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals(Configuration.Monitoring.ON, co... | 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 testMonitoringOff() { File file = new File(TEST_CONFIG_DIR + "ehcache-monitoring-off.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals(Configuration.Monitoring.OFF,... | 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 testMonitoringAutodetect() { File file = new File(TEST_CONFIG_DIR + "ehcache-monitoring-autodetect.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals(Configuration.M... | 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 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)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPee... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... |
@Test public void testCacheManagerThreads() throws CacheException, InterruptedException { singletonManager = CacheManager .create(AbstractCacheTest.TEST_CONFIG_DIR + "ehcache-big.xml"); int threads = countThreads(); assertTrue("More than 145 threads: " + threads, countThreads() <= 145); } | public static CacheManager create() throws CacheException { if (singleton != null) { return singleton; } synchronized (CacheManager.class) { if (singleton == null) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Creating new CacheManager with default config"); } singleton = new CacheManager(); } else { if (LOG... | CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { return singleton; } synchronized (CacheManager.class) { if (singleton == null) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Creating new CacheManager with default config"); } singleton = new CacheManager(); }... | CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { return singleton; } synchronized (CacheManager.class) { if (singleton == null) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Creating new CacheManager with default config"); } singleton = new CacheManager(); }... | CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { return singleton; } synchronized (CacheManager.class) { if (singleton == null) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Creating new CacheManager with default config"); } singleton = new CacheManager(); }... | CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { return singleton; } synchronized (CacheManager.class) { if (singleton == null) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Creating new CacheManager with default config"); } singleton = new CacheManager(); }... |
@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)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPee... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... |
@Test public void testSerializationPerformanceByteArray() throws CacheException { Serializable key = "key"; ByteArrayOutputStream bout = new ByteArrayOutputStream(); for (int j = 0; j < 10000; j++) { try { bout.write("abcdefghijklmnopqrstv1234567890".getBytes()); } catch (IOException e) { LOG.log(Level.SEVERE, "This sh... | public final long getSerializedSize() { if (!isSerializable()) { return 0; } long size = 0; ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(bout); oos.writeObject(this); size = bout.size(); return size; } catch (IOException e) { LOG.log(Level.F... | Element implements Serializable, Cloneable { public final long getSerializedSize() { if (!isSerializable()) { return 0; } long size = 0; ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(bout); oos.writeObject(this); size = bout.size(); return si... | Element implements Serializable, Cloneable { public final long getSerializedSize() { if (!isSerializable()) { return 0; } long size = 0; ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(bout); oos.writeObject(this); size = bout.size(); return si... | Element implements Serializable, Cloneable { public final long getSerializedSize() { if (!isSerializable()) { return 0; } long size = 0; ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(bout); oos.writeObject(this); size = bout.size(); return si... | Element implements Serializable, Cloneable { public final long getSerializedSize() { if (!isSerializable()) { return 0; } long size = 0; ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(bout); oos.writeObject(this); size = bout.size(); return si... |
@Test public void testSerializationPerformanceJavaObjects() throws Exception { HashMap map = new HashMap(10000); for (int j = 0; j < 10000; j++) { map.put("key" + j, new String[]{"adfdafs", "asdfdsafa", "sdfasdf"}); } Element element = new Element("key1", map); StopWatch stopWatch = new StopWatch(); for (int i = 0; i <... | public final long getSerializedSize() { if (!isSerializable()) { return 0; } long size = 0; ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(bout); oos.writeObject(this); size = bout.size(); return size; } catch (IOException e) { LOG.log(Level.F... | Element implements Serializable, Cloneable { public final long getSerializedSize() { if (!isSerializable()) { return 0; } long size = 0; ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(bout); oos.writeObject(this); size = bout.size(); return si... | Element implements Serializable, Cloneable { public final long getSerializedSize() { if (!isSerializable()) { return 0; } long size = 0; ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(bout); oos.writeObject(this); size = bout.size(); return si... | Element implements Serializable, Cloneable { public final long getSerializedSize() { if (!isSerializable()) { return 0; } long size = 0; ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(bout); oos.writeObject(this); size = bout.size(); return si... | Element implements Serializable, Cloneable { public final long getSerializedSize() { if (!isSerializable()) { return 0; } long size = 0; ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(bout); oos.writeObject(this); size = bout.size(); return si... |
@Test public void testLoadConfigurationFromFileUnloadableCacheManagerListenerDefault() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-unloadablecachemanagerlistenerclass.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testLoadConfigurationFromFileCountingCacheListener() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-countinglisteners.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, confi... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testLoadConfigurationFromFileDistribution() throws Exception { File file = new File(TEST_CONFIG_DIR + "distribution/ehcache-distributed.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configu... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testGetClasses() throws Exception { List<String> classpathElements = getClasspathElements(); ApplicationEhCache applicationEhCache = new ApplicationEhCache(); Set<Class<?>> applicationClasses = applicationEhCache.getClasses(); Set<Class<?>> allClassesFound = new HashSet<Class<?>>(); for (String cpElem... | @Override public Set<Class<?>> getClasses() { Set<Class<?>> s = new HashSet<Class<?>>(super.getClasses()); s.add(net.sf.ehcache.management.resource.services.ElementsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheStatisticSamplesResourceServiceImpl.class); s.add(net.sf.ehcache.managem... | ApplicationEhCache extends DefaultApplication { @Override public Set<Class<?>> getClasses() { Set<Class<?>> s = new HashSet<Class<?>>(super.getClasses()); s.add(net.sf.ehcache.management.resource.services.ElementsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheStatisticSamplesResource... | ApplicationEhCache extends DefaultApplication { @Override public Set<Class<?>> getClasses() { Set<Class<?>> s = new HashSet<Class<?>>(super.getClasses()); s.add(net.sf.ehcache.management.resource.services.ElementsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheStatisticSamplesResource... | ApplicationEhCache extends DefaultApplication { @Override public Set<Class<?>> getClasses() { Set<Class<?>> s = new HashSet<Class<?>>(super.getClasses()); s.add(net.sf.ehcache.management.resource.services.ElementsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheStatisticSamplesResource... | ApplicationEhCache extends DefaultApplication { @Override public Set<Class<?>> getClasses() { Set<Class<?>> s = new HashSet<Class<?>>(super.getClasses()); s.add(net.sf.ehcache.management.resource.services.ElementsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheStatisticSamplesResource... |
@Test public void testConfigurationCannotBeSharedAcrossRunningCacheManagers() { Configuration configuration = new Configuration(); configuration.setupFor(mock(CacheManager.class), "one"); try { configuration.setupFor(mock(CacheManager.class), "two"); } catch (IllegalStateException e) { assertThat(e.getMessage(), contai... | public RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName) throws InvalidConfigurationException { if (cfg != null) { return cfg; } final Collection<ConfigError> errors = validate(); if (!errors.isEmpty()) { throw new InvalidConfigurationException(errors); } cfg = new Configuration.RuntimeCfg... | Configuration { public RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName) throws InvalidConfigurationException { if (cfg != null) { return cfg; } final Collection<ConfigError> errors = validate(); if (!errors.isEmpty()) { throw new InvalidConfigurationException(errors); } cfg = new Configur... | Configuration { public RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName) throws InvalidConfigurationException { if (cfg != null) { return cfg; } final Collection<ConfigError> errors = validate(); if (!errors.isEmpty()) { throw new InvalidConfigurationException(errors); } cfg = new Configur... | Configuration { public RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName) throws InvalidConfigurationException { if (cfg != null) { return cfg; } final Collection<ConfigError> errors = validate(); if (!errors.isEmpty()) { throw new InvalidConfigurationException(errors); } cfg = new Configur... | Configuration { public RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName) throws InvalidConfigurationException { if (cfg != null) { return cfg; } final Collection<ConfigError> errors = validate(); if (!errors.isEmpty()) { throw new InvalidConfigurationException(errors); } cfg = new Configur... |
@Test public void testNullingTerracottaConfiguration() { Configuration config = new Configuration(); config.addTerracottaConfig(new TerracottaClientConfiguration()); try { config.addTerracottaConfig(new TerracottaClientConfiguration()); throw new AssertionError(); } catch (ObjectExistsException oee) { } config.addTerra... | public final void addTerracottaConfig(TerracottaClientConfiguration terracottaConfiguration) throws ObjectExistsException { if (this.terracottaConfigConfiguration != null && terracottaConfiguration != null) { throw new ObjectExistsException("The TerracottaConfig has already been configured"); } final String prop = "ter... | Configuration { public final void addTerracottaConfig(TerracottaClientConfiguration terracottaConfiguration) throws ObjectExistsException { if (this.terracottaConfigConfiguration != null && terracottaConfiguration != null) { throw new ObjectExistsException("The TerracottaConfig has already been configured"); } final St... | Configuration { public final void addTerracottaConfig(TerracottaClientConfiguration terracottaConfiguration) throws ObjectExistsException { if (this.terracottaConfigConfiguration != null && terracottaConfiguration != null) { throw new ObjectExistsException("The TerracottaConfig has already been configured"); } final St... | Configuration { public final void addTerracottaConfig(TerracottaClientConfiguration terracottaConfiguration) throws ObjectExistsException { if (this.terracottaConfigConfiguration != null && terracottaConfiguration != null) { throw new ObjectExistsException("The TerracottaConfig has already been configured"); } final St... | Configuration { public final void addTerracottaConfig(TerracottaClientConfiguration terracottaConfiguration) throws ObjectExistsException { if (this.terracottaConfigConfiguration != null && terracottaConfiguration != null) { throw new ObjectExistsException("The TerracottaConfig has already been configured"); } final St... |
@Test public void testConfigurationCanBeReusedAfterCacheManagerShutdown() { Configuration configuration = new Configuration(); CacheManager mock = mock(CacheManager.class); when(mock.getStatus()).thenReturn(Status.STATUS_SHUTDOWN); configuration.setupFor(mock, "one"); configuration.setupFor(mock(CacheManager.class), "t... | public RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName) throws InvalidConfigurationException { if (cfg != null) { return cfg; } final Collection<ConfigError> errors = validate(); if (!errors.isEmpty()) { throw new InvalidConfigurationException(errors); } cfg = new Configuration.RuntimeCfg... | Configuration { public RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName) throws InvalidConfigurationException { if (cfg != null) { return cfg; } final Collection<ConfigError> errors = validate(); if (!errors.isEmpty()) { throw new InvalidConfigurationException(errors); } cfg = new Configur... | Configuration { public RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName) throws InvalidConfigurationException { if (cfg != null) { return cfg; } final Collection<ConfigError> errors = validate(); if (!errors.isEmpty()) { throw new InvalidConfigurationException(errors); } cfg = new Configur... | Configuration { public RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName) throws InvalidConfigurationException { if (cfg != null) { return cfg; } final Collection<ConfigError> errors = validate(); if (!errors.isEmpty()) { throw new InvalidConfigurationException(errors); } cfg = new Configur... | Configuration { public RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName) throws InvalidConfigurationException { if (cfg != null) { return cfg; } final Collection<ConfigError> errors = validate(); if (!errors.isEmpty()) { throw new InvalidConfigurationException(errors); } cfg = new Configur... |
@Test public void testCleanup() throws Exception { Configuration configuration = new Configuration(); CacheManager cacheManager = mock(CacheManager.class); Configuration.RuntimeCfg runtimeCfg1 = configuration.setupFor(cacheManager, "initial CacheManager"); configuration.cleanup(); Configuration.RuntimeCfg runtimeCfg2 =... | public void cleanup() { propertyChangeListeners.remove(cfg); cfg = null; } | Configuration { public void cleanup() { propertyChangeListeners.remove(cfg); cfg = null; } } | Configuration { public void cleanup() { propertyChangeListeners.remove(cfg); cfg = null; } Configuration(); } | Configuration { public void cleanup() { propertyChangeListeners.remove(cfg); cfg = null; } Configuration(); RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName); Collection<ConfigError> validate(); boolean isMaxBytesLocalDiskSet(); boolean isMaxBytesLocalOffHeapSet(); boolean isMaxBytesLocalH... | Configuration { public void cleanup() { propertyChangeListeners.remove(cfg); cfg = null; } Configuration(); RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName); Collection<ConfigError> validate(); boolean isMaxBytesLocalDiskSet(); boolean isMaxBytesLocalOffHeapSet(); boolean isMaxBytesLocalH... |
@Test public void testaddCurrentOrchestrator() throws Exception { final String ORCHESTRATOR = "localhost:1000"; final String WAN_CURRENT_ORCHESTRATOR = "__WAN__CURRENT_ORCHESTRATOR"; wanUtil.addCurrentOrchestrator(CACHE_MANAGER_NAME, CACHE_NAME, ORCHESTRATOR); Assert.assertEquals(cacheConfigMap.get(WAN_CURRENT_ORCHESTR... | public void addCurrentOrchestrator(String cacheManagerName, String cacheName, String orchestrator) { final ConcurrentMap<String, Serializable> cacheConfigMap = getCacheConfigMap(cacheManagerName, cacheName); cacheConfigMap.put(WAN_CURRENT_ORCHESTRATOR, orchestrator); LOGGER.info("Added '{}' as orchestrator for Cache '{... | WANUtil { public void addCurrentOrchestrator(String cacheManagerName, String cacheName, String orchestrator) { final ConcurrentMap<String, Serializable> cacheConfigMap = getCacheConfigMap(cacheManagerName, cacheName); cacheConfigMap.put(WAN_CURRENT_ORCHESTRATOR, orchestrator); LOGGER.info("Added '{}' as orchestrator fo... | WANUtil { public void addCurrentOrchestrator(String cacheManagerName, String cacheName, String orchestrator) { final ConcurrentMap<String, Serializable> cacheConfigMap = getCacheConfigMap(cacheManagerName, cacheName); cacheConfigMap.put(WAN_CURRENT_ORCHESTRATOR, orchestrator); LOGGER.info("Added '{}' as orchestrator fo... | WANUtil { public void addCurrentOrchestrator(String cacheManagerName, String cacheName, String orchestrator) { final ConcurrentMap<String, Serializable> cacheConfigMap = getCacheConfigMap(cacheManagerName, cacheName); cacheConfigMap.put(WAN_CURRENT_ORCHESTRATOR, orchestrator); LOGGER.info("Added '{}' as orchestrator fo... | WANUtil { public void addCurrentOrchestrator(String cacheManagerName, String cacheName, String orchestrator) { final ConcurrentMap<String, Serializable> cacheConfigMap = getCacheConfigMap(cacheManagerName, cacheName); cacheConfigMap.put(WAN_CURRENT_ORCHESTRATOR, orchestrator); LOGGER.info("Added '{}' as orchestrator fo... |
@Test public void testLoadConfigurationFromFileNoBootstrapPropertiesSet() throws Exception { File file = new File(TEST_CONFIG_DIR + "distribution/ehcache-distributed.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(mana... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void given_clustered_cache__cacheSampler_getSize_returns_quick_size() throws Exception { cacheConfiguration.terracotta(new TerracottaConfiguration().clustered(true)); CacheSamplerImpl cacheSampler = new CacheSamplerImpl(cache); assertThat(cacheSampler.getSize(), equalTo(QUICK_SIZE)); } | @Override public long getSize() { if (cache.getCacheConfiguration().isTerracottaClustered()) { return getRemoteSizeSample().getMostRecentSample().getCounterValue(); } CacheTransactionHelper.beginTransactionIfNeeded(cache); try { return cache.getStatistics().getSize(); } catch (RuntimeException e) { throw Utils.newPlain... | CacheSamplerImpl implements CacheSampler, CacheConfigurationListener { @Override public long getSize() { if (cache.getCacheConfiguration().isTerracottaClustered()) { return getRemoteSizeSample().getMostRecentSample().getCounterValue(); } CacheTransactionHelper.beginTransactionIfNeeded(cache); try { return cache.getStat... | CacheSamplerImpl implements CacheSampler, CacheConfigurationListener { @Override public long getSize() { if (cache.getCacheConfiguration().isTerracottaClustered()) { return getRemoteSizeSample().getMostRecentSample().getCounterValue(); } CacheTransactionHelper.beginTransactionIfNeeded(cache); try { return cache.getStat... | CacheSamplerImpl implements CacheSampler, CacheConfigurationListener { @Override public long getSize() { if (cache.getCacheConfiguration().isTerracottaClustered()) { return getRemoteSizeSample().getMostRecentSample().getCounterValue(); } CacheTransactionHelper.beginTransactionIfNeeded(cache); try { return cache.getStat... | CacheSamplerImpl implements CacheSampler, CacheConfigurationListener { @Override public long getSize() { if (cache.getCacheConfiguration().isTerracottaClustered()) { return getRemoteSizeSample().getMostRecentSample().getCounterValue(); } CacheTransactionHelper.beginTransactionIfNeeded(cache); try { return cache.getStat... |
@Test public void given_unclustered_cache__cacheSampler_getSize_returns_exact_size() throws Exception { cacheConfiguration.terracotta(new TerracottaConfiguration().clustered(false)); CacheSamplerImpl cacheSampler = new CacheSamplerImpl(cache); assertThat(cacheSampler.getSize(), equalTo(EXACT_SIZE)); } | @Override public long getSize() { if (cache.getCacheConfiguration().isTerracottaClustered()) { return getRemoteSizeSample().getMostRecentSample().getCounterValue(); } CacheTransactionHelper.beginTransactionIfNeeded(cache); try { return cache.getStatistics().getSize(); } catch (RuntimeException e) { throw Utils.newPlain... | CacheSamplerImpl implements CacheSampler, CacheConfigurationListener { @Override public long getSize() { if (cache.getCacheConfiguration().isTerracottaClustered()) { return getRemoteSizeSample().getMostRecentSample().getCounterValue(); } CacheTransactionHelper.beginTransactionIfNeeded(cache); try { return cache.getStat... | CacheSamplerImpl implements CacheSampler, CacheConfigurationListener { @Override public long getSize() { if (cache.getCacheConfiguration().isTerracottaClustered()) { return getRemoteSizeSample().getMostRecentSample().getCounterValue(); } CacheTransactionHelper.beginTransactionIfNeeded(cache); try { return cache.getStat... | CacheSamplerImpl implements CacheSampler, CacheConfigurationListener { @Override public long getSize() { if (cache.getCacheConfiguration().isTerracottaClustered()) { return getRemoteSizeSample().getMostRecentSample().getCounterValue(); } CacheTransactionHelper.beginTransactionIfNeeded(cache); try { return cache.getStat... | CacheSamplerImpl implements CacheSampler, CacheConfigurationListener { @Override public long getSize() { if (cache.getCacheConfiguration().isTerracottaClustered()) { return getRemoteSizeSample().getMostRecentSample().getCounterValue(); } CacheTransactionHelper.beginTransactionIfNeeded(cache); try { return cache.getStat... |
@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 testAdjustsMemAndDiskPoolSizeDynamically() throws Exception { Configuration configuration = new Configuration() .maxBytesLocalHeap(10, MemoryUnit.MEGABYTES) .maxBytesLocalDisk(10, MemoryUnit.MEGABYTES) .name("new-cacheManager"); CacheManager cacheManager = new CacheManager(configuration); CacheConfigu... | public CacheConfiguration getCacheConfiguration() { return configuration; } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } } | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... | Cache implements InternalEhcache, StoreListener { public CacheConfiguration getCacheConfiguration() { return configuration; } Cache(CacheConfiguration cacheConfiguration); Cache(CacheConfiguration cacheConfiguration,
RegisteredEventListeners registeredEventListeners,
BootstrapCacheLoa... |
@Test public void testInitialiseFailures() { final String name = "testInitialiseFailures2"; Cache cache = new Cache(name, 1, false, false, 5, 1); manager.addCache(cache); try { cache.initialise(); fail("Calling cache.initialise() multiple times should fail with IllegalStateException"); } catch (IllegalStateException e)... | public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } final Pool onHeapPool; if (configuration.getMaxBytesLocalHeap() > 0) { PoolEvictor evictor... | Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } final Pool onHeapPool; if (configuration... | Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } final Pool onHeapPool; if (configuration... | Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } final Pool onHeapPool; if (configuration... | Cache implements InternalEhcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } final Pool onHeapPool; if (configuration... |
@Test public void testLoadConfigurationFromFileWithSpecificPropertiesSet() throws Exception { File file = new File(TEST_CONFIG_DIR + "distribution/ehcache-distributed.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."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testLoadConfigurationFromFileNoDefault() throws Exception { File file = new File(TEST_CONFIG_DIR + "ehcache-nodefault.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEqu... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void 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."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void 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."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void 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."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testOverrideLocallyConfiguredExpiry() throws Exception { cacheConfiguration.setEternal(false); cacheConfiguration.setTimeToLiveSeconds(123); cacheConfiguration.setTimeToIdleSeconds(321); CacheConfigChangeBridge bridge = new CacheConfigChangeBridge("foo", backend, notifier, cacheConfiguration); toolkit... | public void connectConfigs() { initializeFromCluster(); cacheConfiguration.addConfigurationListener(this); notifier.addNotificationListener(this); } | CacheConfigChangeBridge implements CacheConfigurationListener, ToolkitNotificationListener { public void connectConfigs() { initializeFromCluster(); cacheConfiguration.addConfigurationListener(this); notifier.addNotificationListener(this); } } | CacheConfigChangeBridge implements CacheConfigurationListener, ToolkitNotificationListener { public void connectConfigs() { initializeFromCluster(); cacheConfiguration.addConfigurationListener(this); notifier.addNotificationListener(this); } CacheConfigChangeBridge(String fullyQualifiedEhcacheName, ToolkitCacheInternal... | CacheConfigChangeBridge implements CacheConfigurationListener, ToolkitNotificationListener { public void connectConfigs() { initializeFromCluster(); cacheConfiguration.addConfigurationListener(this); notifier.addNotificationListener(this); } CacheConfigChangeBridge(String fullyQualifiedEhcacheName, ToolkitCacheInternal... | CacheConfigChangeBridge implements CacheConfigurationListener, ToolkitNotificationListener { public void connectConfigs() { initializeFromCluster(); cacheConfiguration.addConfigurationListener(this); notifier.addNotificationListener(this); } CacheConfigChangeBridge(String fullyQualifiedEhcacheName, ToolkitCacheInternal... |
@Test public void testEmptyPeerListManualDistributedConfiguration() { Configuration config = ConfigurationFactory.parseConfiguration( new File(TEST_CONFIG_DIR + "distribution/ehcache-manual-distributed3.xml")).name("new-name"); CacheManager cacheManager = new CacheManager(config); assertEquals(0, cacheManager.getCacheM... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void 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."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testCreateCacheEntitiesDisablesNonStop() throws Exception { repositoryService.createCacheEntities(Collections.singleton("testCacheManager"), Collections.singleton("testCache1"), Collections.singleton("Size")); verify(clusteredInstanceFactory, times(2)).enableNonStopForCurrentThread(anyBoolean()); } | @Override public ResponseEntityV2<CacheEntityV2> createCacheEntities(Set<String> cacheManagerNames, Set<String> cacheNames, Set<String> attributes) { ResponseEntityV2<CacheEntityV2> responseEntityV2 = new ResponseEntityV2<CacheEntityV2>(); CacheEntityBuilderV2 builder = null; Collection<CacheEntityV2> entities; cacheMa... | DfltSamplerRepositoryServiceV2 implements SamplerRepositoryServiceV2,
EntityResourceFactoryV2, CacheManagerServiceV2, CacheServiceV2, AgentServiceV2,
EventServiceV2 { @Override public ResponseEntityV2<CacheEntityV2> createCacheEntities(Set<String> cacheManagerNames, Set<String> cacheNames, Set<String> attribute... | DfltSamplerRepositoryServiceV2 implements SamplerRepositoryServiceV2,
EntityResourceFactoryV2, CacheManagerServiceV2, CacheServiceV2, AgentServiceV2,
EventServiceV2 { @Override public ResponseEntityV2<CacheEntityV2> createCacheEntities(Set<String> cacheManagerNames, Set<String> cacheNames, Set<String> attribute... | DfltSamplerRepositoryServiceV2 implements SamplerRepositoryServiceV2,
EntityResourceFactoryV2, CacheManagerServiceV2, CacheServiceV2, AgentServiceV2,
EventServiceV2 { @Override public ResponseEntityV2<CacheEntityV2> createCacheEntities(Set<String> cacheManagerNames, Set<String> cacheNames, Set<String> attribute... | DfltSamplerRepositoryServiceV2 implements SamplerRepositoryServiceV2,
EntityResourceFactoryV2, CacheManagerServiceV2, CacheServiceV2, AgentServiceV2,
EventServiceV2 { @Override public ResponseEntityV2<CacheEntityV2> createCacheEntities(Set<String> cacheManagerNames, Set<String> cacheNames, Set<String> attribute... |
@Test public void testCreateCacheStatisticSampleEntityDisablesNonStop() throws Exception { repositoryService.createCacheStatisticSampleEntity(Collections.singleton("testCacheManager"), Collections.singleton("testCache1"), Collections.singleton("Size")); verify(clusteredInstanceFactory, times(2)).enableNonStopForCurrent... | @Override public ResponseEntityV2<CacheStatisticSampleEntityV2> createCacheStatisticSampleEntity(Set<String> cacheManagerNames, Set<String> cacheNames, Set<String> sampleNames) { CacheStatisticSampleEntityBuilderV2 builder = CacheStatisticSampleEntityBuilderV2.createWith(sampleNames); ResponseEntityV2<CacheStatisticSam... | DfltSamplerRepositoryServiceV2 implements SamplerRepositoryServiceV2,
EntityResourceFactoryV2, CacheManagerServiceV2, CacheServiceV2, AgentServiceV2,
EventServiceV2 { @Override public ResponseEntityV2<CacheStatisticSampleEntityV2> createCacheStatisticSampleEntity(Set<String> cacheManagerNames, Set<String> cache... | DfltSamplerRepositoryServiceV2 implements SamplerRepositoryServiceV2,
EntityResourceFactoryV2, CacheManagerServiceV2, CacheServiceV2, AgentServiceV2,
EventServiceV2 { @Override public ResponseEntityV2<CacheStatisticSampleEntityV2> createCacheStatisticSampleEntity(Set<String> cacheManagerNames, Set<String> cache... | DfltSamplerRepositoryServiceV2 implements SamplerRepositoryServiceV2,
EntityResourceFactoryV2, CacheManagerServiceV2, CacheServiceV2, AgentServiceV2,
EventServiceV2 { @Override public ResponseEntityV2<CacheStatisticSampleEntityV2> createCacheStatisticSampleEntity(Set<String> cacheManagerNames, Set<String> cache... | DfltSamplerRepositoryServiceV2 implements SamplerRepositoryServiceV2,
EntityResourceFactoryV2, CacheManagerServiceV2, CacheServiceV2, AgentServiceV2,
EventServiceV2 { @Override public ResponseEntityV2<CacheStatisticSampleEntityV2> createCacheStatisticSampleEntity(Set<String> cacheManagerNames, Set<String> cache... |
@Test public void testClearCacheDisablesNonStop() throws Exception { repositoryService.clearCache("testCacheManager", "testCache1"); verify(clusteredInstanceFactory, times(2)).enableNonStopForCurrentThread(anyBoolean()); } | @Override public void clearCache(String cacheManagerName, String cacheName) { cacheManagerSamplerRepoLock.readLock().lock(); SamplerRepoEntry entry = cacheManagerSamplerRepo.get(cacheManagerName); try { enableNonStopFor(entry, false); if (entry != null) { entry.clearCache(cacheName); } } finally { enableNonStopFor(entr... | DfltSamplerRepositoryServiceV2 implements SamplerRepositoryServiceV2,
EntityResourceFactoryV2, CacheManagerServiceV2, CacheServiceV2, AgentServiceV2,
EventServiceV2 { @Override public void clearCache(String cacheManagerName, String cacheName) { cacheManagerSamplerRepoLock.readLock().lock(); SamplerRepoEntry ent... | DfltSamplerRepositoryServiceV2 implements SamplerRepositoryServiceV2,
EntityResourceFactoryV2, CacheManagerServiceV2, CacheServiceV2, AgentServiceV2,
EventServiceV2 { @Override public void clearCache(String cacheManagerName, String cacheName) { cacheManagerSamplerRepoLock.readLock().lock(); SamplerRepoEntry ent... | DfltSamplerRepositoryServiceV2 implements SamplerRepositoryServiceV2,
EntityResourceFactoryV2, CacheManagerServiceV2, CacheServiceV2, AgentServiceV2,
EventServiceV2 { @Override public void clearCache(String cacheManagerName, String cacheName) { cacheManagerSamplerRepoLock.readLock().lock(); SamplerRepoEntry ent... | DfltSamplerRepositoryServiceV2 implements SamplerRepositoryServiceV2,
EntityResourceFactoryV2, CacheManagerServiceV2, CacheServiceV2, AgentServiceV2,
EventServiceV2 { @Override public void clearCache(String cacheManagerName, String cacheName) { cacheManagerSamplerRepoLock.readLock().lock(); SamplerRepoEntry ent... |
@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."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void 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."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testLoadConfigurationWithReplacement() throws Exception { System.setProperty("multicastGroupPort", "4446"); System.setProperty("serverAndPort", "server.com:9510"); File file = new File(TEST_CONFIG_DIR + "ehcache-replacement.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(f... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testMatchPropertyTokensProperlyFormed() { String example = "<cacheManagerPeerProviderFactory class=\"net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory\"" + "properties=\"peerDiscovery=automatic, " + "multicastGroupAddress=${multicastAddress}, " + "multicastGroupPort=4446, timeToLive=1\"/>... | static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return propertyTokens; } | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... |
@Test public void testMatchPropertyTokensProperlyFormedUrl() { String example = "<terracottaConfig url=\"${serverAndPort}\"/>"; Set propertyTokens = ConfigurationFactory.extractPropertyTokens(example); assertEquals(1, propertyTokens.size()); String firstPropertyToken = (String) (propertyTokens.toArray())[0]; assertEqua... | static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return propertyTokens; } | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... |
@Test public void testMatchPropertyTokensProperlyFormedTwo() { String example = "<cacheManagerPeerProviderFactory class=\"net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory\"" + "properties=\"peerDiscovery=automatic, " + "multicastGroupAddress=${multicastAddress}\n, " + "multicastGroupPort=4446, timeToLive=... | static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return propertyTokens; } | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... |
@Test public void testMatchPropertyTokensProperlyFormedTwoUnique() { String example = "<cacheManagerPeerProviderFactory class=\"net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory\"" + "properties=\"peerDiscovery=automatic, " + "multicastGroupAddress=${multicastAddress}\n, " + "multicastGroupPort=4446, timeT... | static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return propertyTokens; } | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... |
@Test public void testMatchPropertyTokensNotClosed() { String example = "<cacheManagerPeerProviderFactory class=\"net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory\"" + "properties=\"peerDiscovery=automatic, " + "multicastGroupAddress=${multicastAddress\n, " + "multicastGroupPort=4446, timeToLive=${multica... | static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return propertyTokens; } | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... | ConfigurationFactory { static Set extractPropertyTokens(String sourceDocument) { Set propertyTokens = new HashSet(); Pattern pattern = Pattern.compile("\\$\\{.+?\\}"); Matcher matcher = pattern.matcher(sourceDocument); while (matcher.find()) { String token = matcher.group(); propertyTokens.add(token); } return property... |
@Test public void testSetUnlimitedMaxEntriesInCache() throws Exception { CacheConfigChangeBridge bridge = new CacheConfigChangeBridge("foo", backend, notifier, cacheConfiguration); toolkitCacheConfig.internalSetConfigMapping(ToolkitConfigFields.MAX_TOTAL_COUNT_FIELD_NAME, -1); bridge.connectConfigs(); assertThat(cacheC... | public void connectConfigs() { initializeFromCluster(); cacheConfiguration.addConfigurationListener(this); notifier.addNotificationListener(this); } | CacheConfigChangeBridge implements CacheConfigurationListener, ToolkitNotificationListener { public void connectConfigs() { initializeFromCluster(); cacheConfiguration.addConfigurationListener(this); notifier.addNotificationListener(this); } } | CacheConfigChangeBridge implements CacheConfigurationListener, ToolkitNotificationListener { public void connectConfigs() { initializeFromCluster(); cacheConfiguration.addConfigurationListener(this); notifier.addNotificationListener(this); } CacheConfigChangeBridge(String fullyQualifiedEhcacheName, ToolkitCacheInternal... | CacheConfigChangeBridge implements CacheConfigurationListener, ToolkitNotificationListener { public void connectConfigs() { initializeFromCluster(); cacheConfiguration.addConfigurationListener(this); notifier.addNotificationListener(this); } CacheConfigChangeBridge(String fullyQualifiedEhcacheName, ToolkitCacheInternal... | CacheConfigChangeBridge implements CacheConfigurationListener, ToolkitNotificationListener { public void connectConfigs() { initializeFromCluster(); cacheConfiguration.addConfigurationListener(this); notifier.addNotificationListener(this); } CacheConfigChangeBridge(String fullyQualifiedEhcacheName, ToolkitCacheInternal... |
@Test public void testCopyConfiguration() { File file = new File(TEST_CONFIG_DIR + "ehcache-copy.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); Ehcache copyOnReadCache = configurationHelper.cr... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testCreateOnce() throws Exception { final String value = "value"; final CountingCacheEntryFactory factory = new CountingCacheEntryFactory(value); selfPopulatingCache = new SelfPopulatingCache(cache, factory); for (int i = 0; i < 5; i++) { assertSame(value, selfPopulatingCache.get("key").getObjectValue... | @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new Element(key, null); throw new CacheException... | SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ... | SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ... | SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ... | SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { element = new ... |
@Test public void testElementValueComparatorConfiguration() { File file = new File(TEST_CONFIG_DIR + "ehcache-comparator.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); ClassLoader loader = get... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testDiskStorePath() { String name = "testTemp"; String path = "c:\\something\\temp"; CacheConfiguration cacheConfiguration = new CacheConfiguration() .name(name) .diskStorePath(path) .diskPersistent(true); cacheManager.addCache(new Cache(cacheConfiguration)); Cache cache = cacheManager.getCache(name);... | 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 maxElementsInMemory); } | CacheConfiguration implements Cloneable { public final CacheConfiguration diskStorePath(String diskStorePath) { setDiskStorePath(diskStorePath); return this; } CacheConfiguration(); CacheConfiguration(String name, int maxElementsInMemory); @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 maxElementsInMemory); @Override CacheConfiguration clone(); final void setName(String name); final Ca... |
@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 (!cacheStatus.isUninitialized()) { 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 (!cacheStatus.isUninitialized()) { 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 (!cacheStatus.isUninitialized()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(CacheConfiguration cacheConfiguration); ... | Cache implements Ehcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!cacheStatus.isUninitialized()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(CacheConfiguration cacheConfiguration); ... | Cache implements Ehcache, StoreListener { public final void setName(String name) throws IllegalArgumentException { if (!cacheStatus.isUninitialized()) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(CacheConfiguration cacheConfiguration); ... |
@Test public void testInitialiseFailures() { final String name = "testInitialiseFailures2"; Cache cache = new Cache(name, 1, false, false, 5, 1); cache.initialise(); try { cache.initialise(); fail("Calling cache.initialise() multiple times should fail with IllegalStateException"); } catch (IllegalStateException e) { if... | public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsInMemory() == 0) { LOG.warn("Cache: " + configuration.getN... | Cache implements Ehcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsInMemory() == 0)... | Cache implements Ehcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsInMemory() == 0)... | Cache implements Ehcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsInMemory() == 0)... | Cache implements Ehcache, StoreListener { public void initialise() { synchronized (this) { if (!cacheStatus.canInitialize()) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsInMemory() == 0)... |
@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(460, cache.toString().length()); } | @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(cacheStatus.getStatus()) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk = ").append(configuration.isOverflow... | Cache implements Ehcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(cacheStatus.getStatus()) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowT... | Cache implements Ehcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(cacheStatus.getStatus()) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowT... | Cache implements Ehcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(cacheStatus.getStatus()) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowT... | Cache implements Ehcache, StoreListener { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(cacheStatus.getStatus()) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowT... |
@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 testClearStatistics() throws InterruptedException { Cache cache = new Cache("test", 1, true, false, 5, 2); manager.addCache(cache); cache.setStatisticsEnabled(true); cache.put(new Element("key1", "value1")); cache.put(new Element("key2", "value1")); cache.get("key1"); Statistics statistics = cache.get... | public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } | Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } } | Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } Statistics(Ehcache cache, int statisticsAccuracy, long cacheHits, long onDiskHits, long offHeapHits,
... | Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } Statistics(Ehcache cache, int statisticsAccuracy, long cacheHits, long onDiskHits, long offHeapHits,
... | Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } Statistics(Ehcache cache, int statisticsAccuracy, long cacheHits, long onDiskHits, long offHeapHits,
... |
@Test public void testTerracottaConfiguration() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals("tc", config... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void 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); instanceMa... | public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPee... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... |
@Test public void testCacheManagerThreads() throws CacheException, InterruptedException { singletonManager = CacheManager.create(AbstractCacheTest.TEST_CONFIG_DIR + "ehcache-big.xml"); int threads = countThreads(); assertTrue("More than 75 threads: " + threads, countThreads() <= 75); } | public static CacheManager create() throws CacheException { if (singleton != null) { return singleton; } synchronized (CacheManager.class) { if (singleton == null) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Creating new CacheManager with default config"); } singleton = new CacheManager(); } else { if (LOG... | CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { return singleton; } synchronized (CacheManager.class) { if (singleton == null) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Creating new CacheManager with default config"); } singleton = new CacheManager(); }... | CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { return singleton; } synchronized (CacheManager.class) { if (singleton == null) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Creating new CacheManager with default config"); } singleton = new CacheManager(); }... | CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { return singleton; } synchronized (CacheManager.class) { if (singleton == null) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Creating new CacheManager with default config"); } singleton = new CacheManager(); }... | CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { return singleton; } synchronized (CacheManager.class) { if (singleton == null) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Creating new CacheManager with default config"); } singleton = new CacheManager(); }... |
@Test public void testGetCache() throws CacheException { instanceManager = CacheManager.create(); Ehcache cache = instanceManager.getCache("sampleCache1"); assertNotNull(cache); } | public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); return (Cache) caches.get(name); } | CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); return (Cache) caches.get(name); } } | CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); return (Cache) caches.get(name); } CacheManager(Configuration configuration); CacheManager(String configurationFileName); CacheManager(URL configurationURL); CacheManager(InputStream configurationInput... | CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); return (Cache) caches.get(name); } CacheManager(Configuration configuration); CacheManager(String configurationFileName); CacheManager(URL configurationURL); CacheManager(InputStream configurationInput... | CacheManager { public Cache getCache(String name) throws IllegalStateException, ClassCastException { checkStatus(); return (Cache) caches.get(name); } CacheManager(Configuration configuration); CacheManager(String configurationFileName); CacheManager(URL configurationURL); CacheManager(InputStream configurationInput... |
@Test public void testRemoveCache() throws CacheException { singletonManager = CacheManager.create(); Ehcache cache = singletonManager.getCache("sampleCache1"); assertNotNull(cache); singletonManager.removeCache("sampleCache1"); cache = singletonManager.getCache("sampleCache1"); assertNull(cache); singletonManager.remo... | public void removeCache(String cacheName) throws IllegalStateException { checkStatus(); if (cacheName == null || cacheName.length() == 0) { return; } Ehcache cache = (Ehcache) ehcaches.remove(cacheName); if (cache != null && cache.getStatus().equals(Status.STATUS_ALIVE)) { cache.dispose(); cacheManagerEventListenerRegi... | CacheManager { public void removeCache(String cacheName) throws IllegalStateException { checkStatus(); if (cacheName == null || cacheName.length() == 0) { return; } Ehcache cache = (Ehcache) ehcaches.remove(cacheName); if (cache != null && cache.getStatus().equals(Status.STATUS_ALIVE)) { cache.dispose(); cacheManagerEv... | CacheManager { public void removeCache(String cacheName) throws IllegalStateException { checkStatus(); if (cacheName == null || cacheName.length() == 0) { return; } Ehcache cache = (Ehcache) ehcaches.remove(cacheName); if (cache != null && cache.getStatus().equals(Status.STATUS_ALIVE)) { cache.dispose(); cacheManagerEv... | CacheManager { public void removeCache(String cacheName) throws IllegalStateException { checkStatus(); if (cacheName == null || cacheName.length() == 0) { return; } Ehcache cache = (Ehcache) ehcaches.remove(cacheName); if (cache != null && cache.getStatus().equals(Status.STATUS_ALIVE)) { cache.dispose(); cacheManagerEv... | CacheManager { public void removeCache(String cacheName) throws IllegalStateException { checkStatus(); if (cacheName == null || cacheName.length() == 0) { return; } Ehcache cache = (Ehcache) ehcaches.remove(cacheName); if (cache != null && cache.getStatus().equals(Status.STATUS_ALIVE)) { cache.dispose(); cacheManagerEv... |
@Test public void testAddCache() throws CacheException { singletonManager = CacheManager.create(); singletonManager.addCache("test"); singletonManager.addCache("test2"); Ehcache cache = singletonManager.getCache("test"); assertNotNull(cache); assertEquals("test", cache.getName()); String[] cacheNames = singletonManager... | 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 cache = nu... | 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)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPee... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "CacheManager already shutdown"); } return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (... |
@Test public void testCreateOnce() throws Exception { final String value = "value"; final CountingCacheEntryFactory factory = new CountingCacheEntryFactory(value); final Cache cache = manager.getCache("sampleCacheNoIdle"); final Ehcache selfPopulatingCache = new SelfPopulatingCache(cache, factory); for (int i = 0; i < ... | @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeoutException e) { String message = "Timeout aft... | SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout... | SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout... | SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout... | SelfPopulatingCache extends BlockingCache { @Override public Element get(final Object key) throws LockTimeoutException { try { Element element = super.get(key); if (element == null) { Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); put(element); } return element; } catch (LockTimeout... |
@Test public void testTerracottaEmbeddedConfig() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-tc-embedded.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals("tc", conf... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testClearStatistics() throws InterruptedException { Cache cache = new Cache("test", 1, true, false, 5, 2); manager.addCache(cache); cache.setStatisticsEnabled(true); cache.put(new Element("key1", "value1")); cache.put(new Element("key2", "value1")); Thread.sleep(100); cache.get("key1"); Statistics sta... | public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } | Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } } | Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } Statistics(Ehcache cache, int statisticsAccuracy, long cacheHits, long onDiskHits, long offHeapHits,
... | Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } Statistics(Ehcache cache, int statisticsAccuracy, long cacheHits, long onDiskHits, long offHeapHits,
... | Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } Statistics(Ehcache cache, int statisticsAccuracy, long cacheHits, long onDiskHits, long offHeapHits,
... |
@Test public void testTerracottaEmbeddedXsdConfig() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-tc-embedded-xsd.xml"); Configuration configuration = ConfigurationFactory .parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper( manager, configuration); assertEquals("... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testTerracottaInvalidConfig1() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-invalid1.xml"); try { Configuration configuration = ConfigurationFactory.parseConfiguration(file); fail("expecting exception to be thrown"); } catch (CacheException e) { assertTrue(e.getMessage().con... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testTerracottaInvalidConfig2() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-invalid2.xml"); try { Configuration configuration = ConfigurationFactory.parseConfiguration(file); fail("expecting exception to be thrown"); } catch (CacheException e) { assertTrue(e.getMessage().con... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testTerracottaConfigRMIReplication() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-rmi.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); List configs = configuration.getCacheConfigurations().get("clustered").getCacheEventListenerConfiguration... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testTerracottaConfigJGroupsReplication() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-jgroups.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); List configs = configuration.getCacheConfigurations().get("clustered").getCacheEventListenerConfi... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testTerracottaInvalidConfig5() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-jms.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); List configs = configuration.getCacheConfigurations().get("clustered").getCacheEventListenerConfigurations(); a... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testCreateElementDataForEternalElement() { ElementData elementData = valueModeHandler.createElementData(eternalElement); Assert.assertTrue(elementData instanceof EternalElementData); } | @Override public ElementData createElementData(Element element) { if(element.isEternal()) { return new EternalElementData(element); } else { return new NonEternalElementData(element); } } | ValueModeHandlerSerialization implements ValueModeHandler { @Override public ElementData createElementData(Element element) { if(element.isEternal()) { return new EternalElementData(element); } else { return new NonEternalElementData(element); } } } | ValueModeHandlerSerialization implements ValueModeHandler { @Override public ElementData createElementData(Element element) { if(element.isEternal()) { return new EternalElementData(element); } else { return new NonEternalElementData(element); } } } | ValueModeHandlerSerialization implements ValueModeHandler { @Override public ElementData createElementData(Element element) { if(element.isEternal()) { return new EternalElementData(element); } else { return new NonEternalElementData(element); } } @Override Object getRealKeyObject(String portableKey); @Override String... | ValueModeHandlerSerialization implements ValueModeHandler { @Override public ElementData createElementData(Element element) { if(element.isEternal()) { return new EternalElementData(element); } else { return new NonEternalElementData(element); } } @Override Object getRealKeyObject(String portableKey); @Override String... |
@Test public void testMonitoringOn() { File file = new File(TEST_CONFIG_DIR + "ehcache-monitoring-on.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals(Configuration.Monitoring.ON, co... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testMonitoringOff() { File file = new File(TEST_CONFIG_DIR + "ehcache-monitoring-off.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals(Configuration.Monitoring.OFF,... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testThrashBlockingCache() throws Exception { Ehcache cache = manager.getCache("sampleCache1"); blockingCache = new BlockingCache(cache); long duration = thrashCache(blockingCache, 50, 500L, 1000L); LOG.debug("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, int numberOfStripes); BlockingCache(final Ehcache cache); } | BlockingCache implements Ehcache { protected Ehcache getCache() { return cache; } BlockingCache(final Ehcache cache, int numberOfStripes); BlockingCache(final Ehcache cache); String getName(); void setName(String name); boolean isExpired(Element element); @Override Object clone(); RegisteredEventListeners getCacheEven... | BlockingCache implements Ehcache { protected Ehcache getCache() { return cache; } BlockingCache(final Ehcache cache, int numberOfStripes); BlockingCache(final Ehcache cache); String getName(); void setName(String name); boolean isExpired(Element element); @Override Object clone(); RegisteredEventListeners getCacheEven... |
@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, int numberOfStripes); 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, int numberOfStripes); 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, int numberOfStripes); BlockingCache(final Ehcache cache); ... |
@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."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testTerracottaConfiguration() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertEquals("tc", config... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testTerracottaInvalidConfig3() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-invalid3.xml"); try { Configuration configuration = ConfigurationFactory.parseConfiguration(file); fail("expecting exception to be thrown"); } catch (CacheException e) { assertTrue(e.getMessage().con... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testTerracottaInvalidConfig4() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-invalid4.xml"); try { Configuration configuration = ConfigurationFactory.parseConfiguration(file); fail("expecting exception to be thrown"); } catch (CacheException e) { assertTrue(e.getMessage().con... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testTerracottaInvalidConfig5() { File file = new File(TEST_CONFIG_DIR + "terracotta/ehcache-terracotta-invalid5.xml"); try { Configuration configuration = ConfigurationFactory.parseConfiguration(file); fail("expecting exception to be thrown"); } catch (CacheException e) { assertTrue(e.getMessage().con... | public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = null; try { input = new Bu... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... | ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } LOG.debug("Configuring ehcache from file: {}", file); Configuration configuration = null; InputStream input = nul... |
@Test public void testSetCacheName() throws CacheException { Ehcache cache = new Cache("testCache", 1, true, false, 5, 2); try { cache.setName(null); fail(); } catch (IllegalArgumentException e) { } cache.setName("name/with/slash"); manager.addCache(cache); try { cache.setName("trying_to_change_name_after_initialised")... | public final void setName(String name) throws IllegalArgumentException { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } | Cache implements Ehcache { public final void setName(String name) throws IllegalArgumentException { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } } | Cache implements Ehcache { public final void setName(String name) throws IllegalArgumentException { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(String name, int maxElementsInMemory, bool... | Cache implements Ehcache { public final void setName(String name) throws IllegalArgumentException { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(String name, int maxElementsInMemory, bool... | Cache implements Ehcache { public final void setName(String name) throws IllegalArgumentException { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Only uninitialised caches can have their names set."); } configuration.setName(name); } Cache(String name, int maxElementsInMemory, bool... |
@Test public void testInitialiseFailures() { try { Cache cache = new Cache("testInitialiseFailures2", 1, false, false, 5, 1); cache.initialise(); cache.initialise(); fail("Should have thrown IllegalArgumentException"); } catch (IllegalStateException e) { } } | public void initialise() { synchronized (this) { if (!status.equals(Status.STATUS_UNINITIALISED)) { throw new IllegalStateException("Cannot initialise the " + configuration.getName() + " cache because its status is not STATUS_UNINITIALISED"); } if (configuration.getMaxElementsInMemory() == 0) { LOG.warn("Cache: " + con... | Cache implements Ehcache { 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)... |
@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")); assertEquals(0, cache.getDiskStoreSize()); assertEquals(1, cache.getSize())... | public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return memoryStore.getTerracottaClusteredSize(); } if (isDiskStore()) { return diskStore.getSize(); } else { return 0; } } | Cache implements Ehcache { public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return memoryStore.getTerracottaClusteredSize(); } if (isDiskStore()) { return diskStore.getSize(); } else { return 0; } } } | Cache implements Ehcache { public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return memoryStore.getTerracottaClusteredSize(); } if (isDiskStore()) { return diskStore.getSize(); } else { return 0; } } Cache(String name, int maxElementsInMemory, boolean overf... | Cache implements Ehcache { public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return memoryStore.getTerracottaClusteredSize(); } if (isDiskStore()) { return diskStore.getSize(); } else { return 0; } } Cache(String name, int maxElementsInMemory, boolean overf... | Cache implements Ehcache { public final int getDiskStoreSize() throws IllegalStateException { checkStatus(); if (isTerracottaClustered()) { return memoryStore.getTerracottaClusteredSize(); } if (isDiskStore()) { return diskStore.getSize(); } else { return 0; } } Cache(String name, int maxElementsInMemory, boolean overf... |
@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 (!(memoryStore == null && diskStore == null)) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.liveCacheStatisticsData = new LiveCacheStatisticsWrapper(copy); copy.sampledC... | Cache implements Ehcache { @Override public final Cache clone() throws CloneNotSupportedException { if (!(memoryStore == null && diskStore == null)) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.liveCacheStatisticsData = new LiveCacheStatisticsW... | Cache implements Ehcache { @Override public final Cache clone() throws CloneNotSupportedException { if (!(memoryStore == null && diskStore == null)) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.liveCacheStatisticsData = new LiveCacheStatisticsW... | Cache implements Ehcache { @Override public final Cache clone() throws CloneNotSupportedException { if (!(memoryStore == null && diskStore == null)) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.liveCacheStatisticsData = new LiveCacheStatisticsW... | Cache implements Ehcache { @Override public final Cache clone() throws CloneNotSupportedException { if (!(memoryStore == null && diskStore == null)) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.liveCacheStatisticsData = new LiveCacheStatisticsW... |
@Test public void testToString() { Ehcache cache = new Cache("testGetMemoryStore", 10, false, false, 100, 200); assertTrue(cache.toString().indexOf("testGetMemoryStore") > -1); assertEquals(410, cache.toString().length()); } | @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(status) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk = ").append(configuration.isOverflowToDisk()) .append... | Cache implements Ehcache { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(status) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk = ").append(configuration.... | Cache implements Ehcache { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(status) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk = ").append(configuration.... | Cache implements Ehcache { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(status) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk = ").append(configuration.... | Cache implements Ehcache { @Override public String toString() { StringBuilder dump = new StringBuilder(); dump.append("[") .append(" name = ").append(configuration.getName()) .append(" status = ").append(status) .append(" eternal = ").append(configuration.isEternal()) .append(" overflowToDisk = ").append(configuration.... |
@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 { @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 { @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(String name, int maxElementsInMemory, boolean overflowToDisk,
... | Cache implements Ehcache { @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(String name, int maxElementsInMemory, boolean overflowToDisk,
... | Cache implements Ehcache { @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(String name, int maxElementsInMemory, boolean overflowToDisk,
... |
@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) || isElementOnDisk(key); } | Cache implements Ehcache { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return isElementInMemory(key) || isElementOnDisk(key); } } | Cache implements Ehcache { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return isElementInMemory(key) || isElementOnDisk(key); } Cache(String name, int maxElementsInMemory, boolean overflowToDisk,
boolean eternal, long timeToLiveSeconds, long timeToIdleSeconds); @Depreca... | Cache implements Ehcache { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return isElementInMemory(key) || isElementOnDisk(key); } Cache(String name, int maxElementsInMemory, boolean overflowToDisk,
boolean eternal, long timeToLiveSeconds, long timeToIdleSeconds); @Depreca... | Cache implements Ehcache { public boolean isKeyInCache(Object key) { if (key == null) { return false; } return isElementInMemory(key) || isElementOnDisk(key); } Cache(String name, int maxElementsInMemory, boolean overflowToDisk,
boolean eternal, long timeToLiveSeconds, long timeToIdleSeconds); @Depreca... |
@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 { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } } | Cache implements Ehcache { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } Cache(String name, int maxElementsInMemory, boolean overflowToDisk,
boolean eternal, long timeToLiveSeconds, long timeToIdleSeconds); @Deprec... | Cache implements Ehcache { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } Cache(String name, int maxElementsInMemory, boolean overflowToDisk,
boolean eternal, long timeToLiveSeconds, long timeToIdleSeconds); @Deprec... | Cache implements Ehcache { public final void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { put(element, false); } Cache(String name, int maxElementsInMemory, boolean overflowToDisk,
boolean eternal, long timeToLiveSeconds, long timeToIdleSeconds); @Deprec... |
@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 { 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 (elemen... | Cache implements Ehcache { 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 (elemen... | Cache implements Ehcache { 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 (elemen... | Cache implements Ehcache { 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 (elemen... |
@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 { 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 (specificLoade... | Cache implements Ehcache { 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 (specificLoade... | Cache implements Ehcache { 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 (specificLoade... | Cache implements Ehcache { 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 (specificLoade... |
@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 { 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 =... | Cache implements Ehcache { 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 =... | Cache implements Ehcache { 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 =... | Cache implements Ehcache { 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 =... |
@Test public void testConcurrentPutsAreConsistent() throws InterruptedException { Cache cache = new Cache("someName", 100, true, true, 0, 0); manager.addCache(cache); ExecutorService executor = Executors.newFixedThreadPool(10); for (int i = 0; i < 5000; i++) { executor.execute(new CacheTestRunnable(cache, String.valueO... | public Statistics getStatistics() throws IllegalStateException { int size = getSizeBasedOnAccuracy(getLiveCacheStatistics() .getStatisticsAccuracy()); return new Statistics(this, getLiveCacheStatistics() .getStatisticsAccuracy(), getLiveCacheStatistics() .getCacheHitCount(), getLiveCacheStatistics() .getOnDiskHitCount(... | Cache implements Ehcache { public Statistics getStatistics() throws IllegalStateException { int size = getSizeBasedOnAccuracy(getLiveCacheStatistics() .getStatisticsAccuracy()); return new Statistics(this, getLiveCacheStatistics() .getStatisticsAccuracy(), getLiveCacheStatistics() .getCacheHitCount(), getLiveCacheStati... | Cache implements Ehcache { public Statistics getStatistics() throws IllegalStateException { int size = getSizeBasedOnAccuracy(getLiveCacheStatistics() .getStatisticsAccuracy()); return new Statistics(this, getLiveCacheStatistics() .getStatisticsAccuracy(), getLiveCacheStatistics() .getCacheHitCount(), getLiveCacheStati... | Cache implements Ehcache { public Statistics getStatistics() throws IllegalStateException { int size = getSizeBasedOnAccuracy(getLiveCacheStatistics() .getStatisticsAccuracy()); return new Statistics(this, getLiveCacheStatistics() .getStatisticsAccuracy(), getLiveCacheStatistics() .getCacheHitCount(), getLiveCacheStati... | Cache implements Ehcache { public Statistics getStatistics() throws IllegalStateException { int size = getSizeBasedOnAccuracy(getLiveCacheStatistics() .getStatisticsAccuracy()); return new Statistics(this, getLiveCacheStatistics() .getStatisticsAccuracy(), getLiveCacheStatistics() .getCacheHitCount(), getLiveCacheStati... |
@Test public void testForCacheManagerThreadLeak() throws CacheException, InterruptedException { int startingThreadCount = countThreads(); URL secondCacheConfiguration = this.getClass().getResource( "/ehcache-2.xml"); for (int i = 0; i < 100; i++) { instanceManager = new CacheManager(secondCacheConfiguration); instanceM... | public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManagerPeerProvider.... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag... | CacheManager { public void shutdown() { synchronized (CacheManager.class) { if (status.equals(Status.STATUS_SHUTDOWN)) { LOG.debug("CacheManager already shutdown"); return; } for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) { if (cacheManagerPeerProvider != null) { cacheManag... |
@Test public void testCacheManagerThreads() throws CacheException, InterruptedException { singletonManager = CacheManager .create(AbstractCacheTest.TEST_CONFIG_DIR + "ehcache-big.xml"); int threads = countThreads(); assertTrue("More than 145 threads: " + threads, countThreads() <= 145); } | public static CacheManager create() throws CacheException { if (singleton != null) { return singleton; } synchronized (CacheManager.class) { if (singleton == null) { LOG.debug("Creating new CacheManager with default config"); singleton = new CacheManager(); } else { LOG.debug("Attempting to create an existing singleton... | CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { return singleton; } synchronized (CacheManager.class) { if (singleton == null) { LOG.debug("Creating new CacheManager with default config"); singleton = new CacheManager(); } else { LOG.debug("Attempting to create an exi... | CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { return singleton; } synchronized (CacheManager.class) { if (singleton == null) { LOG.debug("Creating new CacheManager with default config"); singleton = new CacheManager(); } else { LOG.debug("Attempting to create an exi... | CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { return singleton; } synchronized (CacheManager.class) { if (singleton == null) { LOG.debug("Creating new CacheManager with default config"); singleton = new CacheManager(); } else { LOG.debug("Attempting to create an exi... | CacheManager { public static CacheManager create() throws CacheException { if (singleton != null) { return singleton; } synchronized (CacheManager.class) { if (singleton == null) { LOG.debug("Creating new CacheManager with default config"); singleton = new CacheManager(); } else { LOG.debug("Attempting to create an exi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.