Examples of CacheResult


Examples of javax.cache.annotation.CacheResult

      getCacheKeyGenerator(null, null, null);
   }

   public void testGetCacheKeyGeneratorWithoutMethodCacheKeyGeneratorWithoutDefaultAnnotation() throws Exception {
      final Method fooMethod = Foo.class.getMethod("fooMethod", String.class, String.class);
      final CacheResult cacheResultAnnotation = fooMethod.getAnnotation(CacheResult.class);
      final CacheKeyGenerator cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), null);

      assertTrue(cacheKeyGenerator instanceof DefaultCacheKeyGenerator);
   }
View Full Code Here

Examples of javax.cache.annotation.CacheResult

      assertTrue(cacheKeyGenerator instanceof DefaultCacheKeyGenerator);
   }

   public void testGetCacheKeyGeneratorWithoutMethodCacheKeyGeneratorAndDefault() 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 CacheKeyGenerator cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);

      assertTrue(cacheKeyGenerator instanceof FooCacheKeyGenerator);
   }
View Full Code Here

Examples of javax.cache.annotation.CacheResult

      assertTrue(cacheKeyGenerator instanceof FooCacheKeyGenerator);
   }

   public void testCacheKeyGeneratorWithMethodCacheKeyGeneratorAndDefault() 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 CacheKeyGenerator cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);

      assertTrue(cacheKeyGenerator instanceof BarCacheKeyGenerator);
   }
View Full Code Here

Examples of javax.cache.annotation.CacheResult

      assertTrue(cacheKeyGenerator instanceof BarCacheKeyGenerator);
   }

   public void testCacheKeyGeneratorNameWithoutMethodCacheKeyGeneratorWithoutDefault() 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 CacheKeyGenerator cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);

      assertTrue(cacheKeyGenerator instanceof DefaultCacheKeyGenerator);
   }
View Full Code Here

Examples of javax.cache.annotation.CacheResult

      assertTrue(cacheKeyGenerator instanceof DefaultCacheKeyGenerator);
   }

   public void testGetCacheKeyGeneratorWithMethodCacheKeyGeneratorWithoutDefault() 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 CacheKeyGenerator cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);

      assertTrue(cacheKeyGenerator instanceof BarCacheKeyGenerator);
   }
View Full Code Here

Examples of javax.cache.annotation.CacheResult

      assertTrue(cacheKeyGenerator instanceof BarCacheKeyGenerator);
   }

   public void testGetCacheKeyGeneratorWithANonManagedCacheKeyGenerator() throws Exception {
      final Method bazMethod = Foo.class.getMethod("bazMethod");
      final CacheResult cacheResultAnnotation = bazMethod.getAnnotation(CacheResult.class);
      final CacheDefaults cacheDefaultsAnnotation = Bar.class.getAnnotation(CacheDefaults.class);
      final CacheKeyGenerator cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);

      assertTrue(cacheKeyGenerator instanceof BazCacheKeyGenerator);
   }
View Full Code Here

Examples of org.geowebcache.conveyor.Conveyor.CacheResult

        }
    }

    private void setCacheMetadataHeaders(RawMap map, ConveyorTile cachedTile, TileLayer layer) {
        long[] tileIndex = cachedTile.getTileIndex();
        CacheResult cacheResult = cachedTile.getCacheResult();
        GridSubset gridSubset = layer.getGridSubset(cachedTile.getGridSetId());
        BoundingBox tileBounds = gridSubset.boundsFromIndex(tileIndex);

        String cacheResultHeader = cacheResult == null ? "UNKNOWN" : cacheResult.toString();
        map.setResponseHeader("geowebcache-layer", layer.getName());
        map.setResponseHeader("geowebcache-cache-result", cacheResultHeader);
        map.setResponseHeader("geowebcache-tile-index", Arrays.toString(tileIndex));
        map.setResponseHeader("geowebcache-tile-bounds", tileBounds.toString());
        map.setResponseHeader("geowebcache-gridset", gridSubset.getName());
View Full Code Here

Examples of org.geowebcache.conveyor.Conveyor.CacheResult

     */
    private void writeData(ConveyorTile tile) throws IOException {
        HttpServletResponse servletResp = tile.servletResp;
        final HttpServletRequest servletReq = tile.servletReq;

        final CacheResult cacheResult = tile.getCacheResult();
        int httpCode = HttpServletResponse.SC_OK;
        String mimeType = tile.getMimeType().getMimeType();
        Resource blob = tile.getBlob();

        servletResp.setHeader("geowebcache-cache-result", String.valueOf(cacheResult));
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.