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

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

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

Ehcache.getMemoryStoreSize介绍

[英]Returns the number of elements in the memory store.
[中]

代码示例

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

  1. /**
  2. * Returns the size (in bytes) that this EhCache's memory store is using (RAM), or <code>-1</code> if
  3. * that number is unknown or cannot be calculated.
  4. *
  5. * @return the size (in bytes) that this EhCache's memory store is using (RAM), or <code>-1</code> if
  6. * that number is unknown or cannot be calculated.
  7. */
  8. public long getMemoryStoreSize() {
  9. try {
  10. return cache.getMemoryStoreSize();
  11. }
  12. catch (Throwable t) {
  13. throw new CacheException(t);
  14. }
  15. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Deprecated public long getMemoryStoreSize() throws IllegalStateException {
  5. return underlyingCache.getMemoryStoreSize();
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Deprecated public long getMemoryStoreSize() throws IllegalStateException {
  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. return this.cache.getMemoryStoreSize();
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

  1. this.inMemoryObjectCount = cache.getMemoryStoreSize();
  2. this.onDiskObjectCount = cache.getDiskStoreSize();

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

  1. /**
  2. * Returns the number of elements in the memory store.
  3. *
  4. * @return the number of elements in the memory store
  5. * @throws IllegalStateException
  6. * if the cache is not {@link net.sf.ehcache.Status#STATUS_ALIVE}
  7. */
  8. public long getMemoryStoreSize() throws IllegalStateException {
  9. return cache.getMemoryStoreSize();
  10. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public long getMemoryStoreSize() throws IllegalStateException {
  5. return underlyingCache.getMemoryStoreSize();
  6. }

代码示例来源:origin: org.terracotta/ehcache-probe

  1. public Long call() throws Exception {
  2. return cache.getMemoryStoreSize();
  3. }
  4. }));

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public long getLocalHeapSize() {
  5. if (!statisticsEnabled.get()) {
  6. return 0;
  7. }
  8. return cache.getMemoryStoreSize();
  9. }

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Deprecated public long getMemoryStoreSize() throws IllegalStateException {
  5. return underlyingCache.getMemoryStoreSize();
  6. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Deprecated public long getMemoryStoreSize() throws IllegalStateException {
  5. return underlyingCache.getMemoryStoreSize();
  6. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public long getMemoryStoreSize() throws IllegalStateException {
  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. return this.cache.getMemoryStoreSize();
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Deprecated public long getMemoryStoreSize() throws IllegalStateException {
  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. return this.cache.getMemoryStoreSize();
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Deprecated public long getMemoryStoreSize() throws IllegalStateException {
  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. return this.cache.getMemoryStoreSize();
  11. } finally {
  12. t.setContextClassLoader(prev);
  13. }
  14. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

  1. /**
  2. * @return the number of elements in ehcache's MemoryStore
  3. */
  4. public final long getElementCountInMemory() {
  5. try {
  6. return cache.getMemoryStoreSize();
  7. } catch (net.sf.ehcache.CacheException ce) {
  8. throw new CacheException(ce);
  9. }
  10. }

代码示例来源:origin: org.terracotta/ehcache-probe

  1. public Long call() throws Exception {
  2. return cache.getMemoryStoreSize() * getAdjustedSample();
  3. }

代码示例来源:origin: com.madgag/mini-git-server-server

  1. public long getMemoryStoreSize() throws IllegalStateException {
  2. return self().getMemoryStoreSize();
  3. }

代码示例来源:origin: rtyley/mini-git-server

  1. public long getMemoryStoreSize() throws IllegalStateException {
  2. return self().getMemoryStoreSize();
  3. }

代码示例来源:origin: org.apache.shiro/shiro-ehcache

  1. /**
  2. * Returns the size (in bytes) that this EhCache's memory store is using (RAM), or <code>-1</code> if
  3. * that number is unknown or cannot be calculated.
  4. *
  5. * @return the size (in bytes) that this EhCache's memory store is using (RAM), or <code>-1</code> if
  6. * that number is unknown or cannot be calculated.
  7. */
  8. public long getMemoryStoreSize() {
  9. try {
  10. return cache.getMemoryStoreSize();
  11. }
  12. catch (Throwable t) {
  13. throw new CacheException(t);
  14. }
  15. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public long getElementCountInMemory() {
  5. try {
  6. return cache.getMemoryStoreSize();
  7. } catch (net.sf.ehcache.CacheException ce) {
  8. if (ce instanceof NonStopCacheException) {
  9. HibernateNonstopCacheExceptionHandler.getInstance().handleNonstopCacheException((NonStopCacheException) ce);
  10. return -1;
  11. } else {
  12. throw new CacheException(ce);
  13. }
  14. }
  15. }

代码示例来源:origin: org.terracotta/ehcache-probe

  1. @RestMethod(required = { PARAM_CACHE })
  2. public void getCacheElementCountMemory(RestRequest request,
  3. RestResponse response) throws IOException {
  4. String cacheName = request.getParameter(PARAM_CACHE);
  5. Ehcache cache = cacheManager.getEhcache(cacheName);
  6. if (cache != null) {
  7. response.value(cache.getMemoryStoreSize());
  8. }
  9. }

相关文章

Ehcache类方法