org.apache.jetspeed.services.portletcache
Interface Cacheable

All Known Implementing Classes:
AbstractPortlet, CacheablePortletWrapper, CacheableStatefulPortletWrapper

public interface Cacheable

This is an interface for defining Jetspeed objects that may be cached in the object cache.

Each such object must be able to prodive a caching handle that will uniquely identify it within the cache system

Version:
$Id: Cacheable.java,v 1.8 2005/03/21 18:21:44 sgala Exp $
Author:
Kevin A. Burton, Raphaël Luta

Method Summary
 java.lang.Long getExpirationMillis()
          Return the expiration time in milliseconds.
 Expire getExpire()
          Used by a Cacheable object to determine when it should expire itself from the cache.
 java.lang.String getHandle()
          Deprecated. cacheable classes should now implement a static getHandle(config) method
 boolean isCacheable()
          Return true if this Cacheable is allowed to be cached.
 void setCacheable(boolean cacheable)
          Set this cacheable status.
 void setCachedObject(org.apache.turbine.services.cache.CachedObject co)
          This allows the associated CachedObject to be known.
 void setExpirationMillis(long expirationMillis)
          Set the expiration time in milliseconds.
 void setHandle(java.lang.String handle)
          Deprecated. cacheable classes should now implement a static getHandle(config) method
 

Method Detail

isCacheable

public boolean isCacheable()
Return true if this Cacheable is allowed to be cached.

Returns:
TRUE if object is cachable
FALSE if object is not cacheable

setCacheable

public void setCacheable(boolean cacheable)
Set this cacheable status.

Parameters:
cacheable - Set the cacheability of the object

getExpire

public Expire getExpire()
Used by a Cacheable object to determine when it should expire itself from the cache.

Returns:
Expire handle

getHandle

public java.lang.String getHandle()
Deprecated. cacheable classes should now implement a static getHandle(config) method

Used by the cache to get a unique reference on what you want to add and then retrieve in the future from the cache

Most implementations should just call the CacheHandleManager with the given params within the implementation and just return this.


setHandle

public void setHandle(java.lang.String handle)
Deprecated. cacheable classes should now implement a static getHandle(config) method

Set the handle for this Cacheable.

Note that factories should call setHandle() so that getHandle() always returns a value correctly.


getExpirationMillis

public java.lang.Long getExpirationMillis()
Return the expiration time in milliseconds.

Returns:
Expiration time in milliseconds since epoch, or null if the expiration was not set

setExpirationMillis

public void setExpirationMillis(long expirationMillis)
Set the expiration time in milliseconds.

Parameters:
expirationMillis - Set expiration in millis

setCachedObject

public void setCachedObject(org.apache.turbine.services.cache.CachedObject co)
This allows the associated CachedObject to be known. One use of the co is to set the expiration time

Parameters:
co - Handle to the CachedObject


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