This addon requires the following installation steps.
To use this addon, you must add it as a dependency in the pom.xml of your forge-addon
classified artifact:
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>infinispan</artifactId>
<classifier>forge-addon</classifier>
<version>${version}</version>
</dependency>
- Injection of CacheManager
-
This addon allows you to instantiate Cache objects from the CacheManager. +
@Inject private CacheManager manager;
...
Cache<String,String> cache = manager.createCache("default", new MutableConfiguration<String, String>().setStoreByValue(false));
cache.put("foo","bar");
Assert.assertEquals("bar",cache.get("foo"));
+
Tip
|
If your addon uses a container that does not support "@Inject" annotations, services such as the AddonRegistry registry = ... Imported<CacheManager> imported = registry.getServices(CacheManager.class); CacheManager manager = imported.get(); |