org.jboss.ejb.plugins
Class LRUEnterpriseContextCachePolicy

java.lang.Object
  extended byorg.jboss.util.LRUCachePolicy
      extended byorg.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy
All Implemented Interfaces:
org.jboss.util.CachePolicy, Monitorable, XmlLoadable
Direct Known Subclasses:
LRUStatefulContextCachePolicy

public class LRUEnterpriseContextCachePolicy
extends org.jboss.util.LRUCachePolicy
implements XmlLoadable, Monitorable

Least Recently Used cache policy for EnterpriseContexts.

Version:
$Revision: 1.18.2.7 $
Author:
Simone Bordet, Bill Burke
See Also:
AbstractInstanceCache

Nested Class Summary
protected  class LRUEnterpriseContextCachePolicy.ContextLRUList
          Subclass that logs list activity events.
protected  class LRUEnterpriseContextCachePolicy.OveragerTask
          This TimerTask passivates cached beans that have not been called for a while.
protected  class LRUEnterpriseContextCachePolicy.ResizerTask
          This TimerTask resizes the cache capacity using the cache miss frequency algorithm, that is the more cache misses we have, the more the cache size is enlarged, and viceversa.
 
Nested classes inherited from class org.jboss.util.LRUCachePolicy
org.jboss.util.LRUCachePolicy.LRUCacheEntry, org.jboss.util.LRUCachePolicy.LRUList
 
Field Summary
protected static org.jboss.logging.Logger log
           
protected static Timer tasksTimer
           
 
Fields inherited from class org.jboss.util.LRUCachePolicy
m_list, m_map, m_maxCapacity, m_minCapacity
 
Constructor Summary
LRUEnterpriseContextCachePolicy(AbstractInstanceCache eic)
          Creates a LRU cache policy object given the instance cache that use this policy object.
 
Method Summary
protected  void ageOut(org.jboss.util.LRUCachePolicy.LRUCacheEntry entry)
           
protected  void appendProperties(StringBuffer buffer)
          Append the properties to a buffer
protected  void cacheMiss()
           
protected  org.jboss.util.LRUCachePolicy.LRUList createList()
           
 void destroy()
           
 void importXml(Element element)
          Reads from the configuration the parameters for this cache policy, that are all optionals.
 void sample(Object s)
          Samples the status of the implementor object and register the status into the snapshot argument.
 void start()
           
 void stop()
           
 String toString()
           
 
Methods inherited from class org.jboss.util.LRUCachePolicy
create, createCacheEntry, flush, get, insert, peek, remove, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static org.jboss.logging.Logger log

tasksTimer

protected static Timer tasksTimer
Constructor Detail

LRUEnterpriseContextCachePolicy

public LRUEnterpriseContextCachePolicy(AbstractInstanceCache eic)
Creates a LRU cache policy object given the instance cache that use this policy object.

Method Detail

sample

public void sample(Object s)
Description copied from interface: Monitorable
Samples the status of the implementor object and register the status into the snapshot argument.

Specified by:
sample in interface Monitorable

toString

public String toString()

start

public void start()
Specified by:
start in interface org.jboss.util.CachePolicy

stop

public void stop()
Specified by:
stop in interface org.jboss.util.CachePolicy

destroy

public void destroy()
Specified by:
destroy in interface org.jboss.util.CachePolicy

importXml

public void importXml(Element element)
               throws org.jboss.deployment.DeploymentException
Reads from the configuration the parameters for this cache policy, that are all optionals. FIXME 20010626 marcf: Simone seriously arent' all the options overkill? give it another 6 month . Remember you are exposing the guts of this to the end user, also provide defaults so that if an entry is not specified you can still work and it looks _much_ better in the configuration files.

Specified by:
importXml in interface XmlLoadable
Throws:
org.jboss.deployment.DeploymentException

createList

protected org.jboss.util.LRUCachePolicy.LRUList createList()

ageOut

protected void ageOut(org.jboss.util.LRUCachePolicy.LRUCacheEntry entry)

cacheMiss

protected void cacheMiss()

appendProperties

protected void appendProperties(StringBuffer buffer)
Append the properties to a buffer

Parameters:
buffer - the buffer


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