Annotation Type Cacheable


This annotation is to tag classes managed by the underlying IoC/IoD container as to be eligible to the cache.

In Silverpeas, managed beans and their dependencies to others managed beans are usually resolved by the used IoC/IoD implementation. Nevertheless, Silverpeas provides also a way for non-managed objects to access the managed beans. This is done with the ManagedBeanProvider singleton. Because, depending on the IoC/IoD implementation, such access can be costly, ManagedBeanProvider maintains a cache for singletons (id est for managed beans annotated with the Singleton lifecycle pseudo-scope). But it is also possible to inform the managed bean provider to cache also some peculiar managed beans and this by annotating their class with this Cacheable annotation.

This annotation should be used carefully because only a single instance will be cached and thus served by ManagedBeanProvider. So the beans have to be stateless and their lifecycle should be long enough to not hurt the lifecycle management of managed beans by the IoC/IoD container.

Author:
mmoquillon