org.norther.tammi.core.cache
Interface CacheClient<K,V>

Type Parameters:
K - the type of keys maintained by the cache.
V - the type of cached values.
All Superinterfaces:
Refreshable
All Known Subinterfaces:
CachedMediaProvider, CacheMonitor, FallbackMap, FormFilter, ForwardEngine, FreemarkerEngine, HibernateFactory, HostFilter<F>, JSPEngine, KeyCacheClient<K,V>, LayoutFilter, Logger, OJBFactory, PageFilter, PipeFilter<F>, ResourceFilter, ResourceFinder, ResourceMap, ServiceFilter<F>, ServletMediaProvider, TaskLoader, ThreadedLogger, VelocityEngine
All Known Implementing Classes:
AbstractLogger, AbstractPersisterFactory, AbstractTemplateEngine, AbstractThreadedLogger, DefaultCacheClient, DefaultCachedMediaProvider, DefaultCacheMonitor, DefaultFallbackMap, DefaultFormFilter, DefaultForwardEngine, DefaultFreemarkerEngine, DefaultHibernateFactory, DefaultHostFilter, DefaultJSPEngine, DefaultKeyCacheClient, DefaultLayoutFilter, DefaultOJBFactory, DefaultPageFilter, DefaultPipeFilter, DefaultResourceFilter, DefaultResourceFinder, DefaultResourceMap, DefaultServiceFilter, DefaultServletMediaProvider, DefaultTaskLoader, DefaultVelocityEngine, JDK4Logger, Log4JLogger

public interface CacheClient<K,V>
extends Refreshable

An interface to objects maintaining other objects in caches. This interface provides methods for memory managers and other cache controllers.

Version:
$Id: CacheClient.java,v 1.17 2010-06-22 17:50:21 cvsimp Exp $
Author:
Ilkka Priha

Method Summary
 void clearCached()
          Clears all cached entries without notifying.
 void expireCached(long timestamp)
          Expires all cached entries notifying them about expiration.
 void expireFraction(long timestamp, float fraction)
          Expires the specified fraction of cached entries notifying them about expiration.
 ConcurrentMap<K,V> getCache(boolean... create)
          Gets and optionally creates the cache.
 ObjectName getSharedCacheName()
          Gets the the shared cache of this client.
 boolean isCachingDisabled()
          Checks whether the caching is disabled.
 void removeCache()
          Removes the cache.
 void setCachingDisabled(boolean flag)
          Sets the caching disabled flag.
 void setSharedCacheName(ObjectName cache)
          Sets the shared cache of this client.
 
Methods inherited from interface org.norther.tammi.core.base.Refreshable
getRefreshed, refresh
 

Method Detail

isCachingDisabled

boolean isCachingDisabled()
Checks whether the caching is disabled.

Returns:
true if the caching is disabled, true otherwise.

setCachingDisabled

void setCachingDisabled(boolean flag)
Sets the caching disabled flag.

Parameters:
flag - the caching disabled flag.

expireCached

void expireCached(long timestamp)
Expires all cached entries notifying them about expiration.

Parameters:
timestamp - the timestamp of the expiration.

expireFraction

void expireFraction(long timestamp,
                    float fraction)
Expires the specified fraction of cached entries notifying them about expiration.

Parameters:
timestamp - the timestamp of the expiration.
fraction - the fraction of entries to expire (0.0..1.0).

clearCached

void clearCached()
Clears all cached entries without notifying.


getCache

ConcurrentMap<K,V> getCache(boolean... create)
Gets and optionally creates the cache.

Parameters:
create - true to create a missing cache.
Returns:
the cache or null if disabled.

removeCache

void removeCache()
Removes the cache.


getSharedCacheName

ObjectName getSharedCacheName()
Gets the the shared cache of this client.

Returns:
the object name of the shared cache or a query.

setSharedCacheName

void setSharedCacheName(ObjectName cache)
Sets the shared cache of this client. If it is not set, the default one will be used.

Parameters:
cache - the object name of the shared cache or a query.


Copyright © 2004 The Norther Organization. All rights reserved.