此内容没有您所选择的语言版本。
15.2.2. Configure Cache Managers with CDI
A Red Hat JBoss Data Grid Cache Manager (both embedded and remote) can be configured using CDI. Whether configuring an embedded or remote cache manager, the first step is to specify a default configuration that is annotated to act as a producer.
15.2.2.1. Specify the Default Configuration 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Specify a method annotated as a producer for the Red Hat JBoss Data Grid configuration object to replace the default Infinispan Configuration. The following sample configuration illustrates this step:
Note
CDI adds a
@Default
qualifier if no other qualifiers are provided.
If a
@Produces
annotation is placed in a method that returns a Configuration instance, the method is invoked when a Configuration object is required.
In the provided example configuration, the method creates a new Configuration object which is subsequently configured and returned.