Class CachingProxy


  • public final class CachingProxy
    extends Object
    A Java dynamic proxy that caches method results based on the presence of a @Cacheable annotation
    • Method Detail

      • newInstance

        public static <T> T newInstance​(Class<T> interfaceClass,
                                        T target)
        Create a new proxy instance that implements the provided interface and delegates to a caching invocation handler.
        Type Parameters:
        T - the type of the proxy instance
        Parameters:
        interfaceClass - the interface class
        target - the target
        Returns:
        a new proxy instance that implements the provided interface
      • hasCacheableMethod

        public static boolean hasCacheableMethod​(Class<?> targetClass)
        Indicates whether the provided class has at least one method with the @Cacheable annotation
        Parameters:
        targetClass - the target class
        Returns:
        true if the provided class has at least one method with the @Cacheable annotation, false otherwise