Example usage for org.aspectj.runtime.internal AroundClosure AroundClosure

List of usage examples for org.aspectj.runtime.internal AroundClosure AroundClosure

Introduction

In this page you can find the example usage for org.aspectj.runtime.internal AroundClosure AroundClosure.

Prototype

public AroundClosure() 

Source Link

Usage

From source file:AroundAMain.java

License:Open Source License

public static void main(String[] args) throws ClassNotFoundException {
    AroundClosure closure = new AroundClosure() {
        public Object run(Object[] args) throws Throwable {
            //            System.out.println("run with: " + Arrays.asList(args));
            return new Integer(10);
        }//from   ww w .ja  v a  2 s  .c om
    };

    Object instance = Reflection.getStaticField(Class.forName("AroundA"), "ajc$perSingletonInstance");

    Reflection.invoke(Class.forName("AroundA"), instance, "ajc$around$AroundA$1$73ebb943", // was $AroundA$46
            new Integer(10), new Boolean(true), closure);

    Reflection.invoke(Class.forName("AroundA"), instance, "ajc$around$AroundA$2$a758212d", // Was $AroundA$c5
            "hello there", closure);
    Reflection.invoke(Class.forName("AroundA"), instance, "ajc$around$AroundA$3$a758212d", // Was $AroundA$150
            new String[1], closure);

}