title: Is there a way to modify a JCache's expiry policy that has been declared declaratively?
body: <p>I'm using Hazelcast 3.12 jCache implementation.  My cache has been declared declaratively (via hazelcast-config.xml), however I want to be able to change the ExpiryPolicy's duration dynamically, as the timeout value is only available programatically.</p>
  
  <p>I've looked at the docs for ICache but do not see any methods that would allow me to retreive and/or modify the expiry policy for the cache as a whole.  </p>
  
  <p>My cache is declared as:</p>
  
  <pre><code>&lt;cache name="toto"&gt;
      &lt;async-backup-count&gt;1&lt;/async-backup-count&gt;
      &lt;backup-count&gt;1&lt;/backup-count&gt;
      &lt;cache-entry-listeners&gt;
          &lt;cache-entry-listener old-value-required="true"&gt;
              &lt;cache-entry-listener-factory class-name="cache.UserRolesEntryListenerStaticFactory"/&gt;
          &lt;/cache-entry-listener&gt;
      &lt;/cache-entry-listeners&gt;
      &lt;key-type class-name="java.lang.String"/&gt;
      &lt;management-enabled&gt;true&lt;/management-enabled&gt;
      &lt;statistics-enabled&gt;true&lt;/statistics-enabled&gt;
      &lt;quorum-ref&gt;1&lt;/quorum-ref&gt;
      &lt;partition-lost-listeners&gt;&lt;/partition-lost-listeners&gt;
  &lt;/cache&gt;
  </code></pre>
  
  <p>and I would like to set/update the expiry policy when it is retrieved as:</p>
  
  <pre><code>@Produces
  @Singleton
  @UserRolesCache
  public Cache&lt;String, String[]&gt; createUserRoleCache(@HazelcastDistributed CacheManager cacheManager) {
      Cache cache = cacheManager.getCache("toto");
  
      // get expiry timeout from a 3rd service
      int timeout = configService.getCacheExpiry();
  
      // how to set the expiry policy here???
      // cache.setExpiryPolicy(.....) ?????
  }
  </code></pre>
  
  <p>Is this feasible using the jCache or Hazelcast API?</p>