Class IndexAndCacheAspect

java.lang.Object
com.erudika.para.server.aop.IndexAndCacheAspect
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class IndexAndCacheAspect extends Object implements org.aopalliance.intercept.MethodInterceptor
This is the core method interceptor which enables caching and indexing. It listens for calls to annotated DAO methods and adds searching and caching functionality to them. This technique allows us to control the caching and searching centrally for all implementations of the DAO interface.
Author:
Alex Bogdanovski [[email protected]]
See Also:
  • Constructor Details

    • IndexAndCacheAspect

      public IndexAndCacheAspect()
  • Method Details

    • getSearch

      public Search getSearch()
      Returns:
      Search
    • setSearch

      @Inject public void setSearch(Search search)
      Parameters:
      search - Search
    • getCache

      public Cache getCache()
      Returns:
      Cache
    • setCache

      @Inject public void setCache(Cache cache)
      Parameters:
      cache - Cache
    • invoke

      public Object invoke(org.aopalliance.intercept.MethodInvocation mi) throws Throwable
      Executes code when a method is invoked. A big switch statement.
      Specified by:
      invoke in interface org.aopalliance.intercept.MethodInterceptor
      Parameters:
      mi - method invocation
      Returns:
      the returned value of the method invoked or something else (decided here)
      Throws:
      Throwable - error