2 Replies Latest reply on Feb 14, 2013 6:31 PM by jacktrades

    Infinispan - CDI Producer Method

    jacktrades Newbie

      Which is a good way to inject & Produce an @ApplicationScoped Infinispan Cache?

       

      Is the following a  good idea:

       

      public class Resources implements Serializable {
      
          @Resource(lookup = "java:jboss/infinispan/container/appcache")
          private EmbeddedCacheManager cacheManager;
      
          @Produces
          @ApplicationScoped
          public Cache<Integer,Ad> producesCache(){
              return cacheManager.getCache("pagination",false);
          }
      }