org.jboss.ejb.plugins
Class LRUEnterpriseContextCachePolicy
java.lang.Object
org.jboss.util.LRUCachePolicy
org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy
- All Implemented Interfaces:
- XmlLoadable, Monitorable, org.jboss.util.CachePolicy
- Direct Known Subclasses:
- LRUStatefulContextCachePolicy
public class LRUEnterpriseContextCachePolicy
- extends org.jboss.util.LRUCachePolicy
- implements XmlLoadable, Monitorable
Least Recently Used cache policy for EnterpriseContexts.
- Version:
- $Revision: 57209 $
- Author:
- Simone Bordet, Bill Burke
- See Also:
AbstractInstanceCache
Nested classes/interfaces 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 |
Method Summary |
protected void |
ageOut(org.jboss.util.LRUCachePolicy.LRUCacheEntry entry)
|
protected void |
cacheMiss()
|
protected org.jboss.util.LRUCachePolicy.LRUList |
createList()
|
void |
destroy()
|
void |
flush()
Flush is overriden here because in this policy impl
flush might not actually remove all the instances from the cache. |
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()
|
Methods inherited from class org.jboss.util.LRUCachePolicy |
create, createCacheEntry, get, insert, peek, remove, size |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static org.jboss.logging.Logger log
tasksTimer
protected static Timer tasksTimer
LRUEnterpriseContextCachePolicy
public LRUEnterpriseContextCachePolicy(AbstractInstanceCache eic)
- Creates a LRU cache policy object given the instance cache that use
this policy object.
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
start
public void start()
- Specified by:
start
in interface org.jboss.util.CachePolicy
- Overrides:
start
in class org.jboss.util.LRUCachePolicy
stop
public void stop()
- Specified by:
stop
in interface org.jboss.util.CachePolicy
- Overrides:
stop
in class org.jboss.util.LRUCachePolicy
destroy
public void destroy()
- Specified by:
destroy
in interface org.jboss.util.CachePolicy
- Overrides:
destroy
in class org.jboss.util.LRUCachePolicy
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
flush
public void flush()
- Flush is overriden here because in this policy impl
flush might not actually remove all the instances from the cache.
Those instances that are in use (associated with a transaction) should not
be removed from the cache. So, the iteration is done not until the cache is empty
but until we tried to age-out every instance in the cache.
- Specified by:
flush
in interface org.jboss.util.CachePolicy
- Overrides:
flush
in class org.jboss.util.LRUCachePolicy
createList
protected org.jboss.util.LRUCachePolicy.LRUList createList()
- Overrides:
createList
in class org.jboss.util.LRUCachePolicy
ageOut
protected void ageOut(org.jboss.util.LRUCachePolicy.LRUCacheEntry entry)
- Overrides:
ageOut
in class org.jboss.util.LRUCachePolicy
cacheMiss
protected void cacheMiss()
- Overrides:
cacheMiss
in class org.jboss.util.LRUCachePolicy
Copyright © 2002 JBoss Group, LLC. All Rights Reserved.