org.apache.jetspeed.services.portletcache
Class GlobalCache

java.lang.Object
  extended byorg.apache.jetspeed.services.portletcache.GlobalCache

public class GlobalCache
extends java.lang.Object

This class is a static wrapper around the Turbine GlobalCacheService which doesn't provide its own wrapper.

Version:
$Id: GlobalCache.java,v 1.8 2005/03/21 18:21:44 sgala Exp $
Author:
Raphaël Luta
See Also:
GlobalCacheService

Constructor Summary
GlobalCache()
           
 
Method Summary
static void addObject(java.lang.String id, org.apache.turbine.services.cache.CachedObject o)
          Add an object to the cache
 void flushCache()
          Flush the cache of ALL objects
static int getCacheSize()
          Gets size, in bytes, of cache
static int getNumberOfObjects()
          Gets size, in bytes, of cache
static org.apache.turbine.services.cache.CachedObject getObject(java.lang.String id)
          Gets a cached object given its id (a String).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobalCache

public GlobalCache()
Method Detail

addObject

public static void addObject(java.lang.String id,
                             org.apache.turbine.services.cache.CachedObject o)
Add an object to the cache

Parameters:
id - key of the object used by the cache to store and retrieve it. Must not be null.
o - the object to cache

getObject

public static org.apache.turbine.services.cache.CachedObject getObject(java.lang.String id)
                                                                throws org.apache.turbine.services.cache.ObjectExpiredException
Gets a cached object given its id (a String).

Parameters:
id - The String id for the object.
Returns:
A CachedObject.
Throws:
org.apache.turbine.services.cache.ObjectExpiredException - The object has expired in the cache.

getCacheSize

public static int getCacheSize()
                        throws java.io.IOException
Gets size, in bytes, of cache

Returns:
int Size, in byte, of cache
Throws:
java.io.IOException - Exception passed from

getNumberOfObjects

public static int getNumberOfObjects()
Gets size, in bytes, of cache

Returns:
int, Size, in byte, of cache

flushCache

public void flushCache()
Flush the cache of ALL objects



Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.