FileDocCategorySizeDatePackage
TxCache.javaAPI DocJBoss 4.2.12010Fri Jul 13 21:02:32 BST 2007org.jboss.aspects.versioned

TxCache

public class TxCache extends org.jboss.util.LRUCachePolicy
This is a LRU cache. The TxCache itself is not transactional but any accesses to objects within the cache ARE transactional.

Fields Summary
protected long
lockTimeout
protected LocalSynchronizationManager
synchManager
protected DistributedVersionManager
versionManager
Constructors Summary
public TxCache(int maxSize, long lockTimeout)

      super(2, maxSize);
      this.lockTimeout = lockTimeout;
      synchManager = new LocalSynchronizationManager(null);
      versionManager = new DistributedVersionManager(lockTimeout, synchManager);
      this.create();
      this.start();
   
Methods Summary
public voidinsert(java.lang.Object key, java.lang.Object obj)

      try
      {
         Object versioned = versionManager.makeVersioned(obj);
         super.insert(key, versioned);
      }
      catch (Exception ex)
      {
         throw new RuntimeException(ex);
      }