Package javax.cache.annotation

Examples of javax.cache.annotation.CacheResult.cacheName()


         final CacheDefaults cacheDefaultsAnnotation = method.getDeclaringClass().getAnnotation(CacheDefaults.class);

         if (method.isAnnotationPresent(CacheResult.class)) {
            final CacheResult cacheResultAnnotation = method.getAnnotation(CacheResult.class);
            cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);
            cacheName = getCacheName(method, cacheResultAnnotation.cacheName(), cacheDefaultsAnnotation, true);
            aggregatedParameterMetaData = getAggregatedParameterMetaData(method, false);
            cacheAnnotation = cacheResultAnnotation;

         } else if (method.isAnnotationPresent(CacheRemoveEntry.class)) {
            final CacheRemoveEntry cacheRemoveEntryAnnotation = method.getAnnotation(CacheRemoveEntry.class);
View Full Code Here


         final CacheDefaults cacheDefaultsAnnotation = method.getDeclaringClass().getAnnotation(CacheDefaults.class);

         if (method.isAnnotationPresent(CacheResult.class)) {
            final CacheResult cacheResultAnnotation = method.getAnnotation(CacheResult.class);
            cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);
            cacheName = getCacheName(method, cacheResultAnnotation.cacheName(), cacheDefaultsAnnotation, true);
            aggregatedParameterMetaData = getAggregatedParameterMetaData(method, false);
            cacheAnnotation = cacheResultAnnotation;

         } else if (method.isAnnotationPresent(CacheRemove.class)) {
            final CacheRemove cacheRemoveEntryAnnotation = method.getAnnotation(CacheRemove.class);
View Full Code Here

         final CacheDefaults cacheDefaultsAnnotation = method.getDeclaringClass().getAnnotation(CacheDefaults.class);

         if (method.isAnnotationPresent(CacheResult.class)) {
            final CacheResult cacheResultAnnotation = method.getAnnotation(CacheResult.class);
            cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);
            cacheName = getCacheName(method, cacheResultAnnotation.cacheName(), cacheDefaultsAnnotation, true);
            aggregatedParameterMetaData = getAggregatedParameterMetaData(method, false);
            cacheAnnotation = cacheResultAnnotation;

         } else if (method.isAnnotationPresent(CacheRemoveEntry.class)) {
            final CacheRemoveEntry cacheRemoveEntryAnnotation = method.getAnnotation(CacheRemoveEntry.class);
View Full Code Here

   }

   public void testGetCacheNameWithMethodCacheNameWithoutDefaultAnnotation() throws Exception {
      final Method barMethod = Foo.class.getMethod("barMethod");
      final CacheResult cacheResultAnnotation = barMethod.getAnnotation(CacheResult.class);
      final String cacheName = getCacheName(barMethod, cacheResultAnnotation.cacheName(), null, false);

      assertEquals(cacheName, "bar-cache");
   }

   public void testGetCacheNameWithoutMethodCacheNameWithoutDefaultAnnotation() throws Exception {
View Full Code Here

   }

   public void testGetCacheNameWithoutMethodCacheNameWithoutDefaultAnnotation() throws Exception {
      final Method fooMethod = Foo.class.getMethod("fooMethod", String.class, String.class);
      final CacheResult cacheResultAnnotation = fooMethod.getAnnotation(CacheResult.class);
      final String cacheName = getCacheName(fooMethod, cacheResultAnnotation.cacheName(), null, false);

      assertEquals(cacheName, "");
   }

   public void testGetCacheNameWithoutMethodCacheNameWithoutDefaultAndGenerate() throws Exception {
View Full Code Here

   }

   public void testGetCacheNameWithoutMethodCacheNameWithoutDefaultAndGenerate() throws Exception {
      final Method fooMethod = Foo.class.getMethod("fooMethod", String.class, String.class);
      final CacheResult cacheResultAnnotation = fooMethod.getAnnotation(CacheResult.class);
      final String cacheName = getCacheName(fooMethod, cacheResultAnnotation.cacheName(), null, true);

      assertEquals(cacheName, Foo.class.getName() + ".fooMethod(java.lang.String,java.lang.String)");
   }

   public void testGetCacheNameWithoutMethodCacheNameAndDefault() throws Exception {
View Full Code Here

   public void testGetCacheNameWithoutMethodCacheNameAndDefault() throws Exception {
      final Method fooMethod = Foo.class.getMethod("fooMethod", String.class, String.class);
      final CacheResult cacheResultAnnotation = fooMethod.getAnnotation(CacheResult.class);
      final CacheDefaults cacheDefaultsAnnotation = Foo.class.getAnnotation(CacheDefaults.class);
      final String cacheName = getCacheName(fooMethod, cacheResultAnnotation.cacheName(), cacheDefaultsAnnotation, false);

      assertEquals(cacheName, "default-cache");
   }

   public void testGetCacheNameWithMethodCacheNameAndDefault() throws Exception {
View Full Code Here

   public void testGetCacheNameWithMethodCacheNameAndDefault() throws Exception {
      final Method barMethod = Foo.class.getMethod("barMethod");
      final CacheResult cacheResultAnnotation = barMethod.getAnnotation(CacheResult.class);
      final CacheDefaults cacheDefaultsAnnotation = Foo.class.getAnnotation(CacheDefaults.class);
      final String cacheName = getCacheName(barMethod, cacheResultAnnotation.cacheName(), cacheDefaultsAnnotation, false);

      assertEquals(cacheName, "bar-cache");
   }

   public void testGetCacheNameWithoutMethodCacheNameWithoutDefault() throws Exception {
View Full Code Here

   public void testGetCacheNameWithoutMethodCacheNameWithoutDefault() throws Exception {
      final Method fooMethod = Bar.class.getMethod("fooMethod");
      final CacheResult cacheResultAnnotation = fooMethod.getAnnotation(CacheResult.class);
      final CacheDefaults cacheDefaultsAnnotation = Bar.class.getAnnotation(CacheDefaults.class);
      final String cacheName = getCacheName(fooMethod, cacheResultAnnotation.cacheName(), cacheDefaultsAnnotation, false);

      assertEquals(cacheName, "");
   }

   public void testGetCacheNameWithMethodCacheNameWithoutDefault() throws Exception {
View Full Code Here

   public void testGetCacheNameWithMethodCacheNameWithoutDefault() throws Exception {
      final Method barMethod = Bar.class.getMethod("barMethod");
      final CacheResult cacheResultAnnotation = barMethod.getAnnotation(CacheResult.class);
      final CacheDefaults cacheDefaultsAnnotation = Bar.class.getAnnotation(CacheDefaults.class);
      final String cacheName = getCacheName(barMethod, cacheResultAnnotation.cacheName(), cacheDefaultsAnnotation, false);

      assertEquals(cacheName, "bar-cache");
   }

   /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.