1 22 package org.jboss.test.aop.mcjmx; 23 24 import org.jboss.aop.advice.Interceptor; 25 import org.jboss.aop.joinpoint.Invocation; 26 27 32 public class InterceptorWithDependency implements Interceptor 33 { 34 Dependency dependency; 35 36 public Dependency getDependency() 37 { 38 return dependency; 39 } 40 41 public void setDependency(Dependency dependency) 42 { 43 this.dependency = dependency; 44 } 45 46 public String getName() 47 { 48 return getClass().getName(); 49 } 50 51 public Object invoke(Invocation invocation) throws Throwable 52 { 53 Object target = invocation.getTargetObject(); 54 if (target instanceof BeanWithDependency) 55 { 56 ((BeanWithDependency)target).invoked = "true"; 57 } 58 return invocation.invokeNext(); 59 } 60 } 61 | Popular Tags |