Example usage for org.aspectj.util Reflection getStaticField

List of usage examples for org.aspectj.util Reflection getStaticField

Introduction

In this page you can find the example usage for org.aspectj.util Reflection getStaticField.

Prototype

public static Object getStaticField(Class<?> class_, String name) 

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.j a  va 2s .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);

}