lumis.portal.cache
Class PortalCache<K>

Package class diagram package PortalCache
java.lang.Object
  extended by lumis.portal.cache.PortalCache<K>
Type Parameters:
K - Type of cacheable object

@StableMinor(version="4.1",
             sinceVersion="4.0")
public class PortalCache<K>
extends Object

Memory cache for portal objects

Since:
4.0.0

Constructor Summary
PortalCache(String cacheId)
           
PortalCache(String cacheId, boolean autoClone)
           
 
Method Summary
 void clear()
           
 void clear(ITransaction transaction)
          Clears the cache and disables it until the given transaction ends.
static void clearAll()
           
 void destroy()
           
 K get(String key)
           
static PortalCache getCache(String cacheId)
           
static Collection<String> getCacheIds()
           
 int getCapacity()
          Returns the current capacity of this portal cache.
 String getId()
           
 int getSize()
          Returns the number of entries currently stored in this cache.
 ICacheStatistics getStatistics()
           
 void put(String key, K value)
           
 void remove(String key)
           
 void remove(String key, ITransaction transaction)
          Removes an entry from the cache now and after the given transaction ends.
 void setCapacity(int newCapacity)
          Sets the capacity for this portal cache.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PortalCache

public PortalCache(String cacheId)

PortalCache

public PortalCache(String cacheId,
                   boolean autoClone)
Method Detail

clearAll

public static void clearAll()

getId

public String getId()

toString

public String toString()
Overrides:
toString in class Object

get

public K get(String key)

put

public void put(String key,
                K value)

remove

public void remove(String key)

remove

public void remove(String key,
                   ITransaction transaction)
            throws PortalException
Removes an entry from the cache now and after the given transaction ends. The entry is not stored in the cache until the transaction ends (commits or rollsback).

Parameters:
key - the entry key.
transaction - the transaction.
Throws:
PortalException
Since:
4.0.10

clear

public void clear()

clear

public void clear(ITransaction transaction)
           throws PortalException
Clears the cache and disables it until the given transaction ends. No entry is stored in the cache until the transaction ends (commits or rollsback).

Parameters:
transaction - the transaction.
Throws:
PortalException
Since:
4.1.0

getSize

public int getSize()
Returns the number of entries currently stored in this cache.

Returns:
the number of entries currently stored in this cache.
Since:
4.0.11

getCapacity

public int getCapacity()
Returns the current capacity of this portal cache.

Returns:
the current capacity of this portal cache, in number of entries.
Since:
4.0.11

setCapacity

public void setCapacity(int newCapacity)
Sets the capacity for this portal cache.

Since:
4.0.11

destroy

public void destroy()

getStatistics

public ICacheStatistics getStatistics()

getCache

public static PortalCache getCache(String cacheId)

getCacheIds

public static Collection<String> getCacheIds()


Lumisportal  4.1.0.071221 - Copyright © 2001-2007, Lumis. All Rights Reserved.