title: Configure JCache implementation in Spring
body: <p>Looking at the Ehcahce implementation of net.sf.cache.JS107, I am trying to achieve the following code snippet to produce the JCache implementation as a Spring managed bean..</p>
  
  <pre><code>  Ehcache Ehcache = new net.sf.ehcache.Cache(...);
    net.sf.jsr107cache.Cache cache = new JCache(ehcache);
    manager.addJCache(cache);
  </code></pre>
  
  <p>Here is my manager bean:</p>
  
  <pre><code>   &lt;bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"&gt;
          &lt;property name="shared" value="true"/&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>Here is my Ehcache bean:</p>
  
  <pre><code>&lt;bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheFactoryBean"&gt;
          &lt;property name="cacheManager" ref="cacheManager"/&gt;
          &lt;property name="diskPersistent" value="false"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Here is how I create my JCache bean:</p>
  
  <pre><code>&lt;bean id="jcache" class="net.sf.jsr107cache.Cache"&gt;
          &lt;constructor-arg ref="ehcache"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>What I want is to be able to invoke the following method in Spring to apply my JCache to the Ehcache manager:</p>
  
  <pre><code>manager.addJCache(cache);
  </code></pre>
  
  <p>There must be a way to do this in Spring?</p>
  
  <p>Thanks</p>