站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 Cache API Documentation 英文版文档

LRUPolicy (JBossCache API) - JBoss 4.0.1 sp1 Cache API Documentation 英文版文档


org.jboss.cache.eviction
Class LRUPolicy

java.lang.Object
  extended byorg.jboss.cache.eviction.BaseEvictionPolicy
      extended byorg.jboss.cache.eviction.LRUPolicy
All Implemented Interfaces:
EvictionPolicy, TreeCacheListener
Direct Known Subclasses:
AopLRUPolicy, FIFOPolicy

public class LRUPolicy
extends BaseEvictionPolicy
implements TreeCacheListener

Provider to provide eviction policy. This one is based on LRU algorithm that a user can specify either maximum number of nodes or the idle time of a node to be evicted.

Author:
Ben Wang 02-2004

Field Summary
protected  org.jboss.logging.Logger log_
           
 
Fields inherited from class org.jboss.cache.eviction.BaseEvictionPolicy
cache_, regionManager_
 
Constructor Summary
LRUPolicy()
           
 
Method Summary
 void cacheStarted(TreeCache cache)
          Called when the cache is started.
 void cacheStopped(TreeCache cache)
          Called when the cache is stopped.
 void configure(TreeCache cache)
          Method called to configure this implementation.
protected  EvictionAlgorithm getEvictionAlgorithm()
           
 int getWakeupIntervalSeconds()
          return eviction thread (if any) wake up interval in seconds.
 void nodeAdded(Fqn fqn)
          --- Implementation of TreeCacheListener interface ---
 void nodeCreated(Fqn fqn)
          Called when a node is created
 void nodeEvicted(Fqn fqn)
          Called when a node is evicted (not the same as remove()).
 void nodeLoaded(Fqn fqn)
          Called when a node is loaded into memory via the CacheLoader.
 void nodeModified(Fqn fqn)
          Called when a node is modified, e.g., one (key, value) pair in the internal map storage has been modified.
 void nodeRemoved(Fqn fqn)
          Note that this removes all children nodes as well.
 void nodeVisited(Fqn fqn)
          Called when a node is visisted, i.e., get().
 void viewChange(org.jgroups.View new_view)
           
 
Methods inherited from class org.jboss.cache.eviction.BaseEvictionPolicy
evict, getCacheData, getChildrenNames, getRegions, hasChild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log_

protected org.jboss.logging.Logger log_
Constructor Detail

LRUPolicy

public LRUPolicy()
Method Detail

nodeAdded

public void nodeAdded(Fqn fqn)
--- Implementation of TreeCacheListener interface ---


nodeRemoved

public void nodeRemoved(Fqn fqn)
Note that this removes all children nodes as well. So we will need to put the children nodes into removed queue.

Specified by:
nodeRemoved in interface TreeCacheListener
Parameters:
fqn -

nodeEvicted

public void nodeEvicted(Fqn fqn)
Description copied from interface: TreeCacheListener
Called when a node is evicted (not the same as remove()).

Specified by:
nodeEvicted in interface TreeCacheListener
Parameters:
fqn -

nodeModified

public void nodeModified(Fqn fqn)
Description copied from interface: TreeCacheListener
Called when a node is modified, e.g., one (key, value) pair in the internal map storage has been modified.

Specified by:
nodeModified in interface TreeCacheListener
Parameters:
fqn -

nodeLoaded

public void nodeLoaded(Fqn fqn)
Description copied from interface: TreeCacheListener
Called when a node is loaded into memory via the CacheLoader. This is not the same as TreeCacheListener.nodeCreated(Fqn).

Specified by:
nodeLoaded in interface TreeCacheListener

nodeCreated

public void nodeCreated(Fqn fqn)
Description copied from interface: TreeCacheListener
Called when a node is created

Specified by:
nodeCreated in interface TreeCacheListener
Parameters:
fqn -

nodeVisited

public void nodeVisited(Fqn fqn)
Description copied from interface: TreeCacheListener
Called when a node is visisted, i.e., get().

Specified by:
nodeVisited in interface TreeCacheListener
Parameters:
fqn -

cacheStarted

public void cacheStarted(TreeCache cache)
Description copied from interface: TreeCacheListener
Called when the cache is started.

Specified by:
cacheStarted in interface TreeCacheListener
Parameters:
cache -

getEvictionAlgorithm

protected EvictionAlgorithm getEvictionAlgorithm()

cacheStopped

public void cacheStopped(TreeCache cache)
Description copied from interface: TreeCacheListener
Called when the cache is stopped.

Specified by:
cacheStopped in interface TreeCacheListener
Parameters:
cache -

viewChange

public void viewChange(org.jgroups.View new_view)
Specified by:
viewChange in interface TreeCacheListener

getWakeupIntervalSeconds

public int getWakeupIntervalSeconds()
Description copied from interface: EvictionPolicy
return eviction thread (if any) wake up interval in seconds.

Specified by:
getWakeupIntervalSeconds in interface EvictionPolicy
Overrides:
getWakeupIntervalSeconds in class BaseEvictionPolicy

configure

public void configure(TreeCache cache)
Description copied from interface: EvictionPolicy
Method called to configure this implementation.

Specified by:
configure in interface EvictionPolicy
Overrides:
configure in class BaseEvictionPolicy


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.