|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CacheableService
If services are acquired by ServiceLocator
you can cast a service to this interface to enable/modify
caching settings.
Useage:
ServiceLocator serviceLocator = ....
ContentService contentService = serviceLocator.getContentService();
CacheableService cacheable = (CacheableService) contentService;
cacheable.setCacheEnabled(true);
Only service methods that have been marked with commons attribute @@Cacheable() will be cached. The key for the cache is a combination of the method name and the array of parameters passed to the method.
Service methods with the commons attribute @@ClearCache() will clear an entire services cache.
Method Summary | |
---|---|
void |
clearCache()
Calling this method will clear the content from the services cache. |
long |
getMaxCacheLifetime()
Returns the maximum amount of time an item can be in the cache. |
int |
getMaxCacheSize()
Returns the maximum size of the cache. |
boolean |
isCachingEnabled()
Returns true if caching is enabled for this service. |
void |
setCachingEnabled(boolean enabled)
Setting true to this method will enabled caching, false will disable it and clear current caches. |
void |
setMaxCacheLifetime(long time)
Set the maximum amount of time an item will be stored in the cache. |
void |
setMaxCacheSize(int size)
The maximum size of the cache in bytes. |
Method Detail |
---|
void setCachingEnabled(boolean enabled)
enabled
- Whether or not to enable caching.boolean isCachingEnabled()
void setMaxCacheLifetime(long time)
time
- How long an item can be in the cache.long getMaxCacheLifetime()
void setMaxCacheSize(int size)
size
- Sets the size of the cache.int getMaxCacheSize()
void clearCache()
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |