Codota Logo
org.springframework.cache.jcache.interceptor
Code IndexAdd Codota to your IDE (free)

How to use org.springframework.cache.jcache.interceptor

Best Java code snippets using org.springframework.cache.jcache.interceptor (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-framework

public void afterPropertiesSet() {
  getCacheOperationSource();
  this.cacheResultInterceptor = new CacheResultInterceptor(getErrorHandler());
  this.cachePutInterceptor = new CachePutInterceptor(getErrorHandler());
  this.cacheRemoveEntryInterceptor = new CacheRemoveEntryInterceptor(getErrorHandler());
  this.cacheRemoveAllInterceptor = new CacheRemoveAllInterceptor(getErrorHandler());
  this.initialized = true;
}
origin: spring-projects/spring-framework

public DefaultCacheKeyInvocationContext(AbstractJCacheKeyOperation<A> operation, Object target, Object[] args) {
  super(operation, target, args);
  this.keyParameters = operation.getKeyParameters(args);
  if (operation instanceof CachePutOperation) {
    this.valueParameter = ((CachePutOperation) operation).getValueParameter(args);
  }
  else {
    this.valueParameter = null;
  }
}
origin: spring-projects/spring-framework

@Override
public boolean matches(Method method, Class<?> targetClass) {
  JCacheOperationSource cas = getCacheOperationSource();
  return (cas != null && cas.getCacheOperation(method, targetClass) != null);
}
origin: spring-projects/spring-framework

protected DefaultCacheInvocationContext<?> createDummyContext() throws Exception {
  Method method = Sample.class.getMethod("get", String.class);
  CacheResult cacheAnnotation = method.getAnnotation(CacheResult.class);
  CacheMethodDetails<CacheResult> methodDetails =
      new DefaultCacheMethodDetails<>(method, cacheAnnotation, "test");
  CacheResultOperation operation = new CacheResultOperation(methodDetails,
      defaultCacheResolver, defaultKeyGenerator, defaultExceptionCacheResolver);
  return new DefaultCacheInvocationContext<>(operation, new Sample(), new Object[] {"id"});
}
origin: spring-projects/spring-framework

protected void cacheValue(CacheOperationInvocationContext<CachePutOperation> context, Object value) {
  Object key = generateKey(context);
  Cache cache = resolveCache(context);
  doPut(cache, key, value);
}
origin: spring-projects/spring-framework

protected JCacheInterceptor createInterceptor(JCacheOperationSource source) {
  JCacheInterceptor interceptor = new JCacheInterceptor();
  interceptor.setCacheOperationSource(source);
  interceptor.afterPropertiesSet();
  return interceptor;
}
origin: spring-projects/spring-framework

@Override
protected CacheResolver getDefaultExceptionCacheResolver() {
  if (getExceptionCacheResolver() == null) {
    this.exceptionCacheResolver = SingletonSupplier.of(new LazyCacheResolver());
  }
  return getExceptionCacheResolver();
}
origin: spring-projects/spring-framework

@Override
protected CacheResultOperation createSimpleOperation() {
  CacheMethodDetails<CacheResult> methodDetails = create(CacheResult.class,
      SampleObject.class, "simpleGet", Long.class);
  return new CacheResultOperation(methodDetails, defaultCacheResolver, defaultKeyGenerator,
      defaultExceptionCacheResolver);
}
origin: spring-projects/spring-framework

@Override
protected CacheRemoveAllOperation createSimpleOperation() {
  CacheMethodDetails<CacheRemoveAll> methodDetails = create(CacheRemoveAll.class,
      SampleObject.class, "simpleRemoveAll");
  return new CacheRemoveAllOperation(methodDetails, defaultCacheResolver);
}
origin: spring-projects/spring-framework

@Override
protected CacheRemoveOperation createSimpleOperation() {
  CacheMethodDetails<CacheRemove> methodDetails = create(CacheRemove.class,
      SampleObject.class, "simpleRemove", Long.class);
  return new CacheRemoveOperation(methodDetails, defaultCacheResolver, defaultKeyGenerator);
}
origin: spring-projects/spring-framework

@SuppressWarnings("unchecked")
private CacheOperationInvocationContext<?> createCacheOperationInvocationContext(
    Object target, Object[] args, JCacheOperation<?> operation) {
  return new DefaultCacheInvocationContext<>(
      (JCacheOperation<Annotation>) operation, target, args);
}
origin: spring-projects/spring-framework

@Override
public String getCacheName() {
  return this.operation.getCacheName();
}
origin: spring-projects/spring-framework

@Override
public Set<Annotation> getAnnotations() {
  return this.operation.getAnnotations();
}
origin: spring-projects/spring-framework

@SuppressWarnings("unchecked")
private CacheKeyInvocationContext<?> createCacheKeyInvocationContext(
    Object target, JCacheOperation<?> operation, Object[] params) {
  AbstractJCacheKeyOperation<Annotation> keyCacheOperation = (AbstractJCacheKeyOperation<Annotation>) operation;
  return new DefaultCacheKeyInvocationContext<>(keyCacheOperation, target, params);
}
origin: spring-projects/spring-framework

public DefaultCacheInvocationContext(JCacheOperation<A> operation, Object target, Object[] args) {
  this.operation = operation;
  this.target = target;
  this.args = args;
  this.allParameters = operation.getAllParameters(args);
}
origin: spring-projects/spring-framework

  @Override
  public Object invoke() throws ThrowableWrapper {
    return invokeOperation(this.delegate);
  }
}
origin: spring-projects/spring-framework

/**
 * Set the {@link org.springframework.aop.ClassFilter} to use for this pointcut.
 * Default is {@link org.springframework.aop.ClassFilter#TRUE}.
 */
public void setClassFilter(ClassFilter classFilter) {
  this.pointcut.setClassFilter(classFilter);
}
origin: spring-projects/spring-framework

/**
 * Create a new instance.
 * @param methodDetails the {@link CacheMethodDetails} related to the cached method
 * @param cacheResolver the cache resolver to resolve regular caches
 * @param keyGenerator the key generator to compute cache keys
 */
protected AbstractJCacheKeyOperation(CacheMethodDetails<A> methodDetails,
    CacheResolver cacheResolver, KeyGenerator keyGenerator) {
  super(methodDetails, cacheResolver);
  this.keyGenerator = keyGenerator;
  this.keyParameterDetails = initializeKeyParameterDetails(this.allParameterDetails);
}
origin: spring-projects/spring-framework

  public CacheInvocationParameter toCacheInvocationParameter(Object value) {
    return new CacheInvocationParameterImpl(this, value);
  }
}
origin: spring-projects/spring-framework

@Override
protected CachePutOperation createSimpleOperation() {
  CacheMethodDetails<CachePut> methodDetails = create(CachePut.class,
      SampleObject.class, "simplePut", Long.class, SampleObject.class);
  return createDefaultOperation(methodDetails);
}
org.springframework.cache.jcache.interceptor

Most used classes

  • AbstractJCacheKeyOperation
    A base JCacheOperation that operates with a key.
  • CachePutOperation
    The JCacheOperation implementation for a CachePut operation.
  • CacheRemoveAllOperation
    The JCacheOperation implementation for a CacheRemoveAll operation.
  • CacheRemoveOperation
    The JCacheOperation implementation for a CacheRemove operation.
  • CacheResolverAdapter
    Spring's CacheResolver implementation that delegates to a standard JSR-107 javax.cache.annotation.Ca
  • DefaultCacheInvocationContext,
  • DefaultCacheMethodDetails,
  • DefaultJCacheOperationSource,
  • JCacheInterceptor,
  • JCacheOperation,
  • KeyGeneratorAdapter,
  • AbstractCacheInterceptor,
  • AbstractFallbackJCacheOperationSource,
  • AbstractJCacheOperation$CacheInvocationParameterImpl,
  • AbstractJCacheOperation$CacheParameterDetail,
  • AbstractJCacheOperation,
  • AnnotationJCacheOperationSource,
  • BeanFactoryJCacheOperationSourceAdvisor,
  • CachePutInterceptor
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now