com.softwareag.xbd.extension
Class CacheController

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended bycom.softwareag.xbd.extension.CacheController
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.lang.Runnable, java.io.Serializable

public class CacheController
extends java.util.Hashtable
implements java.lang.Runnable

This cache controller controls resouces up to timelimit. When the timelimit is reached, the resource is removed from internal cache. A get request starts a new timelimit.

Version:
$Revision: 1.1 $
See Also:
Serialized Form

Nested Class Summary
static interface CacheController.Event
          Interface for controller events
static interface CacheController.Interface
          Interface for timeout notification.
 
Constructor Summary
CacheController()
           
CacheController(CacheController.Interface i)
           
CacheController(CacheController.Interface i, int nonActivityTimeout)
           
CacheController(CacheController.Interface i, java.lang.String nonActivityTimeout)
           
 
Method Summary
 void close()
          Close and release the cache controller.
 void doStop()
          Stop the controller worker thread.
protected  void finalize()
           
 java.lang.Object get(java.lang.Object key)
          Get a object from a key.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Put to control a new object with special key.
 java.lang.Object remove(java.lang.Object key)
          Remove object with key.
 void run()
          Worker thread main function
 void setIntervall(long millis)
           
 void setNonActivityTimeout(int value)
           
 void setNonActivityTimeout(java.lang.String value)
           
 void setNotifyer(CacheController.Event e)
           
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, hashCode, isEmpty, keys, keySet, putAll, rehash, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheController

public CacheController()

CacheController

public CacheController(CacheController.Interface i)

CacheController

public CacheController(CacheController.Interface i,
                       int nonActivityTimeout)

CacheController

public CacheController(CacheController.Interface i,
                       java.lang.String nonActivityTimeout)
Method Detail

setNonActivityTimeout

public void setNonActivityTimeout(int value)

setNonActivityTimeout

public void setNonActivityTimeout(java.lang.String value)

setNotifyer

public void setNotifyer(CacheController.Event e)

setIntervall

public void setIntervall(long millis)

get

public java.lang.Object get(java.lang.Object key)
Get a object from a key. Start a new timelimit.

Specified by:
get in interface java.util.Map

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Put to control a new object with special key.

Specified by:
put in interface java.util.Map

remove

public java.lang.Object remove(java.lang.Object key)
Remove object with key.

Specified by:
remove in interface java.util.Map

run

public void run()
Worker thread main function

Specified by:
run in interface java.lang.Runnable

doStop

public void doStop()
Stop the controller worker thread.


finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable

close

public void close()
Close and release the cache controller.



Copyright © 2004-2007 Software AG. All Rights Reserved.