turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vandahl ...@apache.org>
Subject Re: caching object
Date Sun, 10 Jun 2007 17:36:10 GMT
jill han wrote:
> In the usage section, 
> data.setMessage( data.getScreen() + " Got " +
>         obj.getContents().toString() + " from global cache!" );
> what kind of object is data? Is it RunData object?

Yes. However this is just an example that stands for a real usage of the
cached object. Whatever you put into the cache will be returned by
obj.getContents(). The example shows the pattern:
- try to get the object from the cache
- if it's not there, an ObjectExpiredException is thrown
- in the catch()-branch create the object, wrap it into a CachedObject
and put it into the cache
- then return the value of the cached object.

Hope it helps.
Bye, Thomas.

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

View raw message