1 22 package org.jboss.aspects.asynch; 23 24 import org.jboss.aop.advice.Interceptor; 25 import org.jboss.aop.joinpoint.Invocation; 26 27 import java.io.Serializable ; 28 29 35 public class AsynchProxyInterceptor implements Interceptor, Serializable 36 { 37 private static final long serialVersionUID = -6294601804409518509L; 38 39 private FutureHolder holder; 40 41 public AsynchProxyInterceptor(FutureHolder holder) 42 { 43 this.holder = holder; 44 } 45 46 public String getName() 47 { 48 return "AsynchProxyInterceptor"; 49 } 50 51 public Object invoke(Invocation invocation) throws Throwable 52 { 53 Object rtn = invocation.invokeNext(); 54 Future future = (Future) invocation.getResponseAttachment(AsynchAspect.FUTURE); 55 if (future != null) 56 { 57 holder.setFuture(future); 58 } 59 return rtn; 60 } 61 } 62 | Popular Tags |