org.mmbase.module
Class cache

Package class diagram package cache
java.lang.Object
  extended by org.mmbase.util.functions.FunctionProvider
      extended by org.mmbase.util.functions.DescribedFunctionProvider
          extended by org.mmbase.module.Module
              extended by org.mmbase.module.cache
All Implemented Interfaces:
Descriptor, cacheInterface

public class cache
extends Module
implements cacheInterface

Simple file cache system that can be used by any servlet

Version:
$Id: cache.java 35335 2009-05-21 08:14:41Z michiel $
Author:
$Author: nklasens $
Application:
cache [utility, implementation]
Javadoc:
Move:
org.mmbase.cache.implementation
Rename:
Cache

Field Summary
(package private)  int hits
           
(package private)  LRUHashtable<Object,Object> lines
           
(package private)  int miss
           
(package private)  boolean state_up
           
 
Fields inherited from class org.mmbase.module.Module
configurationPath, getMaintainerFunction, getVersionFunction, properties, STATE_START_TIME
 
Fields inherited from class org.mmbase.util.functions.DescribedFunctionProvider
description, guiName, name
 
Fields inherited from class org.mmbase.util.functions.FunctionProvider
functions, getFunctions
 
Constructor Summary
cache()
          Simple file cache system that can be used by any servlet
 
Method Summary
 boolean clear()
          Clear the whole cache in one go
 cacheline get(Object wanted)
          Try to get a cacheline from cache, returns null if not found
 String getModuleInfo()
           
 Map<String,String> getStates()
           
 void init()
           
 LRUHashtable<Object,Object> lines()
          Old interface to the inner table, will be removed soon
 void onload()
           
 cacheline put(Object key, Object value)
          Try to put a cacheline in cache, returns old one if available In all other cases returns null.
(package private)  void readParams()
           
 void reload()
           
 cacheline remove(Object key)
          Remove the entry identified by key from the cache
 void shutdown()
           
 Map<String,String> state()
           
 void unload()
           
 
Methods inherited from class org.mmbase.module.Module
, addInitParameters, checkModules, getInitParameter, getInitParameter, getInitParameter, getInitParameters, getInitParameters, getMaintainer, getModule, getModule, getModule, getModule, getModuleLoader, getModuleReader, getModuleReader, getModules, getState, getVersion, hasModule, hasStarted, loadInitParameters, loadInitParameters, maintainance, setInitParameter, setMaintainer, setState, setVersion, shutdownModules, startModule, startModules
 
Methods inherited from class org.mmbase.util.functions.DescribedFunctionProvider
getDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUIName, setName
 
Methods inherited from class org.mmbase.util.functions.FunctionProvider
addFunction, createParameters, getFunction, getFunctions, getFunctionValue, newFunctionInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state_up

boolean state_up
Javadoc:
Scope:
private

hits

int hits
Javadoc:
Scope:
private

miss

int miss
Javadoc:
Scope:
private

lines

LRUHashtable<Object,Object> lines
Javadoc:
Scope:
private
Constructor Detail

cache

public cache()
Simple file cache system that can be used by any servlet

Method Detail

onload

public void onload()
Overrides:
onload in class Module
Duplicate:

reload

public void reload()
Javadoc:

shutdown

public void shutdown()
Overrides:
shutdown in class Module
Duplicate:

lines

public LRUHashtable<Object,Object> lines()
Old interface to the inner table, will be removed soon

Specified by:
lines in interface cacheInterface
Deprecated-now:
direct access to lines seems undesirable and is implementation-dependent

get

public cacheline get(Object wanted)
Try to get a cacheline from cache, returns null if not found

Specified by:
get in interface cacheInterface
Javadoc:

put

public cacheline put(Object key,
                     Object value)
Try to put a cacheline in cache, returns old one if available In all other cases returns null.

Specified by:
put in interface cacheInterface
Javadoc:

clear

public boolean clear()
Clear the whole cache in one go

Specified by:
clear in interface cacheInterface

remove

public cacheline remove(Object key)
Remove the entry identified by key from the cache

Specified by:
remove in interface cacheInterface
Javadoc:

init

public void init()
Specified by:
init in interface cacheInterface
Overrides:
init in class Module
Javadoc:

unload

public void unload()
Javadoc:

getStates

public Map<String,String> getStates()
Overrides:
getStates in class Module
Javadoc:

state

public Map<String,String> state()

readParams

void readParams()
Javadoc:

getModuleInfo

public String getModuleInfo()
Overrides:
getModuleInfo in class Module
Duplicate:
Should be handled with a standard method in Module that uses the configuration files.


MMBase Scan 2.0-SNAPSHOT - 2013-03-30T06:50