|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.mmbase.module.Module
|
+--org.mmbase.module.scancache
File cache system.
This system only caches texts (it stores and retrieves strings).
Texts are asociated with a key, which is used both as a filename on disk and a
key into a memory cache.
While in theory it is possible to cache ANY text, this module is mainly used to store pages
based on their url.
Caching is done in pools. Each pool has its own memory cache and files, and has
different ways to handle file caching. The pools currently supported are "PAGE" and "HENK".
| Field Summary | |
static int |
MAX_CACHE_POOL_SIZE
Maximum size of a pool's memory cache. |
| Constructor Summary | |
scancache()
Scancache module constructor. |
|
| Method Summary | |
java.lang.String |
get(java.lang.String poolName,
java.lang.String key)
Retrieve a file from the indicated pool's cache. |
java.lang.String |
get(java.lang.String poolName,
java.lang.String key,
java.lang.String line)
Retrieve a file from the indicated pool's cache. |
java.lang.String |
getModuleInfo()
Retrieve a description of the module's function. |
java.lang.String |
getNew(java.lang.String poolName,
java.lang.String key,
java.lang.String line)
Retrieve a file from the indicated pool's cache. |
java.lang.String |
getPage(java.lang.String poolName,
java.lang.String key,
java.lang.String line)
Retrieve a file from disk. |
boolean |
getStatus()
Returns the status of this module. |
void |
init()
Initializes the module. |
fileInfo |
loadFile(java.lang.String pool,
java.lang.String filename)
loads a file to disk. |
void |
maintainance()
maintainance call, will be called by the admin to perform managment tasks. |
java.lang.String |
newput(java.lang.String poolName,
javax.servlet.http.HttpServletResponse res,
java.lang.String key,
java.lang.String value,
java.lang.String mimeType)
Store a file in the indicated pool's cache (both on file and in teh memory cache). |
java.lang.String |
newput2(java.lang.String poolName,
java.lang.String key,
java.lang.String value,
int cachetype,
java.lang.String mimeType)
Deprecated. Temporary hack for solving asis problems (?). Use newput(java.lang.String, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.String, java.lang.String) instead. |
void |
onload()
Event that should be triggered when the module is loaded. |
java.lang.String |
put(java.lang.String poolName,
java.lang.String key,
java.lang.String value)
Store a file in the indicated pool's cache (both on file and in the memory cache). |
void |
remove(java.lang.String poolName,
java.lang.String key)
Removes an entry from the cache pool (both the file on disk and in the memory cache). |
boolean |
saveFile(java.lang.String pool,
java.lang.String filename,
java.lang.String value)
Saves a file to disk. |
void |
shutdown()
Event that sh*ould be triggered when the module is shut down. |
void |
signalNetFileSrv(java.lang.String filename)
Signal the NetFileServ builder that the .asis file for a page has changed. |
java.util.Hashtable |
state()
state, returns the state hashtable that is/can be used to debug. |
void |
unload()
Event that should be triggered when the module is unloaded. |
| Methods inherited from class org.mmbase.module.Module |
getClassName, getInitParameter, getInitParameters, getMaintainer, getMimeType, getMimeTypeFile, getModule, getModule, getModules, getName, getProperties, getProperty, getVersion, hasStarted, loadModulesFromDisk, setClassName, setInitParameter, setMaintainer, setName, setVersion, startModule, startModules |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int MAX_CACHE_POOL_SIZE
| Constructor Detail |
public scancache()
| Method Detail |
public void onload()
onload in class Modulepublic void shutdown()
public void unload()
public void init()
init in interface scancacheInterfaceinit in class Module
public java.lang.String get(java.lang.String poolName,
java.lang.String key)
get in interface scancacheInterfacepoolname - name of the cache pool, either "HENK" or "PAGE"key - URL of the page to retrievenull if no entry was found
(i.e. cache was empty or poolname was invalid).
public java.lang.String getNew(java.lang.String poolName,
java.lang.String key,
java.lang.String line)
getNew in interface scancacheInterfacepoolname - name of the cache pool, either "HENK" or "PAGE"key - URL of the page to retrieveline - contains parameters for counters, expiration time, etc, in tag-format.
For this method, these options are currently only used at the mmbase.org site.null if no entry was found
(i.e. cache was empty or poolname was invalid).
public java.lang.String get(java.lang.String poolName,
java.lang.String key,
java.lang.String line)
get in interface scancacheInterfacepoolname - name of the cache pool, expected (but not verified) are "HENK" or "PAGE"key - URL of the page to retrieveline - the expiration value, either the expiration value in seconds or the word 'NOEXPIRE'. Due to
legacy this value needs to be closed with a '>'.
If the parameter is empty a default value is used.null if no entry was found
public java.lang.String getPage(java.lang.String poolName,
java.lang.String key,
java.lang.String line)
poolname - name of the cache pool (expected, but not verified is "PAGE")key - URL of the page to retrieveline - cache line options, unspecifiednull if no entry was found
public java.lang.String newput(java.lang.String poolName,
javax.servlet.http.HttpServletResponse res,
java.lang.String key,
java.lang.String value,
java.lang.String mimeType)
newput in interface scancacheInterfacepoolname - name of the cache pool, either "HENK" or "PAGE"res - reponse object for retrieving headers (used by mmbase.org?)
only needed for cachepool "PAGE"key - URL of the page to storevalue - the page content to storemimeType - the page's mime type, only needed for cachepool "PAGE"null if no entry was found
(i.e. cache was empty or poolname was invalid).
public java.lang.String newput2(java.lang.String poolName,
java.lang.String key,
java.lang.String value,
int cachetype,
java.lang.String mimeType)
newput(java.lang.String, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.String, java.lang.String) instead.
newput2 in interface scancacheInterfacepoolname - name of the cache pool, either "HENK" or "PAGE"key - URL of the page to storevalue - the page content to storeint - cachetype only needed for cachepool "PAGE".
If 0, no file transfer is performed. Otherwise the NetFileSrv builder is
invoked to start the VWM that handles the transfer.mimeType - the page's mime type, only needed for cachepool "PAGE"null if no entry was found
(i.e. cache was empty or poolname was invalid).
public java.lang.String put(java.lang.String poolName,
java.lang.String key,
java.lang.String value)
put in interface scancacheInterfacepoolname - name of the cache poolkey - URL of the page to storevalue - the page content to storenull if no entry was foundpublic java.util.Hashtable state()
Modulestate in class Modulepublic void maintainance()
maintainance in class Modulepublic java.lang.String getModuleInfo()
getModuleInfo in class Module
public boolean saveFile(java.lang.String pool,
java.lang.String filename,
java.lang.String value)
pool - The name of the poolfilename - the name of the filevalue - the value to store in the file
public fileInfo loadFile(java.lang.String pool,
java.lang.String filename)
pool - The name of the poolfilename - the name of the filefileInfo object.public void signalNetFileSrv(java.lang.String filename)
filename - the .asis filename that changed
public void remove(java.lang.String poolName,
java.lang.String key)
remove in interface scancacheInterfacepool - name of cache pool, expected (but not verified) "HENK" or "PAGE"key - URL of the page to removepublic boolean getStatus()
true if the module is active, false otherwise
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||