IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.base
Class RemoveExpiredThread

java.lang.Object
  extended by com.ibm.btt.base.RemoveExpiredThread
All Implemented Interfaces:
java.lang.Runnable

public class RemoveExpiredThread
extends java.lang.Object
implements java.lang.Runnable

This class removes the expired objects from the externalizer cache table. The parameters used to verify when an object is expired (cachedObjectsExpirationTime) and the frequency to remove the objects from cache (removeExpiredFromCacheEvery) are defined in the btt.xml.


Constructor Summary
RemoveExpiredThread()
          RemoveExpiredThread default constructor.
RemoveExpiredThread(long cachedObjectsExpirationTime, long removeExpiredFromCacheEvery)
          RemoveExpiredThread constructor.
 
Method Summary
 long getCachedObjectsExpirationTime()
          Returns the cachedObjectsExpirationTime.
 long getRemoveExpiredFromCacheEvery()
          Returns the removeExpiredFromCacheEvery.
protected  boolean isExpired(long createdAt)
          Verifies if the long passed as parameter corresponds to an expired object.
protected  void removingPolicy()
          Removes expired objects from cache table using the next policy: For each externalizer, verifies if the cache is enabled and removes all the expired objects from cache table.
 void run()
          Removes expired objects from cache table, this thread is activated using the frequency indicated by parameter removeExpiredFromCacheEvery defined in the btt.xml file.
 void setCachedObjectsExpirationTime(long cachedObjectsExpirationTime)
          Sets the cachedObjectsExpirationTime.
 void setRemoveExpiredFromCacheEvery(long removeExpiredFromCacheEvery)
          Sets the removeExpiredFromCacheEvery.
static void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoveExpiredThread

public RemoveExpiredThread()
RemoveExpiredThread default constructor.


RemoveExpiredThread

public RemoveExpiredThread(long cachedObjectsExpirationTime,
                           long removeExpiredFromCacheEvery)
RemoveExpiredThread constructor.

Parameters:
cachedObjectsExpirationTime - long Cached objects expiration time.
removeExpiredFromCacheEvery - long Frequency of thread activation.
Method Detail

run

public void run()
Removes expired objects from cache table, this thread is activated using the frequency indicated by parameter removeExpiredFromCacheEvery defined in the btt.xml file.

Specified by:
run in interface java.lang.Runnable

removingPolicy

protected void removingPolicy()
                       throws java.lang.Exception
Removes expired objects from cache table using the next policy: For each externalizer, verifies if the cache is enabled and removes all the expired objects from cache table.

Throws:
java.lang.Exception - generic exception.

isExpired

protected boolean isExpired(long createdAt)
Verifies if the long passed as parameter corresponds to an expired object.

Parameters:
createdAt - long value to verify
Returns:
boolean - indicating if is expired.

getCachedObjectsExpirationTime

public long getCachedObjectsExpirationTime()
Returns the cachedObjectsExpirationTime.

Returns:
long

getRemoveExpiredFromCacheEvery

public long getRemoveExpiredFromCacheEvery()
Returns the removeExpiredFromCacheEvery.

Returns:
long

setCachedObjectsExpirationTime

public void setCachedObjectsExpirationTime(long cachedObjectsExpirationTime)
Sets the cachedObjectsExpirationTime.

Parameters:
cachedObjectsExpirationTime - The cachedObjectsExpirationTime to set

setRemoveExpiredFromCacheEvery

public void setRemoveExpiredFromCacheEvery(long removeExpiredFromCacheEvery)
Sets the removeExpiredFromCacheEvery.

Parameters:
removeExpiredFromCacheEvery - The removeExpiredFromCacheEvery to set

stop

public static void stop()

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2009