Package jodd.aop

Class Aspect

  • All Implemented Interfaces:
    java.lang.reflect.InvocationHandler

    public abstract class Aspect
    extends java.lang.Object
    implements java.lang.reflect.InvocationHandler
    Base aspect class that holds the target instance.
    • Constructor Summary

      Constructors 
      Constructor Description
      Aspect​(java.lang.Object target)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract boolean after​(java.lang.Object target, java.lang.reflect.Method method, java.lang.Object[] args)
      Runs after targets method.
      abstract boolean afterException​(java.lang.Object target, java.lang.reflect.Method method, java.lang.Object[] args, java.lang.Throwable throwable)
      Invoked after exception.
      abstract boolean before​(java.lang.Object target, java.lang.reflect.Method method, java.lang.Object[] args)
      Runs before targets method.
      java.lang.Object getTarget()
      Returns target object.
      java.lang.Object invoke​(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Aspect

        public Aspect​(java.lang.Object target)
    • Method Detail

      • getTarget

        public final java.lang.Object getTarget()
        Returns target object.
      • before

        public abstract boolean before​(java.lang.Object target,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
        Runs before targets method. Returns true if target method should run.
      • after

        public abstract boolean after​(java.lang.Object target,
                                      java.lang.reflect.Method method,
                                      java.lang.Object[] args)
        Runs after targets method. Returns true if aspect method should return value, otherwise null.
      • afterException

        public abstract boolean afterException​(java.lang.Object target,
                                               java.lang.reflect.Method method,
                                               java.lang.Object[] args,
                                               java.lang.Throwable throwable)
        Invoked after exception.
      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Throws:
        java.lang.Throwable