Class DataCache<T>

  • Type Parameters:
    T - the object type that will be cached

    public class DataCache<T>
    extends java.lang.Object
    A generic wrapper for the Java Caching System (JCS).
    Author:
    Jeremy Long
    • Constructor Summary

      Constructors 
      Constructor Description
      DataCache​(org.apache.commons.jcs3.access.CacheAccess<java.lang.String,​T> cache)
      Creates a new generic JCS wrapper.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T get​(java.lang.String key)
      Gets an object from the cache.
      void put​(java.lang.String key, T content)
      Puts an object into the cache.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DataCache

        public DataCache​(org.apache.commons.jcs3.access.CacheAccess<java.lang.String,​T> cache)
        Creates a new generic JCS wrapper.
        Parameters:
        cache - a reference to the underlying cache implementation.
    • Method Detail

      • get

        public T get​(java.lang.String key)
        Gets an object from the cache.
        Parameters:
        key - the key for the cached object
        Returns:
        the cached object
      • put

        public void put​(java.lang.String key,
                        T content)
        Puts an object into the cache.
        Parameters:
        key - the key for the cached object
        content - the object to put into the cache