Annotations - Implement DynamicCFlow
Implement DynamicCFlow Take a look at SimpleDynamicCFlow: import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.pointcut.DynamicCFlow; import org.jboss.aop.DynamicCFlowDef; @DynamicCFlowDef public class SimpleDynamicCFlow implements DynamicCFlow { public static boolean runit = false; public boolean shouldExecute(Invocation invocation) { return runit; } } This is exactly the same as in the XML example. The only difference is that we declare the dynamic cflow class by annotating it with @DynamicCFlowDef.