org.shiftone.cache.adaptor
Class OroCache

java.lang.Object
  extended byorg.shiftone.cache.adaptor.OroCache
All Implemented Interfaces:
Cache

public class OroCache
extends java.lang.Object
implements Cache

Makes a ORO cache look like a shiftone cache.

Notes

  • No support for remove
  • No support for clear
  • No support for node expiration
  • Cache initially allocates array of size "capacity"

    Version:
    $Revision: 1.8 $
    Author:
    Jeff Drost

    Constructor Summary
    OroCache(org.apache.oro.util.Cache cache)
               
     
    Method Summary
     void addObject(java.lang.Object key, java.lang.Object cacheObject)
              adds an object to the cache
     void clear()
              NOOP
    static Cache createFIFO(int capacity)
               
    static Cache createFIFO2(int capacity)
               
    static Cache createLRU(int capacity)
               
    static Cache createRandom(int capacity)
               
     java.lang.Object getObject(java.lang.Object key)
              gets the value stored in the cache by it's key, or null if the key is not found.
     void remove(java.lang.Object key)
              NOOP
     int size()
              The number of key/value pares in the cache
     java.lang.String toString()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    OroCache

    public OroCache(org.apache.oro.util.Cache cache)
    Method Detail

    createFIFO

    public static Cache createFIFO(int capacity)

    createFIFO2

    public static Cache createFIFO2(int capacity)

    createLRU

    public static Cache createLRU(int capacity)

    createRandom

    public static Cache createRandom(int capacity)

    addObject

    public void addObject(java.lang.Object key,
                          java.lang.Object cacheObject)
    Description copied from interface: Cache
    adds an object to the cache

    Specified by:
    addObject in interface Cache

    getObject

    public java.lang.Object getObject(java.lang.Object key)
    Description copied from interface: Cache
    gets the value stored in the cache by it's key, or null if the key is not found.

    Specified by:
    getObject in interface Cache

    size

    public int size()
    Description copied from interface: Cache
    The number of key/value pares in the cache

    Specified by:
    size in interface Cache

    remove

    public void remove(java.lang.Object key)
    NOOP

    Specified by:
    remove in interface Cache

    clear

    public void clear()
    NOOP

    Specified by:
    clear in interface Cache

    toString

    public java.lang.String toString()