While working with Infinispan/JBoss Datagrid, a cache configuration through Java code is the most simple option if the configuration through Java API is more suitable for simple use case and demonstration purposes. There are various constraints where considering the declarative XML configuration options may be the best option for you. Infinispan/Jboss datagrid aims to reduce at least the configuration part while dealing with the solution. By default, Infinispan will load the infinispan.xml configuration file from the application classpath.
The infinispan.xml configuration file can be performed using an XML schema. Each Infinispan version is shipped with a specific XML schema. You can find the schema for version 8.2, for example, at the following addresses: