title: Jcache integration in hazelcast does not work
body: <p>I am currently trying to integrate HazelCast cache with jcache objects, to base my developments on its standard.</p>
  
  <p>I need to integrate a large number of different configurations, for this I created a hazelcast.xml. Where I've tried with hazelcast map objects (com.hazelcast.core.IMap), I get it working so I can get the cache with the appropriate configuration:</p>
  
  <pre><code>private static void initHazelcast() {
          log.info("initHazelcast()");
  
          Config cfg = null;
          try {
              cfg = new XmlConfigBuilder("./src/main/resources/hazelcast.xml").build();
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          }
  
          hazelcastInstance = Hazelcast.newHazelcastInstance(cfg);
  
          IMap map = hazelcastInstance.getMap("EXPIR00001");
  
          log.info("initHazelcast() End");
      }
  </code></pre>
  
  <p>HazelCast.xml:</p>
  
  <pre><code>&lt;hazelcast  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.hazelcast.com/schema/config http://www.hazelcast.com/schema/config/hazelcast-config-3.9.xsd"
      xmlns="http://www.hazelcast.com/schema/config"&gt;
    &lt;map name="EXPIR00001"&gt;
      &lt;time-to-live-seconds&gt;1&lt;/time-to-live-seconds&gt;
      &lt;max-idle-seconds&gt;1&lt;/max-idle-seconds&gt;
      &lt;eviction-policy&gt;LRU&lt;/eviction-policy&gt;
      &lt;max-size policy="PER_NODE"&gt;5000&lt;/max-size&gt;
    &lt;/map&gt;
  &lt;/hazelcast&gt;
  </code></pre>
  
  <p>Now I try to use the class javax.cache.Cache of JCache.</p>
  
  <p>I'm using this example, but I do not retrieve the xml configuration like this:</p>
  
  <p><a href="http://docs.hazelcast.org/docs/3.9.3/manual/html-single/index.html#jcache-declarative-configuration" rel="nofollow noreferrer">http://docs.hazelcast.org/docs/3.9.3/manual/html-single/index.html#jcache-declarative-configuration</a>
  and
  <a href="http://docs.hazelcast.org/docs/3.9.3/manual/html-single/index.html#scoping-to-join-clusters" rel="nofollow noreferrer">http://docs.hazelcast.org/docs/3.9.3/manual/html-single/index.html#scoping-to-join-clusters</a></p>
  
  <p>Hazelcast.xml:</p>
  
  <pre><code>&lt;hazelcast  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.hazelcast.com/schema/config http://www.hazelcast.com/schema/config/hazelcast-config-3.9.xsd"
      xmlns="http://www.hazelcast.com/schema/config"&gt;
  
      &lt;cache name="EXPIR00001"&gt;
        &lt;backup-count&gt;1&lt;/backup-count&gt;
        &lt;async-backup-count&gt;1&lt;/async-backup-count&gt;
        &lt;in-memory-format&gt;BINARY&lt;/in-memory-format&gt;
        &lt;eviction size="10000" max-size-policy="ENTRY_COUNT" eviction-policy="LRU" /&gt;
         &lt;expiry-policy-factory&gt;
                      &lt;timed-expiry-policy-factory expiry-policy-type="CREATED"
                                                      duration-amount="1"
                                                      time-unit="DAYS"/&gt;
         &lt;/expiry-policy-factory&gt;
      &lt;/cache&gt;
  
  &lt;/hazelcast&gt;
  </code></pre>
  
  <p>method java:</p>
  
  <pre><code>private static void initHazelcast() {
          log.info("initHazelcast()");
  
          Config cfg = null;
          try {
              cfg = new XmlConfigBuilder("./src/main/resources/hazelcast.xml").build();
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          }
          hazelcastInstance = Hazelcast.newHazelcastInstance(cfg);
  
          CacheManager manager = Caching.getCachingProvider().getCacheManager();
          //In JCache
          Cache&lt;byte[], byte[]&gt; cache = manager.getCache( "EXPIR00001" );
  
          log.info("initHazelcast() End");
      }
  </code></pre>
  
  <p>CacheManager manager how can you relate to the hazelcast intance ??.The manager object does not retrieve the cache Id = "EXPIR00001"</p>
  
  <p>I need to configure from an xml file, decalratively (Hazelcast.xml). There are many configurations, which we may need. </p>
  
  <p>I can not use:
  <a href="http://docs.hazelcast.org/docs/3.9.3/manual/html-single/index.html#hazelcast-jcache" rel="nofollow noreferrer">http://docs.hazelcast.org/docs/3.9.3/manual/html-single/index.html#hazelcast-jcache</a></p>