2.2.2. Create a New Embedded Cache Manager
Use the following instructions to create a new EmbeddedCacheManager without using CDI:
Procedure 2.1. Create a New Embedded Cache Manager
- Create a configuration XML file. For example, create the
my-config.file.xml
file on the classpath (in theresources/
folder) and add the configuration information in this file. - Use the following programmatic configuration to create a cache manager using the configuration file:
EmbeddedCacheManager manager = new DefaultCacheManager("my-config-file.xml"); Cache defaultCache = manager.getCache();
The outlined procedure creates a new EmbeddedCacheManager using the basic configuration specified.