Backing Cache
[fleXive] provides a vendor agnostic mechanism to use backing caches for environmental data and contents.
Originally based on JBoss TreeCache caching is still hierarchical utilizing paths, keys and values as described in the JBoss TreeCache documentation.
We deploy our own Caching MBean com.flexive.ejb.mbeans.FxCache which is registered if not present in com.flexive.shared.CacheAdmin.getInstance() using a standard Java MBeanServer approach.
Previously we held our own TreeCache instance in FxCache, what we do now is creating a FxBackingCacheProvider from FxBackingCacheProviderFactory.
A FxBackingCacheProvider has to implements FxBackingCache which in turn provides all interfaces needed to access a hierarchical cache.
FxBackingCacheProvider's are implemented in com.flexive.shared.cache.impl
Out of the box we create our own TreeCache instance or connect to an existing one that is bound to JNDI.
To provide support for 3rd party Caches like GigaSpaces or Tangosol it is enough to implement com.flexive.shared.cache.FxBackingCacheProvider and provide the System property "com.flexive.shared.cache.FxBackingCacheProvider" like "-Dcom.flexive.shared.cache.FxBackingCacheProvider=some.class"
The following strategy is applied to find a working FxBackingCacheProvider:
- if System property is set try to obtain a new instance of the given class
- try to get a JNDI TreeCache instance with key "FxJBossTreeCache"
- create a local TreeCache MBean
The configuration for the embedded TreeCache instance is found at src/framework/resources/embeddedJBossCacheConfig.xml whereas a sample service to be deployed in JBoss can be found at src/framework/resources/JBossCacheJNDI-service.xml (which has to be copied to the respective deploy directory)