1

I use JCache and Infinispan as its implementation. JCache does not provide any API related to clustering, so I defined simple replicated cache configuration in XML configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns="urn:infinispan:config:8.2">
    <cache-container default-cache="default">
        <transport cluster="test-cluster"/>
            <replicated-cache-configuration name="userCacheConfig" mode="SYNC" statistics="true"/>
    </cache-container>
</infinispan>

Now to create user cache I need to combine this declarative configuration with programmatic configuration because the values of some cache properties (expiration timeout for example) should be retrieved from DB. Is there a way to do it using classes and interfaces from JCache only?

briarheart
  • 1,906
  • 2
  • 19
  • 33

1 Answers1

0

It turns out that when you create cache with the certain name and runtime configuration Infinispan looks for already defined configuration with the same name as the name of cache to be created. If predefined configuration exists Infinispan combines it with the given runtime configuration.

briarheart
  • 1,906
  • 2
  • 19
  • 33