Access Metadata at Runtime
You can access metadata through the org.jboss.aop.Advised interface through the _getAdvisor() or _getInstanceAdvisor() methods, or you can use the indirection that the Invocation object provides you. You can use the Invocation object to resolve metadata based on the context of the execution. BillingInterceptor.java gives an example of this. This interceptor intercepts different kinds of things (methods and constructors), but it doesn't care about the thing it is intercepting, only the metadata. public Object invoke(Invocation invocation) throws Throwable { System.out.println("billing amount: $" + invocation.getMetaData("Billable", "amount")); }