Codota Logo
JCacheOperationSource.getCacheOperation
Code IndexAdd Codota to your IDE (free)

How to use
getCacheOperation
method
in
org.springframework.cache.jcache.interceptor.JCacheOperationSource

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
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

@Override
public Object generate(Object target, Method method, Object... params) {
  JCacheOperation<?> operation = this.cacheOperationSource.getCacheOperation(method, target.getClass());
  if (!(AbstractJCacheKeyOperation.class.isInstance(operation))) {
    throw new IllegalStateException("Invalid operation, should be a key-based operation " + operation);
  }
  CacheKeyInvocationContext<?> invocationContext = createCacheKeyInvocationContext(target, operation, params);
  if (this.cacheKeyGenerator != null) {
    return this.cacheKeyGenerator.generateCacheKey(invocationContext);
  }
  else {
    Assert.state(this.keyGenerator != null, "No key generator");
    return doGenerate(this.keyGenerator, invocationContext);
  }
}
origin: org.springframework/spring-context-support

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

@Nullable
protected Object execute(CacheOperationInvoker invoker, Object target, Method method, Object[] args) {
  // Check whether aspect is enabled to cope with cases where the AJ is pulled in automatically
  if (this.initialized) {
    Class<?> targetClass = AopProxyUtils.ultimateTargetClass(target);
    JCacheOperation<?> operation = getCacheOperationSource().getCacheOperation(method, targetClass);
    if (operation != null) {
      CacheOperationInvocationContext<?> context =
          createCacheOperationInvocationContext(target, args, operation);
      return execute(context, invoker);
    }
  }
  return invoker.invoke();
}
origin: org.springframework/spring-context-support

@Override
public Object generate(Object target, Method method, Object... params) {
  JCacheOperation<?> operation = this.cacheOperationSource.getCacheOperation(method, target.getClass());
  if (!(AbstractJCacheKeyOperation.class.isInstance(operation))) {
    throw new IllegalStateException("Invalid operation, should be a key-based operation " + operation);
  }
  CacheKeyInvocationContext<?> invocationContext = createCacheKeyInvocationContext(target, operation, params);
  if (this.cacheKeyGenerator != null) {
    return this.cacheKeyGenerator.generateCacheKey(invocationContext);
  }
  else {
    Assert.state(this.keyGenerator != null, "No key generator");
    return doGenerate(this.keyGenerator, invocationContext);
  }
}
origin: org.springframework/spring-context-support

@Nullable
protected Object execute(CacheOperationInvoker invoker, Object target, Method method, Object[] args) {
  // Check whether aspect is enabled to cope with cases where the AJ is pulled in automatically
  if (this.initialized) {
    Class<?> targetClass = AopProxyUtils.ultimateTargetClass(target);
    JCacheOperation<?> operation = getCacheOperationSource().getCacheOperation(method, targetClass);
    if (operation != null) {
      CacheOperationInvocationContext<?> context =
          createCacheOperationInvocationContext(target, args, operation);
      return execute(context, invoker);
    }
  }
  return invoker.invoke();
}
origin: apache/servicemix-bundles

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

@Override
public Object generate(Object target, Method method, Object... params) {
  JCacheOperation<?> operation = this.cacheOperationSource.getCacheOperation(method, target.getClass());
  if (!(AbstractJCacheKeyOperation.class.isInstance(operation))) {
    throw new IllegalStateException("Invalid operation, should be a key-based operation " + operation);
  }
  CacheKeyInvocationContext<?> invocationContext = createCacheKeyInvocationContext(target, operation, params);
  if (this.cacheKeyGenerator != null) {
    return this.cacheKeyGenerator.generateCacheKey(invocationContext);
  }
  else {
    return doGenerate(this.keyGenerator, invocationContext);
  }
}
origin: apache/servicemix-bundles

JCacheOperation<?> operation = getCacheOperationSource().getCacheOperation(method, targetClass);
if (operation != null) {
  CacheOperationInvocationContext<?> context =
org.springframework.cache.jcache.interceptorJCacheOperationSourcegetCacheOperation

Javadoc

Return the cache operations for this method, or nullif the method contains no JSR-107 related metadata.

Popular methods of JCacheOperationSource

    Popular in Java

    • Reactive rest calls using spring rest template
    • addToBackStack (FragmentTransaction)
    • scheduleAtFixedRate (Timer)
      Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
    • getApplicationContext (Context)
    • BorderLayout (java.awt)
      A border layout lays out a container, arranging and resizing its components to fit in five regions:
    • PrintStream (java.io)
      A PrintStream adds functionality to another output stream, namely the ability to print representatio
    • Socket (java.net)
      Provides a client-side TCP socket.
    • SimpleDateFormat (java.text)
      Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
    • SortedMap (java.util)
      A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
    • Join (org.hibernate.mapping)
    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