org.jboss.cache.eviction
Class NullEvictionAlgorithm

java.lang.Object
  extended by org.jboss.cache.eviction.NullEvictionAlgorithm
All Implemented Interfaces:
EvictionAlgorithm

public class NullEvictionAlgorithm
extends Object
implements EvictionAlgorithm

An eviction algorithm that does nothing - a no-op for everything.

Author:
Brian Stansberry

Method Summary
 void assignToRegion(Fqn fqn, CacheSPI<?,?> cache, EvictionAlgorithmConfig evictionAlgorithmConfig, Configuration configuration)
          Assigns the algorithm instance to a specific region.
 boolean canIgnoreEvent(EvictionEvent.Type eventType)
          Tests whether the algorithm would ignore certain event types on certain Fqns.
 Class<? extends EvictionAlgorithmConfig> getConfigurationClass()
          This is a helper so that the XML parser will be able to select and use the correct EvictionAlgorithmConfig implementation class corresponding to this EvictionAlgorithm.
 EvictionQueue getEvictionQueue()
          Returns NullEvictionQueue.INSTANCE.
static NullEvictionAlgorithm getInstance()
           
 void initialize()
          Invoked by the region manager when the enclosing region is initialized.
 void process(BlockingQueue<EvictionEvent> queue)
          Entry point for eviction algorithm.
 void resetEvictionQueue()
          Reset the whole eviction queue.
 void setEvictionActionPolicy(EvictionActionPolicy evictionActionPolicy)
          Sets the eviction action policy, so the algorithm knows what to do when a node is to be evicted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static NullEvictionAlgorithm getInstance()

getEvictionQueue

public EvictionQueue getEvictionQueue()
Returns NullEvictionQueue.INSTANCE.

Specified by:
getEvictionQueue in interface EvictionAlgorithm
Returns:
the EvictionQueue implementation.

setEvictionActionPolicy

public void setEvictionActionPolicy(EvictionActionPolicy evictionActionPolicy)
Description copied from interface: EvictionAlgorithm
Sets the eviction action policy, so the algorithm knows what to do when a node is to be evicted.

Specified by:
setEvictionActionPolicy in interface EvictionAlgorithm
Parameters:
evictionActionPolicy - to set

assignToRegion

public void assignToRegion(Fqn fqn,
                           CacheSPI<?,?> cache,
                           EvictionAlgorithmConfig evictionAlgorithmConfig,
                           Configuration configuration)
Description copied from interface: EvictionAlgorithm
Assigns the algorithm instance to a specific region.

Specified by:
assignToRegion in interface EvictionAlgorithm
Parameters:
fqn - of the region to be assigned to
cache - cache reference
evictionAlgorithmConfig - configuration for the current algorithm instance.
configuration - for the entire cache.

process

public void process(BlockingQueue<EvictionEvent> queue)
             throws EvictionException
Description copied from interface: EvictionAlgorithm
Entry point for eviction algorithm. Invoking this will cause the algorithm to process the queue of EvictionEvent passed in.

Specified by:
process in interface EvictionAlgorithm
Parameters:
queue - to process
Throws:
EvictionException

resetEvictionQueue

public void resetEvictionQueue()
Description copied from interface: EvictionAlgorithm
Reset the whole eviction queue. The queue may need to be reset due to corrupted state, for example.

Specified by:
resetEvictionQueue in interface EvictionAlgorithm

canIgnoreEvent

public boolean canIgnoreEvent(EvictionEvent.Type eventType)
Description copied from interface: EvictionAlgorithm
Tests whether the algorithm would ignore certain event types on certain Fqns.

Specified by:
canIgnoreEvent in interface EvictionAlgorithm
Parameters:
eventType - event type to test for
Returns:
true if the event representing the parameters would be ignored by this algorithm or not.

initialize

public void initialize()
Description copied from interface: EvictionAlgorithm
Invoked by the region manager when the enclosing region is initialized.

Specified by:
initialize in interface EvictionAlgorithm

getConfigurationClass

public Class<? extends EvictionAlgorithmConfig> getConfigurationClass()
Description copied from interface: EvictionAlgorithm
This is a helper so that the XML parser will be able to select and use the correct EvictionAlgorithmConfig implementation class corresponding to this EvictionAlgorithm. E.g., the FIFOAlgorithm would return FIFOAlgorithmConfig.class.

Specified by:
getConfigurationClass in interface EvictionAlgorithm
Returns:
a class that is used to configure this EvictionAlgorithm.


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.