Package org.springframework.cache.interceptor

Examples of org.springframework.cache.interceptor.CacheableOperation


  private <T extends Annotation> Collection<CacheOperation> lazyInit(Collection<CacheOperation> ops) {
    return (ops != null ? ops : new ArrayList<CacheOperation>(1));
  }

  CacheableOperation parseCacheableAnnotation(AnnotatedElement ae, Cacheable caching) {
    CacheableOperation cuo = new CacheableOperation();
    cuo.setCacheNames(caching.value());
    cuo.setCondition(caching.condition());
    cuo.setKey(caching.key());
    cuo.setName(ae.toString());
    return cuo;
  }
View Full Code Here


    for (Element opElement : cacheableCacheMethods) {
      String name = prop.merge(opElement, parserContext.getReaderContext());
      TypedStringValue nameHolder = new TypedStringValue(name);
      nameHolder.setSource(parserContext.extractSource(opElement));
      CacheOperation op = prop.merge(opElement, parserContext.getReaderContext(), new CacheableOperation());

      Collection<CacheOperation> col = cacheOpMap.get(nameHolder);
      if (col == null) {
        col = new ArrayList<CacheOperation>(2);
        cacheOpMap.put(nameHolder, col);
View Full Code Here

  private <T extends Annotation> Collection<CacheOperation> lazyInit(Collection<CacheOperation> ops) {
    return (ops != null ? ops : new ArrayList<CacheOperation>(1));
  }

  CacheableOperation parseCacheableAnnotation(AnnotatedElement ae, Cacheable caching) {
    CacheableOperation cuo = new CacheableOperation();
    cuo.setCacheNames(caching.value());
    cuo.setCondition(caching.condition());
    cuo.setKey(caching.key());
    cuo.setName(ae.toString());
    return cuo;
  }
View Full Code Here

  private <T extends Annotation> Collection<CacheOperation> lazyInit(Collection<CacheOperation> ops) {
    return (ops != null ? ops : new ArrayList<CacheOperation>(1));
  }

  CacheableOperation parseCacheableAnnotation(AnnotatedElement ae, DefaultCacheConfig defaultConfig, Cacheable caching) {
    CacheableOperation op = new CacheableOperation();

    op.setCacheNames(caching.value());
    op.setCondition(caching.condition());
    op.setUnless(caching.unless());
    op.setKey(caching.key());
    op.setKeyGenerator(caching.keyGenerator());
    op.setCacheManager(caching.cacheManager());
    op.setCacheResolver(caching.cacheResolver());
    op.setName(ae.toString());

    defaultConfig.applyDefault(op);
    validateCacheOperation(ae, op);

    return op;
View Full Code Here

    for (Element opElement : cacheableCacheMethods) {
      String name = prop.merge(opElement, parserContext.getReaderContext());
      TypedStringValue nameHolder = new TypedStringValue(name);
      nameHolder.setSource(parserContext.extractSource(opElement));
      CacheableOperation op = prop.merge(opElement, parserContext.getReaderContext(), new CacheableOperation());
      op.setUnless(getAttributeValue(opElement, "unless", ""));

      Collection<CacheOperation> col = cacheOpMap.get(nameHolder);
      if (col == null) {
        col = new ArrayList<CacheOperation>(2);
        cacheOpMap.put(nameHolder, col);
      }
      col.add(op);
    }

    List<Element> evictCacheMethods = DomUtils.getChildElementsByTagName(definition, CACHE_EVICT_ELEMENT);

    for (Element opElement : evictCacheMethods) {
      String name = prop.merge(opElement, parserContext.getReaderContext());
      TypedStringValue nameHolder = new TypedStringValue(name);
      nameHolder.setSource(parserContext.extractSource(opElement));
      CacheEvictOperation op = prop.merge(opElement, parserContext.getReaderContext(), new CacheEvictOperation());

      String wide = opElement.getAttribute("all-entries");
      if (StringUtils.hasText(wide)) {
        op.setCacheWide(Boolean.valueOf(wide.trim()));
      }

      String after = opElement.getAttribute("before-invocation");
      if (StringUtils.hasText(after)) {
        op.setBeforeInvocation(Boolean.valueOf(after.trim()));
      }

      Collection<CacheOperation> col = cacheOpMap.get(nameHolder);
      if (col == null) {
        col = new ArrayList<CacheOperation>(2);
        cacheOpMap.put(nameHolder, col);
      }
      col.add(op);
    }

    List<Element> putCacheMethods = DomUtils.getChildElementsByTagName(definition, CACHE_PUT_ELEMENT);

    for (Element opElement : putCacheMethods) {
      String name = prop.merge(opElement, parserContext.getReaderContext());
      TypedStringValue nameHolder = new TypedStringValue(name);
      nameHolder.setSource(parserContext.extractSource(opElement));
      CachePutOperation op = prop.merge(opElement, parserContext.getReaderContext(), new CachePutOperation());
      op.setUnless(getAttributeValue(opElement, "unless", ""));

      Collection<CacheOperation> col = cacheOpMap.get(nameHolder);
      if (col == null) {
        col = new ArrayList<CacheOperation>(2);
        cacheOpMap.put(nameHolder, col);
View Full Code Here

TOP

Related Classes of org.springframework.cache.interceptor.CacheableOperation

Copyright © 2018 www.massapicom. 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.