Package net.sf.ehcache

Examples of net.sf.ehcache.Cache$CacheStatus


  /**
   * {@inheritDoc}
   */
  public boolean isRegionCacheLoggingEnabled(String region) {
    Cache cache = this.cacheManager.getCache( region );
    if ( cache != null ) {
      return cache.getCacheConfiguration().getLogging();
    }
    else {
      return false;
    }
  }
View Full Code Here


  /**
   * {@inheritDoc}
   */
  public boolean isRegionCacheOrphanEvictionEnabled(String region) {
    Cache cache = this.cacheManager.getCache( region );
    if ( cache != null && cache.isTerracottaClustered() ) {
      return cache.getCacheConfiguration().getTerracottaConfiguration().getOrphanEviction();
    }
    else {
      return false;
    }
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public boolean isTerracottaHibernateCache(String region) {
    Cache cache = cacheManager.getCache( region );
    if ( cache != null ) {
      return cache.getCacheConfiguration().isTerracottaClustered();
    }
    else {
      return false;
    }
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void setRegionCacheLoggingEnabled(String region, boolean loggingEnabled) {
    Cache cache = this.cacheManager.getCache( region );
    if ( cache != null ) {
      cache.getCacheConfiguration().setLogging( loggingEnabled );
      sendNotification( CACHE_REGION_CHANGED, getRegionCacheAttributes( region ), region );
    }
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void setRegionCacheMaxTTISeconds(String region, int maxTTISeconds) {
    Cache cache = this.cacheManager.getCache( region );
    if ( cache != null ) {
      cache.getCacheConfiguration().setTimeToIdleSeconds( maxTTISeconds );
      sendNotification( CACHE_REGION_CHANGED, getRegionCacheAttributes( region ), region );
    }
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void setRegionCacheMaxTTLSeconds(String region, int maxTTLSeconds) {
    Cache cache = this.cacheManager.getCache( region );
    if ( cache != null ) {
      cache.getCacheConfiguration().setTimeToLiveSeconds( maxTTLSeconds );
      sendNotification( CACHE_REGION_CHANGED, getRegionCacheAttributes( region ), region );
    }
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void setRegionCacheTargetMaxInMemoryCount(String region, int targetMaxInMemoryCount) {
    Cache cache = this.cacheManager.getCache( region );
    if ( cache != null ) {
      cache.getCacheConfiguration().setMaxElementsInMemory( targetMaxInMemoryCount );
      sendNotification( CACHE_REGION_CHANGED, getRegionCacheAttributes( region ), region );
    }
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void setRegionCacheTargetMaxTotalCount(String region, int targetMaxTotalCount) {
    Cache cache = this.cacheManager.getCache( region );
    if ( cache != null ) {
      cache.getCacheConfiguration().setMaxElementsOnDisk( targetMaxTotalCount );
      sendNotification( CACHE_REGION_CHANGED, getRegionCacheAttributes( region ), region );
    }
  }
View Full Code Here

   * {@inheritDoc}
   *
   * @see EhcacheStats#getNumberOfElementsInMemory(java.lang.String)
   */
  public int getNumberOfElementsInMemory(String region) {
    Cache cache = this.cacheManager.getCache( region );
    if ( cache != null ) {
      return (int) cache.getMemoryStoreSize();
    }
    else {
      return -1;
    }
  }
View Full Code Here

   * {@inheritDoc}
   *
   * @see EhcacheStats#getNumberOfElementsOffHeap(java.lang.String)
   */
  public int getNumberOfElementsOffHeap(String region) {
    Cache cache = this.cacheManager.getCache( region );
    if ( cache != null ) {
      return (int) cache.getOffHeapStoreSize();
    }
    else {
      return -1;
    }
  }
View Full Code Here

TOP

Related Classes of net.sf.ehcache.Cache$CacheStatus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.