<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://jetty.org/configure_10_0.dtd">

<Configure id="Server" class="org.eclipse.jetty.server.Server">


  <!-- ===================================================================== -->
  <!-- Get a reference to the default local cache.                           -->
  <!-- ===================================================================== -->

  
  <New id="cacheMgr" class="org.infinispan.manager.DefaultCacheManager">
    <Arg>
      <Property name="jetty.base"/>/etc/infinispan.xml
    </Arg>
    <Get id="defaultConfig" name="defaultCacheConfiguration"/>
  </New>
   
   
  <New class="org.infinispan.configuration.cache.ConfigurationBuilder">
    <Call name="read">
      <Arg>
        <Ref refid="defaultConfig"/>
      </Arg>
      <Call name="indexing"/>
      <Call name="enabled"/>
      <Call name="addIndexedEntity">
        <Arg>
          <Get class="org.eclipse.jetty.session.infinispan.InfinispanSessionData" name="class"/>
        </Arg>
      </Call>
    </Call>
  </New>

  <Ref refid="cacheMgr">
    <Call name="defineConfiguration">
      <Arg>jetty-query-sessions</Arg>
      <Arg><Ref refid="config"/></Arg>
    </Call>
    
    <Get id="cache" name="cache"/>
  </Ref>
  
  <!-- set queryMgrFactory reference to EmbeddedQueryManagerFactory -->
  <New id="queryMgrFactory" class="org.eclipse.jetty.session.infinispan.EmbeddedQueryManagerFactory"/>
  
</Configure> 
