Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.roller.presentation.website
Class ThemeCache  view ThemeCache download ThemeCache.java

java.lang.Object
  extended byorg.roller.presentation.website.ThemeCache

public class ThemeCache
extends java.lang.Object

Caches the Theme files to avoid repeated reading of the files from the harddrive.


Field Summary
private static Cache cache
           
private static java.lang.String cacheName
           
private static boolean cacheTemplateFiles
          Should the PreviewResourceLoader cache the Template files.
private  long expireInterval
          How long until an object in cache expires.
private static ThemeCache INSTANCE
           
private static int maxObjects
          How many objects to store in cache.
 
Constructor Summary
private ThemeCache()
          Private constructor to prevent outside instantiation
 
Method Summary
private  Cache getCache()
          Get Cache from Commons CacheSingleton.
 java.lang.String[] getFileList(java.lang.String themeDir)
          The list of files in a Theme is cached as a String[], the key being the Theme location itself.
 java.lang.String getFromCache(java.lang.String themeName, java.lang.String fileName)
          Null will be returned if there is a problem or if caching is "turned off".
static ThemeCache getInstance()
           
 java.lang.String putIntoCache(java.lang.String themeName, java.lang.String fileName, java.lang.String template)
           
 void removeFromCache(java.lang.String themeName, java.lang.String fileName)
           
 java.lang.String[] setFileList(java.lang.String themeDir, java.lang.String[] fileNames)
          The list of files in a Theme is cached as a String[], the key being the Theme location itself.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

private static ThemeCache INSTANCE

cacheName

private static java.lang.String cacheName

cache

private static Cache cache

maxObjects

private static int maxObjects
How many objects to store in cache.


expireInterval

private long expireInterval
How long until an object in cache expires.


cacheTemplateFiles

private static boolean cacheTemplateFiles
Should the PreviewResourceLoader cache the Template files.

Constructor Detail

ThemeCache

private ThemeCache()
Private constructor to prevent outside instantiation

Method Detail

getCache

private Cache getCache()
Get Cache from Commons CacheSingleton. If one happens to not exist yet, make one.


getInstance

public static ThemeCache getInstance()

putIntoCache

public java.lang.String putIntoCache(java.lang.String themeName,
                                     java.lang.String fileName,
                                     java.lang.String template)

getFromCache

public java.lang.String getFromCache(java.lang.String themeName,
                                     java.lang.String fileName)
Null will be returned if there is a problem or if caching is "turned off".


removeFromCache

public void removeFromCache(java.lang.String themeName,
                            java.lang.String fileName)

setFileList

public java.lang.String[] setFileList(java.lang.String themeDir,
                                      java.lang.String[] fileNames)
The list of files in a Theme is cached as a String[], the key being the Theme location itself.


getFileList

public java.lang.String[] getFileList(java.lang.String themeDir)
The list of files in a Theme is cached as a String[], the key being the Theme location itself. If caching is turned off this will return null.