net.sf.ehcache.Ehcache.removeAll()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(264)

本文整理了Java中net.sf.ehcache.Ehcache.removeAll()方法的一些代码示例,展示了Ehcache.removeAll()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ehcache.removeAll()方法的具体详情如下:
包路径:net.sf.ehcache.Ehcache
类名称:Ehcache
方法名:removeAll

Ehcache.removeAll介绍

[英]Removes all cached items.

When using Terracotta clustered caches with nonstop enabled, the timeout used by this method is NonstopConfiguration#getBulkOpsTimeoutMultiplyFactor() times the timeout value in the nonstop config.
[中]删除所有缓存项。
使用启用了非停止的Terracotta群集缓存时,此方法使用的超时为非停止配置#getBulkOpsTimeoutMultiplyFactor()乘以非停止配置中的超时值。

代码示例

代码示例来源:origin: spring-projects/spring-framework

  1. @Override
  2. public void clear() {
  3. this.cache.removeAll();
  4. }

代码示例来源:origin: gocd/gocd

  1. public void clear() {
  2. ehCache.removeAll();
  3. }

代码示例来源:origin: spring-projects/spring-security

  1. public void clearCache() {
  2. cache.removeAll();
  3. }
  4. }

代码示例来源:origin: org.springframework/spring-context-support

  1. @Override
  2. public void clear() {
  3. this.cache.removeAll();
  4. }

代码示例来源:origin: apache/kylin

  1. public void clear() {
  2. this.cache.removeAll();
  3. }

代码示例来源:origin: spring-projects/spring-security

  1. protected Ehcache getCache() {
  2. Ehcache cache = cacheManager.getCache("basiclookuptestcache");
  3. cache.removeAll();
  4. return cache;
  5. }

代码示例来源:origin: spring-projects/spring-security

  1. private Ehcache getCache() {
  2. Ehcache cache = cacheManager.getCache("ehcacheusercachetests");
  3. cache.removeAll();
  4. return cache;
  5. }

代码示例来源:origin: apache/shiro

  1. /**
  2. * Removes all elements in the cache, but leaves the cache in a useable state.
  3. */
  4. public void clear() throws CacheException {
  5. if (log.isTraceEnabled()) {
  6. log.trace("Clearing all objects from cache [" + cache.getName() + "]");
  7. }
  8. try {
  9. cache.removeAll();
  10. } catch (Throwable t) {
  11. throw new CacheException(t);
  12. }
  13. }

代码示例来源:origin: spring-projects/spring-security

  1. @Test
  2. public void clearCache() throws Exception {
  3. myCache.clearCache();
  4. verify(cache).removeAll();
  5. }

代码示例来源:origin: hibernate/hibernate-orm

  1. @Override
  2. public void evictData() {
  3. try {
  4. getCache().removeAll();
  5. }
  6. catch (IllegalStateException e) {
  7. throw new CacheException( e );
  8. }
  9. catch (net.sf.ehcache.CacheException e) {
  10. if ( e instanceof NonStopCacheException ) {
  11. HibernateNonstopCacheExceptionHandler.getInstance()
  12. .handleNonstopCacheException( (NonStopCacheException) e );
  13. }
  14. else {
  15. throw new CacheException( e );
  16. }
  17. }
  18. }

代码示例来源:origin: net.sf.ehcache/ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void removeAll(Collection<?> keys) throws IllegalStateException {
  5. underlyingCache.removeAll(keys);
  6. }

代码示例来源:origin: net.sf.ehcache/ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void removeAll() throws IllegalStateException, CacheException {
  5. underlyingCache.removeAll();
  6. }

代码示例来源:origin: net.sf.ehcache/ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void removeAll(boolean doNotNotifyCacheReplicators) throws IllegalStateException, CacheException {
  5. underlyingCache.removeAll(doNotNotifyCacheReplicators);
  6. }

代码示例来源:origin: net.sf.ehcache/ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void removeAll(Collection<?> keys, boolean doNotNotifyCacheReplicators) throws IllegalStateException {
  5. underlyingCache.removeAll(keys, doNotNotifyCacheReplicators);
  6. }

代码示例来源:origin: net.sf.ehcache/ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void removeAll(boolean arg0) throws IllegalStateException, CacheException {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. this.cache.removeAll(arg0);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

代码示例来源:origin: net.sf.ehcache/ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void removeAll(Collection arg0, boolean arg1) throws IllegalStateException, NullPointerException {
  5. // THIS IS GENERATED CODE -- DO NOT HAND MODIFY!
  6. Thread t = Thread.currentThread();
  7. ClassLoader prev = t.getContextClassLoader();
  8. t.setContextClassLoader(this.classLoader);
  9. try {
  10. this.cache.removeAll(arg0, arg1);
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

代码示例来源:origin: net.sf.ehcache/ehcache

  1. /**
  2. * Removes all cached items.
  3. *
  4. * @throws IllegalStateException if the cache is not {@link net.sf.ehcache.Status#STATUS_ALIVE}
  5. */
  6. public void removeAll() throws RemoteException, IllegalStateException {
  7. if (LOG.isDebugEnabled()) {
  8. LOG.debug("RMICachePeer for cache " + cache.getName() + ": remote removeAll received");
  9. }
  10. cache.removeAll(true);
  11. }

代码示例来源:origin: net.sf.ehcache/ehcache

  1. /**
  2. * Remove all elements in the cache, but leave the cache in a useable state.
  3. *
  4. * @throws CacheException
  5. */
  6. public final void clear() throws CacheException {
  7. try {
  8. cache.removeAll();
  9. } catch (IllegalStateException e) {
  10. throw new CacheException(e);
  11. }
  12. }

代码示例来源:origin: net.sf.ehcache/ehcache

  1. /**
  2. * Removes all cached items.
  3. *
  4. * @throws IllegalStateException if the cache is not {@link net.sf.ehcache.Status#STATUS_ALIVE}
  5. */
  6. public void removeAll() throws IllegalStateException, CacheException {
  7. CacheTransactionHelper.beginTransactionIfNeeded(cache);
  8. try {
  9. cache.removeAll();
  10. } finally {
  11. CacheTransactionHelper.commitTransactionIfNeeded(cache);
  12. }
  13. }

代码示例来源:origin: gocd/gocd

  1. public static void clearSingletons() {
  2. AnalyticsMetadataStore.instance().clear();
  3. ArtifactMetadataStore.instance().clear();
  4. AuthorizationMetadataStore.instance().clear();
  5. ConfigRepoMetadataStore.instance().clear();
  6. ElasticAgentMetadataStore.instance().clear();
  7. NewSCMMetadataStore.instance().clear();
  8. NotificationMetadataStore.instance().clear();
  9. PackageMaterialMetadataStore.instance().clear();
  10. PluggableTaskMetadataStore.instance().clear();
  11. new CachingSubjectDnX509PrincipalExtractor().getCache().removeAll();
  12. //
  13. SessionUtils.unsetCurrentUser();
  14. //
  15. PackageMetadataStore.getInstance().clear();
  16. PluggableTaskConfigStore.store().clear();
  17. PluginSettingsMetadataStore.getInstance().clear();
  18. RepositoryMetadataStore.getInstance().clear();
  19. SCMMetadataStore.getInstance().clear();
  20. }
  21. }

相关文章

Ehcache类方法