Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1263

Type safe selection of cache used by the JCache interceptors

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Obsolete
    • Minor
    • None
    • None
    • CDI
    • None

    Description

      Currently the name of the cache which will be used by the JCache interceptors has to be specified in JCache annotations (e.g. @CacheResult(cacheName="greeting-cache")).

      This can be error prone (typo, refactoring ...). The CDI integration module provides the possibility to associate a qualifier to a cache. This qualifier could be re-used to provide a type safe selection of the cache used by a JCache interceptor. Something like:

      public class GreetingService {
      
          @CacheResult @GreetingCache
          public String greet(String name) {
              return "Hello" + name;
          }
      }
      

      Here we need to be in sync with JCache specification. In my understanding of the spec the cache name is required for @CacheRemoveEntry and @CacheRemoveAll (but currently in the API there is a default value initialized to blank). For @CacheResult if no cache name is defined a default one is used.

      Attachments

        Activity

          People

            kevinpollet Kévin Pollet (Inactive)
            kevinpollet Kévin Pollet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: