Weaver w = WeaverFactory.getWeaver(); Method staticActionMethod =SimpleAction.class.getDeclaredMethod ("simpleStaticAction",new Class[0]//no arguments); MethodSubscription ms = new MethodSubscription (/* where to match*/,InsertionType.BEFORE,staticActionMethod); w.addSubscription(ms);
// Get a Weaver instance that will act as a // container for the subscription(s) we create Weaver w = WeaverFactory.getWeaver();
// regular java.lang.reflect is used to refer // to the action method "simpleStaticAction()" Method staticActionMethod = SimpleAction.class.getDeclaredMethod( "simpleStaticAction", new Class[0]//no arguments );