Compiere 3.1

org.compiere.cm.cache
Class CO

java.lang.Object
  extended by org.compiere.cm.cache.CO
Direct Known Subclasses:
Chat, Container, ContainerElement, ContainerTree, Domain, MediaServer, Template, WebProject, WikiToken, XML

public class CO
extends Object

CO CacheObject we store parts of the content in caches on the webservers to reduce DB load and speed up page deployment

Version:
$Id$
Author:
Yves Sandfort

Field Summary
protected  Hashtable<String,Object> cache
           
protected static int cacheSize
           
protected  Hashtable<String,Long> cacheUsage
           
protected  Ctx ctx
           
protected  CLogger log
          Logger
 
Constructor Summary
CO()
          Cache Object
 
Method Summary
 void empty()
          empty complete Cache
 Ctx getCtx()
          get Context
 Enumeration<String> getKeys()
          get key enumeration
 int getSize()
          getSize of current cache
 String[] getSortedKeys()
          getSortedKeys of Cache Object
 Hashtable<String,Object> getValueTable()
           
 void put(String ID, Object thisObject)
          put
 void remove(int ID)
          remove
 void remove(String ID)
          remove
 void setCtx(Ctx thisCtx)
          set Context
 String show()
          Show Cache Content
 void use(int ID)
          Update Usage value for cache optimization
 void use(String ID)
          Update Usage value for cache optimization
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cacheSize

protected static int cacheSize

cache

protected Hashtable<String,Object> cache

cacheUsage

protected Hashtable<String,Long> cacheUsage

ctx

protected Ctx ctx

log

protected CLogger log
Logger

Constructor Detail

CO

public CO()
Cache Object

Method Detail

setCtx

public void setCtx(Ctx thisCtx)
set Context

Parameters:
thisCtx -

getCtx

public Ctx getCtx()
get Context

Returns:
Context

put

public void put(String ID,
                Object thisObject)
put

Parameters:
ID -
thisObject -

remove

public void remove(int ID)
remove

Parameters:
ID -

remove

public void remove(String ID)
remove

Parameters:
ID -

getSize

public int getSize()
getSize of current cache

Returns:
number of cache entries

getKeys

public Enumeration<String> getKeys()
get key enumeration

Returns:
key enumeration

getSortedKeys

public String[] getSortedKeys()
getSortedKeys of Cache Object

Returns:
list of sorted Key Value

use

public void use(int ID)
Update Usage value for cache optimization

Parameters:
ID -

use

public void use(String ID)
Update Usage value for cache optimization

Parameters:
ID -

empty

public void empty()
empty complete Cache


show

public String show()
Show Cache Content

Returns:
XML String with CacheContent

getValueTable

public Hashtable<String,Object> getValueTable()

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.