Examples of CacheEvictOperation


Examples of org.springframework.cache.interceptor.CacheEvictOperation

    cuo.setName(ae.toString());
    return cuo;
  }

  CacheEvictOperation parseEvictAnnotation(AnnotatedElement ae, CacheEvict caching) {
    CacheEvictOperation ceo = new CacheEvictOperation();
    ceo.setCacheNames(caching.value());
    ceo.setCondition(caching.condition());
    ceo.setKey(caching.key());
    ceo.setCacheWide(caching.allEntries());
    ceo.setBeforeInvocation(caching.beforeInvocation());
    ceo.setName(ae.toString());
    return ceo;
  }
View Full Code Here

Examples of org.springframework.cache.interceptor.CacheEvictOperation

    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);
View Full Code Here

Examples of org.springframework.cache.interceptor.CacheEvictOperation

    cuo.setName(ae.toString());
    return cuo;
  }

  CacheEvictOperation parseEvictAnnotation(AnnotatedElement ae, CacheEvict caching) {
    CacheEvictOperation ceo = new CacheEvictOperation();
    ceo.setCacheNames(caching.value());
    ceo.setCondition(caching.condition());
    ceo.setKey(caching.key());
    ceo.setCacheWide(caching.allEntries());
    ceo.setBeforeInvocation(caching.beforeInvocation());
    ceo.setName(ae.toString());
    return ceo;
  }
View Full Code Here

Examples of org.springframework.cache.interceptor.CacheEvictOperation

    boolean trace = log.isTraceEnabled();

    boolean atLeastOne = false;
    for (CacheOperationContext operationContext : evictions) {
      CacheEvictOperation evict = (CacheEvictOperation) operationContext.operation;

      if (beforeInvocation == evict.isBeforeInvocation()) {
        if (operationContext.isConditionPassing()) {
          atLeastOne = true;
          // for each cache
          // lazy key initialization
          Object key = null;

          for (Cache cache : operationContext.getCaches()) {
            // cache-wide flush
            if (evict.isCacheWide()) {
              cache.clear();
              logRequestDetails(operationContext.request, getContext(), "Flushing request");
            }
            else {
              // check key
View Full Code Here

Examples of org.springframework.cache.interceptor.CacheEvictOperation

    return op;
  }

  CacheEvictOperation parseEvictAnnotation(AnnotatedElement ae, DefaultCacheConfig defaultConfig, CacheEvict caching) {
    CacheEvictOperation op = new CacheEvictOperation();

    op.setCacheNames(caching.value());
    op.setCondition(caching.condition());
    op.setKey(caching.key());
    op.setKeyGenerator(caching.keyGenerator());
    op.setCacheManager(caching.cacheManager());
    op.setCacheResolver(caching.cacheResolver());
    op.setCacheWide(caching.allEntries());
    op.setBeforeInvocation(caching.beforeInvocation());
    op.setName(ae.toString());

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

    return op;
View Full Code Here

Examples of org.springframework.cache.interceptor.CacheEvictOperation

    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

Examples of org.springframework.cache.interceptor.CacheEvictOperation

    boolean trace = log.isTraceEnabled();

    boolean atLeastOne = false;
    for (CacheOperationContext operationContext : evictions) {
      CacheEvictOperation evict = (CacheEvictOperation) operationContext.operation;

      if (beforeInvocation == evict.isBeforeInvocation()) {
        if (operationContext.isConditionPassing()) {
          atLeastOne = true;
          // for each cache
          // lazy key initialization
          Object key = null;

          for (Cache cache : operationContext.getCaches()) {
            // cache-wide flush
            if (evict.isCacheWide()) {
              cache.clear();
              logRequestDetails(operationContext.request, getContext(), "Flushing request");
            }
            else {
              // check key
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.