private void registerCache(String pluginName, Node configData) {
        String cacheName = configData.selectSingleNode("cache-name").getStringValue();
        String schemeName = configData.selectSingleNode("scheme-name").getStringValue();
        if (cacheName == null || schemeName == null) {
            throw new IllegalArgumentException("Both cache-name and scheme-name elements are required. Found cache-name: " + cacheName +
            " and scheme-name: " + schemeName);
        }

        Map<String, String> initParams = readInitParams(configData);
        CacheInfo info = new CacheInfo(cacheName, CacheInfo.Type.valueof(schemeName), initParams);
        PluginCacheRegistry.getInstance().registerCache(pluginName, info);
    }
A helper class to read cache configuration data for a plugin and register the defined caches with
the cache factory. Definitions should look something like this:
<pre>
{@code
<cache-config>
    <cache-mapping>
          <cache-name>My Cache</cache-name>
          <scheme-name>optimistic</scheme-name>
          <init-params>
              <init-param>
                  <param-name>back-size-high</param-name>
                  <param-value>131072</param-value>
              </init-param>
              <init-param>
                  <param-name>back-expiry</param-name>
                  <param-value>6h</param-value>
              </init-param>
              <init-param>
                  <param-name>back-size-low</param-name>
                  <param-value>117965</param-value>
              </init-param>
          </init-params>
    </cache-mapping>
</cache-config>
}
</pre>
xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginCacheConfigurator.java