Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*    */ package org.jboss.aspects.asynch;
 /*    */ 
 /*    */ import java.util.concurrent.Callable;
 /*    */ import java.util.concurrent.ExecutorService;
 /*    */ import java.util.concurrent.Executors;
 /*    */ import java.util.concurrent.Future;
 /*    */ import org.jboss.aop.Advisor;
 /*    */ 
/*    */ public class ThreadPoolExecutor
/*    */   implements ExecutorAbstraction
/*    */ {
/* 39 */   private static ExecutorService executor = Executors.newCachedThreadPool();
/*    */ 
/*    */   public void setAdvisor(Advisor advisor)
/*    */   {
/*    */   }
/*    */ 
/*    */   public RemotableFuture execute(MethodInvocation invocation)
/*    */     throws Exception
/*    */   {
/* 48 */     MethodInvocation copy = (MethodInvocation)invocation.copy();
/* 49 */     ClassLoader cl = Thread.currentThread().getContextClassLoader();
/*    */ 
/* 51 */     Future future = .submit(new Callable(clcopy)
/*    */     {
/*    */       public Object call() throws Exception
/*    */       {
/*    */         try
/*    */         {
/* 57 */           Thread.currentThread().setContextClassLoader(this.);
/* 58 */           return this..invokeNext();
/*    */         }
/*    */         catch (Throwable throwable)
/*    */         {
/* 62 */           if ((throwable instanceof Exception))
/*    */           {
/* 64 */             throw ((Exception)throwable);
/*    */           }
/*    */         }
/* 67 */         throw new Exception(throwable);
/*    */       }
/*    */     });
/* 72 */     return new FutureImplJavaUtilConcurrent(future);
/*    */   }
/*    */ }
/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/jboss-embedded-all.jar
 * Qualified Name:     org.jboss.aspects.asynch.ThreadPoolExecutor
 * JD-Core Version:    0.6.0
 */
New to GrepCode? Check out our FAQ X