此内容没有您所选择的语言版本。
2.2.3. Create a New Embedded Cache Manager Using CDI
Use the following steps to create a new EmbeddedCacheManager instance using CDI:
Procedure 2.2. Use CDI to Create a New EmbeddedCacheManager
- Specify a default configuration:
public class Config { @Produces public Configuration defaultEmbeddedConfiguration () { return new ConfigurationBuilder() .eviction() .strategy(EvictionStrategy.LRU) .maxEntries(100) .build(); } } - Create a clustered or a non-clustered cache.
- Invoke the method to create an EmbeddedCacheManager.
... @Inject EmbeddedCacheManager cacheManager; ...