You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Eric Roberts <er...@austin.tacc.utexas.edu> on 2003/05/02 23:06:25 UTC

Creating Cacheable objects

I want to store information in objects and have them cached for later
consumption.  My first inclination is to use the portletcache to store
them.  Therefore, I have a question about creating my own classes that
implement Cacheable.  In the API for the Cacheable interface it says
that setHandle() and getHandle() are deprecated with the following note
 
Deprecated. cacheable classes should now implement a static
getHandle(config) method
 
What is config?  A String?  Anything I want it to be?  Why weren't there
methods created to replace these?
 
In the AbstractPortlet class getHandle() has two definitions with the
following note:
 
Most implementations should just call the CacheHandleManager with the
given params within the implementation and just return "this".
 
What is "this" that they are referring to?  How would I implement this?
Maybe this is just an interpretation of the documentation issue but I
just can't seem to wrap my brain around this.  I would appreciate any
enlightenment that anyone can give me
 
Thanks in advance,
 
Eric

Re: Creating Cacheable objects

Posted by David Sean Taylor <da...@bluesunrise.com>.
On Friday, May 2, 2003, at 02:06  PM, Eric Roberts wrote:

> I want to store information in objects and have them cached for later
> consumption.  My first inclination is to use the portletcache to store
> them.  Therefore, I have a question about creating my own classes that
> implement Cacheable.  In the API for the Cacheable interface it says
> that setHandle() and getHandle() are deprecated with the following note
>
The portlet cache is for portlets. Its not meant to be a generic cache.

> Deprecated. cacheable classes should now implement a static
> getHandle(config) method
>
> What is config?  A String?  Anything I want it to be?  Why weren't 
> there
> methods created to replace these?
>
PortletConfig

The caching of portlets and their content is dependent on the cache 
handle.
The handle is the key into the cache.
If a portlet can override this method to implement its own caching 
identification strategy.
The default approaches available are in implemented in AbstractPortlet 
and AbstractInstancePortlet
Cache identification can be based on a number of parameters, depending 
on the portlet such as:
- portlet name
- portlet instance (page + id)
- URL
- init parameters

The abstract portlet classes also handle the lifetime of the cached 
information by setting the expiration time

--
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
+01 707 773-4646




---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org