1 22 package org.jboss.test.aop.beanstyleconfig; 23 24 import org.jboss.aop.Advisor; 25 import org.jboss.aop.InstanceAdvisor; 26 import org.jboss.aop.advice.Interceptor; 27 import org.jboss.aop.joinpoint.Invocation; 28 import org.jboss.aop.joinpoint.Joinpoint; 29 30 34 public class InterceptorPerInstance implements Interceptor 35 { 36 private int intAttr; 37 private String stringAttr; 38 private Advisor advisor; 39 private InstanceAdvisor instanceAdvisor; 40 private Joinpoint joinpoint; 41 42 45 public Advisor getAdvisor() 46 { 47 return advisor; 48 } 49 50 53 public void setAdvisor(Advisor advisor) 54 { 55 this.advisor = advisor; 56 } 57 58 61 public InstanceAdvisor getInstanceAdvisor() 62 { 63 return instanceAdvisor; 64 } 65 66 69 public void setInstanceAdvisor(InstanceAdvisor instanceAdvisor) 70 { 71 this.instanceAdvisor = instanceAdvisor; 72 } 73 74 77 public int getIntAttr() 78 { 79 return intAttr; 80 } 81 82 85 public void setIntAttr(int intAttr) 86 { 87 this.intAttr = intAttr; 88 } 89 90 93 public Joinpoint getJoinpoint() 94 { 95 return joinpoint; 96 } 97 98 101 public void setJoinpoint(Joinpoint joinpoint) 102 { 103 this.joinpoint = joinpoint; 104 } 105 106 109 public String getStringAttr() 110 { 111 return stringAttr; 112 } 113 114 117 public void setStringAttr(String stringAttr) 118 { 119 this.stringAttr = stringAttr; 120 } 121 122 public String getName() 123 { 124 return this.getClass().getName(); 125 } 126 127 public Object invoke(Invocation invocation) throws Throwable 128 { 129 InvokedConfigs.addInvokedConfig(this.getClass().getName(), advisor, instanceAdvisor, joinpoint, intAttr, stringAttr); 130 return invocation.invokeNext(); 131 } 132 } 133 | Popular Tags |