CDIJCacheHelper.java

  1. /*
  2.  * Licensed to the Apache Software Foundation (ASF) under one
  3.  * or more contributor license agreements.  See the NOTICE file
  4.  * distributed with this work for additional information
  5.  * regarding copyright ownership.  The ASF licenses this file
  6.  * to you under the Apache License, Version 2.0 (the
  7.  * "License"); you may not use this file except in compliance
  8.  * with the License.  You may obtain a copy of the License at
  9.  *
  10.  *   http://www.apache.org/licenses/LICENSE-2.0
  11.  *
  12.  * Unless required by applicable law or agreed to in writing,
  13.  * software distributed under the License is distributed on an
  14.  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15.  * KIND, either express or implied.  See the License for the
  16.  * specific language governing permissions and limitations
  17.  * under the License.
  18.  */
  19. package org.apache.commons.jcs3.jcache.cdi;

  20. import java.lang.annotation.Annotation;
  21. import java.lang.reflect.Method;
  22. import java.lang.reflect.Proxy;
  23. import java.util.ArrayList;
  24. import java.util.Arrays;
  25. import java.util.Collection;
  26. import java.util.HashSet;
  27. import java.util.LinkedList;
  28. import java.util.List;
  29. import java.util.Set;
  30. import java.util.concurrent.ConcurrentHashMap;
  31. import java.util.concurrent.ConcurrentMap;
  32. import java.util.logging.Logger;

  33. import javax.annotation.PreDestroy;
  34. import javax.cache.annotation.CacheDefaults;
  35. import javax.cache.annotation.CacheKey;
  36. import javax.cache.annotation.CacheKeyGenerator;
  37. import javax.cache.annotation.CachePut;
  38. import javax.cache.annotation.CacheRemove;
  39. import javax.cache.annotation.CacheRemoveAll;
  40. import javax.cache.annotation.CacheResolverFactory;
  41. import javax.cache.annotation.CacheResult;
  42. import javax.cache.annotation.CacheValue;
  43. import javax.enterprise.context.ApplicationScoped;
  44. import javax.enterprise.context.spi.CreationalContext;
  45. import javax.enterprise.inject.spi.Bean;
  46. import javax.enterprise.inject.spi.BeanManager;
  47. import javax.inject.Inject;
  48. import javax.interceptor.InvocationContext;

  49. @ApplicationScoped
  50. public class CDIJCacheHelper
  51. {
  52.     private static final Logger LOGGER = Logger.getLogger(CDIJCacheHelper.class.getName());
  53.     private static final boolean CLOSE_CACHE = !Boolean.getBoolean("org.apache.commons.jcs3.jcache.cdi.skip-close");

  54.     private volatile CacheResolverFactoryImpl defaultCacheResolverFactory; // lazy to not create any cache if not needed
  55.     private final CacheKeyGeneratorImpl defaultCacheKeyGenerator = new CacheKeyGeneratorImpl();

  56.     private final Collection<CreationalContext<?>> toRelease = new ArrayList<>();
  57.     private final ConcurrentMap<MethodKey, MethodMeta> methods = new ConcurrentHashMap<>();

  58.     @Inject
  59.     private BeanManager beanManager;

  60.     @PreDestroy
  61.     private void release() {
  62.         if (CLOSE_CACHE && defaultCacheResolverFactory != null)
  63.         {
  64.             defaultCacheResolverFactory.release();
  65.         }
  66.         for (final CreationalContext<?> cc : toRelease)
  67.         {
  68.             try
  69.             {
  70.                 cc.release();
  71.             }
  72.             catch (final RuntimeException re)
  73.             {
  74.                 LOGGER.warning(re.getMessage());
  75.             }
  76.         }
  77.     }

  78.     public MethodMeta findMeta(final InvocationContext ic)
  79.     {
  80.         final Method mtd = ic.getMethod();
  81.         final Class<?> refType = findKeyType(ic.getTarget());
  82.         final MethodKey key = new MethodKey(refType, mtd);
  83.         MethodMeta methodMeta = methods.get(key);
  84.         if (methodMeta == null)
  85.         {
  86.             synchronized (this)
  87.             {
  88.                 methodMeta = methods.get(key);
  89.                 if (methodMeta == null)
  90.                 {
  91.                     methodMeta = createMeta(ic);
  92.                     methods.put(key, methodMeta);
  93.                 }
  94.             }
  95.         }
  96.         return methodMeta;
  97.     }

  98.     private static Class<?> findKeyType(final Object target)
  99.     {
  100.         if (null == target)
  101.         {
  102.             return null;
  103.         }
  104.         return target.getClass();
  105.     }

  106.     // it is unlikely we have all annotations but for now we have a single meta model
  107.     private MethodMeta createMeta(final InvocationContext ic)
  108.     {
  109.         final CacheDefaults defaults = findDefaults(ic.getTarget() == null ? null : ic.getTarget()
  110.                                                       .getClass(), ic.getMethod());

  111.         final Class<?>[] parameterTypes = ic.getMethod().getParameterTypes();
  112.         final Annotation[][] parameterAnnotations = ic.getMethod().getParameterAnnotations();
  113.         final List<Set<Annotation>> annotations = new ArrayList<>();
  114.         for (final Annotation[] parameterAnnotation : parameterAnnotations)
  115.         {
  116.             final Set<Annotation> set = new HashSet<>(parameterAnnotation.length);
  117.             set.addAll(Arrays.asList(parameterAnnotation));
  118.             annotations.add(set);
  119.         }

  120.         final Set<Annotation> mtdAnnotations = new HashSet<>(Arrays.asList(ic.getMethod().getAnnotations()));
  121.         final CacheResult cacheResult = ic.getMethod().getAnnotation(CacheResult.class);
  122.         final String cacheResultCacheResultName = cacheResult == null ? null : defaultName(ic.getMethod(), defaults, cacheResult.cacheName());
  123.         final CacheResolverFactory cacheResultCacheResolverFactory = cacheResult == null ?
  124.                 null : cacheResolverFactoryFor(defaults, cacheResult.cacheResolverFactory());
  125.         final CacheKeyGenerator cacheResultCacheKeyGenerator = cacheResult == null ?
  126.                 null : cacheKeyGeneratorFor(defaults, cacheResult.cacheKeyGenerator());

  127.         final CachePut cachePut = ic.getMethod().getAnnotation(CachePut.class);
  128.         final String cachePutCachePutName = cachePut == null ? null : defaultName(ic.getMethod(), defaults, cachePut.cacheName());
  129.         final CacheResolverFactory cachePutCacheResolverFactory = cachePut == null ?
  130.                 null : cacheResolverFactoryFor(defaults, cachePut.cacheResolverFactory());
  131.         final CacheKeyGenerator cachePutCacheKeyGenerator = cachePut == null ?
  132.                 null : cacheKeyGeneratorFor(defaults, cachePut.cacheKeyGenerator());

  133.         final CacheRemove cacheRemove = ic.getMethod().getAnnotation(CacheRemove.class);
  134.         final String cacheRemoveCacheRemoveName = cacheRemove == null ? null : defaultName(ic.getMethod(), defaults, cacheRemove.cacheName());
  135.         final CacheResolverFactory cacheRemoveCacheResolverFactory = cacheRemove == null ?
  136.                 null : cacheResolverFactoryFor(defaults, cacheRemove.cacheResolverFactory());
  137.         final CacheKeyGenerator cacheRemoveCacheKeyGenerator = cacheRemove == null ?
  138.                 null : cacheKeyGeneratorFor(defaults, cacheRemove.cacheKeyGenerator());

  139.         final CacheRemoveAll cacheRemoveAll = ic.getMethod().getAnnotation(CacheRemoveAll.class);
  140.         final String cacheRemoveAllCacheRemoveAllName = cacheRemoveAll == null ? null : defaultName(ic.getMethod(), defaults, cacheRemoveAll.cacheName());
  141.         final CacheResolverFactory cacheRemoveAllCacheResolverFactory = cacheRemoveAll == null ?
  142.                 null : cacheResolverFactoryFor(defaults, cacheRemoveAll.cacheResolverFactory());

  143.         return new MethodMeta(
  144.                 parameterTypes,
  145.                 annotations,
  146.                 mtdAnnotations,
  147.                 keyParameterIndexes(ic.getMethod()),
  148.                 getValueParameter(annotations),
  149.                 getKeyParameters(annotations),
  150.                 cacheResultCacheResultName,
  151.                 cacheResultCacheResolverFactory,
  152.                 cacheResultCacheKeyGenerator,
  153.                 cacheResult,
  154.                 cachePutCachePutName,
  155.                 cachePutCacheResolverFactory,
  156.                 cachePutCacheKeyGenerator,
  157.                 cachePut != null && cachePut.afterInvocation(),
  158.                 cachePut,
  159.                 cacheRemoveCacheRemoveName,
  160.                 cacheRemoveCacheResolverFactory,
  161.                 cacheRemoveCacheKeyGenerator,
  162.                 cacheRemove != null && cacheRemove.afterInvocation(),
  163.                 cacheRemove,
  164.                 cacheRemoveAllCacheRemoveAllName,
  165.                 cacheRemoveAllCacheResolverFactory,
  166.                 cacheRemoveAll != null && cacheRemoveAll.afterInvocation(),
  167.                 cacheRemoveAll);
  168.     }

  169.     private static Integer[] getKeyParameters(final List<Set<Annotation>> annotations)
  170.     {
  171.         final Collection<Integer> list = new ArrayList<>();
  172.         int idx = 0;
  173.         for (final Set<Annotation> set : annotations)
  174.         {
  175.             for (final Annotation a : set)
  176.             {
  177.                 if (a.annotationType() == CacheKey.class)
  178.                 {
  179.                     list.add(idx);
  180.                 }
  181.             }
  182.             idx++;
  183.         }
  184.         if (list.isEmpty())
  185.         {
  186.             for (int i = 0; i < annotations.size(); i++)
  187.             {
  188.                 list.add(i);
  189.             }
  190.         }
  191.         return list.toArray(new Integer[0]);
  192.     }

  193.     private static Integer getValueParameter(final List<Set<Annotation>> annotations)
  194.     {
  195.         final int idx = 0;
  196.         for (final Set<Annotation> set : annotations)
  197.         {
  198.             for (final Annotation a : set)
  199.             {
  200.                 if (a.annotationType() == CacheValue.class)
  201.                 {
  202.                     return idx;
  203.                 }
  204.             }
  205.         }
  206.         return -1;
  207.     }

  208.     private static String defaultName(final Method method, final CacheDefaults defaults, final String cacheName)
  209.     {
  210.         if (!cacheName.isEmpty())
  211.         {
  212.             return cacheName;
  213.         }
  214.         if (defaults != null)
  215.         {
  216.             final String name = defaults.cacheName();
  217.             if (!name.isEmpty())
  218.             {
  219.                 return name;
  220.             }
  221.         }

  222.         final StringBuilder name = new StringBuilder(method.getDeclaringClass().getName());
  223.         name.append(".");
  224.         name.append(method.getName());
  225.         name.append("(");
  226.         final Class<?>[] parameterTypes = method.getParameterTypes();
  227.         for (int pIdx = 0; pIdx < parameterTypes.length; pIdx++)
  228.         {
  229.             name.append(parameterTypes[pIdx].getName());
  230.             if ((pIdx + 1) < parameterTypes.length)
  231.             {
  232.                 name.append(",");
  233.             }
  234.         }
  235.         name.append(")");
  236.         return name.toString();
  237.     }

  238.     private static CacheDefaults findDefaults(final Class<?> targetType, final Method method)
  239.     {
  240.         if (Proxy.isProxyClass(targetType)) // target doesn't hold annotations
  241.         {
  242.             final Class<?> api = method.getDeclaringClass();
  243.             for (final Class<?> type : targetType
  244.                                          .getInterfaces())
  245.             {
  246.                 if (!api.isAssignableFrom(type))
  247.                 {
  248.                     continue;
  249.                 }
  250.                 return extractDefaults(type);
  251.             }
  252.         }
  253.         return extractDefaults(targetType);
  254.     }

  255.     private static CacheDefaults extractDefaults(final Class<?> type)
  256.     {
  257.         CacheDefaults annotation = null;
  258.         Class<?> clazz = type;
  259.         while (clazz != null && clazz != Object.class)
  260.         {
  261.             annotation = clazz.getAnnotation(CacheDefaults.class);
  262.             if (annotation != null)
  263.             {
  264.                 break;
  265.             }
  266.             clazz = clazz.getSuperclass();
  267.         }
  268.         return annotation;
  269.     }

  270.     public boolean isIncluded(final Class<?> aClass, final Class<?>[] in, final Class<?>[] out)
  271.     {
  272.         if (in.length == 0 && out.length == 0)
  273.         {
  274.             return false;
  275.         }
  276.         for (final Class<?> potentialIn : in)
  277.         {
  278.             if (potentialIn.isAssignableFrom(aClass))
  279.             {
  280.                 for (final Class<?> potentialOut : out)
  281.                 {
  282.                     if (potentialOut.isAssignableFrom(aClass))
  283.                     {
  284.                         return false;
  285.                     }
  286.                 }
  287.                 return true;
  288.             }
  289.         }
  290.         return false;
  291.     }

  292.     private CacheKeyGenerator cacheKeyGeneratorFor(final CacheDefaults defaults, final Class<? extends CacheKeyGenerator> cacheKeyGenerator)
  293.     {
  294.         if (!CacheKeyGenerator.class.equals(cacheKeyGenerator))
  295.         {
  296.             return instance(cacheKeyGenerator);
  297.         }
  298.         if (defaults != null)
  299.         {
  300.             final Class<? extends CacheKeyGenerator> defaultCacheKeyGenerator = defaults.cacheKeyGenerator();
  301.             if (!CacheKeyGenerator.class.equals(defaultCacheKeyGenerator))
  302.             {
  303.                 return instance(defaultCacheKeyGenerator);
  304.             }
  305.         }
  306.         return defaultCacheKeyGenerator;
  307.     }

  308.     private CacheResolverFactory cacheResolverFactoryFor(final CacheDefaults defaults, final Class<? extends CacheResolverFactory> cacheResolverFactory)
  309.     {
  310.         if (!CacheResolverFactory.class.equals(cacheResolverFactory))
  311.         {
  312.             return instance(cacheResolverFactory);
  313.         }
  314.         if (defaults != null)
  315.         {
  316.             final Class<? extends CacheResolverFactory> defaultCacheResolverFactory = defaults.cacheResolverFactory();
  317.             if (!CacheResolverFactory.class.equals(defaultCacheResolverFactory))
  318.             {
  319.                 return instance(defaultCacheResolverFactory);
  320.             }
  321.         }
  322.         return defaultCacheResolverFactory();
  323.     }

  324.     @SuppressWarnings("unchecked")
  325.     private <T> T instance(final Class<T> type)
  326.     {
  327.         final Set<Bean<?>> beans = beanManager.getBeans(type);
  328.         if (beans.isEmpty())
  329.         {
  330.             if (CacheKeyGenerator.class == type) {
  331.                 return (T) defaultCacheKeyGenerator;
  332.             }
  333.             if (CacheResolverFactory.class == type) {
  334.                 return (T) defaultCacheResolverFactory();
  335.             }
  336.             return null;
  337.         }
  338.         final Bean<?> bean = beanManager.resolve(beans);
  339.         final CreationalContext<?> context = beanManager.createCreationalContext(bean);
  340.         final Class<? extends Annotation> scope = bean.getScope();
  341.         final boolean normalScope = beanManager.isNormalScope(scope);
  342.         try
  343.         {
  344.             final Object reference = beanManager.getReference(bean, bean.getBeanClass(), context);
  345.             if (!normalScope)
  346.             {
  347.                 toRelease.add(context);
  348.             }
  349.             return (T) reference;
  350.         }
  351.         finally
  352.         {
  353.             if (normalScope)
  354.             { // TODO: release at the right moment, @PreDestroy? question is: do we assume it is thread safe?
  355.                 context.release();
  356.             }
  357.         }
  358.     }

  359.     private CacheResolverFactoryImpl defaultCacheResolverFactory()
  360.     {
  361.         if (defaultCacheResolverFactory != null) {
  362.             return defaultCacheResolverFactory;
  363.         }
  364.         synchronized (this) {
  365.             if (defaultCacheResolverFactory != null) {
  366.                 return defaultCacheResolverFactory;
  367.             }
  368.             defaultCacheResolverFactory = new CacheResolverFactoryImpl();
  369.         }
  370.         return defaultCacheResolverFactory;
  371.     }

  372.     private static Integer[] keyParameterIndexes(final Method method)
  373.     {
  374.         final List<Integer> keys = new LinkedList<>();
  375.         final Annotation[][] parameterAnnotations = method.getParameterAnnotations();

  376.         // first check if keys are specified explicitly
  377.         for (int i = 0; i < method.getParameterTypes().length; i++)
  378.         {
  379.             final Annotation[] annotations = parameterAnnotations[i];
  380.             for (final Annotation a : annotations)
  381.             {
  382.                 if (a.annotationType().equals(CacheKey.class))
  383.                 {
  384.                     keys.add(i);
  385.                     break;
  386.                 }
  387.             }
  388.         }

  389.         // if not then use all parameters but value ones
  390.         if (keys.isEmpty())
  391.         {
  392.             for (int i = 0; i < method.getParameterTypes().length; i++)
  393.             {
  394.                 final Annotation[] annotations = parameterAnnotations[i];
  395.                 boolean value = false;
  396.                 for (final Annotation a : annotations)
  397.                 {
  398.                     if (a.annotationType().equals(CacheValue.class))
  399.                     {
  400.                         value = true;
  401.                         break;
  402.                     }
  403.                 }
  404.                 if (!value) {
  405.                     keys.add(i);
  406.                 }
  407.             }
  408.         }
  409.         return keys.toArray(new Integer[0]);
  410.     }

  411.     private static final class MethodKey
  412.     {
  413.         private final Class<?> base;
  414.         private final Method delegate;
  415.         private final int hash;

  416.         private MethodKey(final Class<?> base, final Method delegate)
  417.         {
  418.             this.base = base; // we need a class to ensure inheritance don't fall in the same key
  419.             this.delegate = delegate;
  420.             this.hash = 31 * delegate.hashCode() + (base == null ? 0 : base.hashCode());
  421.         }

  422.         @Override
  423.         public boolean equals(final Object o)
  424.         {
  425.             if (this == o)
  426.             {
  427.                 return true;
  428.             }
  429.             if (o == null || getClass() != o.getClass())
  430.             {
  431.                 return false;
  432.             }
  433.             final MethodKey classKey = MethodKey.class.cast(o);
  434.             return delegate.equals(classKey.delegate) &&
  435.                 (base == null && classKey.base == null || base != null && base.equals(classKey.base));
  436.         }

  437.         @Override
  438.         public int hashCode()
  439.         {
  440.             return hash;
  441.         }
  442.     }

  443.     // TODO: split it in 5?
  444.     public static class MethodMeta
  445.     {
  446.         private final Class<?>[] parameterTypes;
  447.         private final List<Set<Annotation>> parameterAnnotations;
  448.         private final Set<Annotation> annotations;
  449.         private final Integer[] keysIndices;
  450.         private final Integer valueIndex;
  451.         private final Integer[] parameterIndices;

  452.         private final String cacheResultCacheName;
  453.         private final CacheResolverFactory cacheResultResolverFactory;
  454.         private final CacheKeyGenerator cacheResultKeyGenerator;
  455.         private final CacheResult cacheResult;

  456.         private final String cachePutCacheName;
  457.         private final CacheResolverFactory cachePutResolverFactory;
  458.         private final CacheKeyGenerator cachePutKeyGenerator;
  459.         private final boolean cachePutAfter;
  460.         private final CachePut cachePut;

  461.         private final String cacheRemoveCacheName;
  462.         private final CacheResolverFactory cacheRemoveResolverFactory;
  463.         private final CacheKeyGenerator cacheRemoveKeyGenerator;
  464.         private final boolean cacheRemoveAfter;
  465.         private final CacheRemove cacheRemove;

  466.         private final String cacheRemoveAllCacheName;
  467.         private final CacheResolverFactory cacheRemoveAllResolverFactory;
  468.         private final boolean cacheRemoveAllAfter;
  469.         private final CacheRemoveAll cacheRemoveAll;

  470.         public MethodMeta(final Class<?>[] parameterTypes, final List<Set<Annotation>> parameterAnnotations, final Set<Annotation>
  471.                 annotations, final Integer[] keysIndices, final Integer valueIndex, final Integer[] parameterIndices, final String
  472.                 cacheResultCacheName, final CacheResolverFactory cacheResultResolverFactory, final CacheKeyGenerator
  473.                 cacheResultKeyGenerator, final CacheResult cacheResult, final String cachePutCacheName, final CacheResolverFactory
  474.                 cachePutResolverFactory, final CacheKeyGenerator cachePutKeyGenerator, final boolean cachePutAfter, final CachePut cachePut, final String
  475.                 cacheRemoveCacheName, final CacheResolverFactory cacheRemoveResolverFactory, final CacheKeyGenerator
  476.                 cacheRemoveKeyGenerator, final boolean cacheRemoveAfter, final CacheRemove cacheRemove, final String cacheRemoveAllCacheName,
  477.                           final CacheResolverFactory cacheRemoveAllResolverFactory, final boolean
  478.                                   cacheRemoveAllAfter, final CacheRemoveAll cacheRemoveAll)
  479.         {
  480.             this.parameterTypes = parameterTypes;
  481.             this.parameterAnnotations = parameterAnnotations;
  482.             this.annotations = annotations;
  483.             this.keysIndices = keysIndices;
  484.             this.valueIndex = valueIndex;
  485.             this.parameterIndices = parameterIndices;
  486.             this.cacheResultCacheName = cacheResultCacheName;
  487.             this.cacheResultResolverFactory = cacheResultResolverFactory;
  488.             this.cacheResultKeyGenerator = cacheResultKeyGenerator;
  489.             this.cacheResult = cacheResult;
  490.             this.cachePutCacheName = cachePutCacheName;
  491.             this.cachePutResolverFactory = cachePutResolverFactory;
  492.             this.cachePutKeyGenerator = cachePutKeyGenerator;
  493.             this.cachePutAfter = cachePutAfter;
  494.             this.cachePut = cachePut;
  495.             this.cacheRemoveCacheName = cacheRemoveCacheName;
  496.             this.cacheRemoveResolverFactory = cacheRemoveResolverFactory;
  497.             this.cacheRemoveKeyGenerator = cacheRemoveKeyGenerator;
  498.             this.cacheRemoveAfter = cacheRemoveAfter;
  499.             this.cacheRemove = cacheRemove;
  500.             this.cacheRemoveAllCacheName = cacheRemoveAllCacheName;
  501.             this.cacheRemoveAllResolverFactory = cacheRemoveAllResolverFactory;
  502.             this.cacheRemoveAllAfter = cacheRemoveAllAfter;
  503.             this.cacheRemoveAll = cacheRemoveAll;
  504.         }

  505.         public boolean isCacheRemoveAfter()
  506.         {
  507.             return cacheRemoveAfter;
  508.         }

  509.         public boolean isCachePutAfter()
  510.         {
  511.             return cachePutAfter;
  512.         }

  513.         public Class<?>[] getParameterTypes()
  514.         {
  515.             return parameterTypes;
  516.         }

  517.         public List<Set<Annotation>> getParameterAnnotations()
  518.         {
  519.             return parameterAnnotations;
  520.         }

  521.         public String getCacheResultCacheName()
  522.         {
  523.             return cacheResultCacheName;
  524.         }

  525.         public CacheResolverFactory getCacheResultResolverFactory()
  526.         {
  527.             return cacheResultResolverFactory;
  528.         }

  529.         public CacheKeyGenerator getCacheResultKeyGenerator()
  530.         {
  531.             return cacheResultKeyGenerator;
  532.         }

  533.         public CacheResult getCacheResult() {
  534.             return cacheResult;
  535.         }

  536.         public Integer[] getParameterIndices()
  537.         {
  538.             return parameterIndices;
  539.         }

  540.         public Set<Annotation> getAnnotations()
  541.         {
  542.             return annotations;
  543.         }

  544.         public Integer[] getKeysIndices()
  545.         {
  546.             return keysIndices;
  547.         }

  548.         public Integer getValuesIndex()
  549.         {
  550.             return valueIndex;
  551.         }

  552.         public Integer getValueIndex()
  553.         {
  554.             return valueIndex;
  555.         }

  556.         public String getCachePutCacheName()
  557.         {
  558.             return cachePutCacheName;
  559.         }

  560.         public CacheResolverFactory getCachePutResolverFactory()
  561.         {
  562.             return cachePutResolverFactory;
  563.         }

  564.         public CacheKeyGenerator getCachePutKeyGenerator()
  565.         {
  566.             return cachePutKeyGenerator;
  567.         }

  568.         public CachePut getCachePut()
  569.         {
  570.             return cachePut;
  571.         }

  572.         public String getCacheRemoveCacheName()
  573.         {
  574.             return cacheRemoveCacheName;
  575.         }

  576.         public CacheResolverFactory getCacheRemoveResolverFactory()
  577.         {
  578.             return cacheRemoveResolverFactory;
  579.         }

  580.         public CacheKeyGenerator getCacheRemoveKeyGenerator()
  581.         {
  582.             return cacheRemoveKeyGenerator;
  583.         }

  584.         public CacheRemove getCacheRemove()
  585.         {
  586.             return cacheRemove;
  587.         }

  588.         public String getCacheRemoveAllCacheName()
  589.         {
  590.             return cacheRemoveAllCacheName;
  591.         }

  592.         public CacheResolverFactory getCacheRemoveAllResolverFactory()
  593.         {
  594.             return cacheRemoveAllResolverFactory;
  595.         }

  596.         public boolean isCacheRemoveAllAfter()
  597.         {
  598.             return cacheRemoveAllAfter;
  599.         }

  600.         public CacheRemoveAll getCacheRemoveAll()
  601.         {
  602.             return cacheRemoveAll;
  603.         }
  604.     }
  605. }