Class MethodCacher


  • public final class MethodCacher
    extends Object
    Cache method results.

    It is an AspectJ aspect and you are not supposed to use it directly. It is instantiated by AspectJ runtime framework when your code is annotated with Cacheable annotation.

    The class is thread-safe.

    Since:
    0.8
    • Constructor Detail

      • MethodCacher

        public MethodCacher()
        Public ctor.
    • Method Detail

      • cache

        public Object cache​(org.aspectj.lang.ProceedingJoinPoint point)
                     throws Throwable
        Call the method or fetch from cache.

        Try NOT to change the signature of this method, in order to keep it backward compatible.

        Parameters:
        point - Joint point
        Returns:
        The result of call
        Throws:
        Throwable - If something goes wrong inside
      • flush

        @Deprecated
        public Object flush​(org.aspectj.lang.ProceedingJoinPoint point)
                     throws Throwable
        Deprecated.
        Since 0.7.17, and preflush() should be used
        Flush cache.
        Parameters:
        point - Join point
        Returns:
        Value of the method
        Throws:
        Throwable - If something goes wrong inside
        Since:
        0.7.14
      • preflush

        public void preflush​(org.aspectj.lang.JoinPoint point)
        Flush cache.

        Try NOT to change the signature of this method, in order to keep it backward compatible.

        Parameters:
        point - Joint point
        Since:
        0.7.14
      • postflush

        public void postflush​(org.aspectj.lang.JoinPoint point)
        Flush cache after method execution.

        Try NOT to change the signature of this method, in order to keep it backward compatible.

        Parameters:
        point - Joint point
        Since:
        0.7.18