Configure Aspects/Interceptors by Passing in Parameters

WARNING - TOPIC NOT WRITTEN - TOPIC ID: 3485

This topic has not yet been written. The content below is from the topic description.
You can configure aspects/interceptors by passing in parameters when you define them. The attribute child element is used to pass in the values. aa 1 aspect,per,vm aspect,per,class aspect,per,instance aspect,per,joinpoint ... The name attribute is used to indicate which property you want to set, and the contents of the attribute is the value. Valid types are all the primitives (String, float, int etc.), or an array of Strings. The aspect/interceptor must contain a setter matching the signature implied by the configuration in jboss-aop.xml. In this example we have: public class ConfigInterceptor implements Interceptor { String attr1; int attr2; ... public void setAttr1(String s) { attr1 = s; System.out.println("setAttr1: " + s); } public void setAttr2(int i) { attr2 = i; System.out.println("setAttr2: " + i); } ... } public class ConfigAspectPerVm { String[] attr1; ... public void setAttr(String[] attr1) { this.attr1 = attr1; } } So, in the bindings above, JBoss AOP will call ConfigInterceptor.setAttr1("aa"), ConfigInterceptor.setAttr2(1), ConfigAspectPerVm.setAttr({"aspect", "per", "vm"}). ConfigAspectPerClass, ConfigAspectPerInstance and ConfigAspectPerJoinpoint are more or less the same as ConfigAspectPerVm.