JBoss.org Community Documentation

5.12. typedef

<typedef name="jmx" expr="class(@org.jboss.jmx.@MBean) OR \
                          has(* *->org.jboss.jmx.@ManagedOperation) OR \
                          has(* *->org.jboss.jmx.@ManagedAttribute)"/>

typedefs allow you to define complex type expressions and then use then pointcut expressions. In the above example, we're defining a class that is tagged as @Mbean, or has a method tagged as @ManagedOperaion or @ManagedAttribute. The above typedef could then be used in a pointcut, introduction, or bind element

<pointcut name="stuff" expr="execution(* $typedef{jmx}->*(..))"/>
<introduction expr="class($typedef{jmx})">