Some CDI annotations have been accepted into the JSR-107 (JCache) specification. All the annotations discussed in this section are a part of JSR-107 and are hence located in the javax.cache
package.
These annotations provide value by intercepting method calls invoked on your CDI beans and performing storage and retrieval tasks in Infinispan as a side-effect.
All CDI applications have a beans.xml
file. You need to edit your beans.xml
file and add the following interceptors to your CDI beans.xml
file, to enable method interception:
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd"> <interceptors> <class> org.infinispan.cdi.interceptor.CacheResultInterceptor </class> <class> org.infinispan.cdi.interceptor...