FileDocCategorySizeDatePackage
ThreadPoolExecutor.javaAPI DocJBoss 4.2.12470Fri Jul 13 21:02:36 BST 2007org.jboss.aspects.asynch

ThreadPoolExecutor

public class ThreadPoolExecutor extends Object implements ExecutorAbstraction
Comment
author
Bill Burke
version
$Revision: 57186 $

Fields Summary
private static ExecutorService
executor
Constructors Summary
Methods Summary
public RemotableFutureexecute(org.jboss.aop.joinpoint.MethodInvocation invocation)

      final MethodInvocation copy = (MethodInvocation) invocation.copy();
      final ClassLoader cl = Thread.currentThread().getContextClassLoader();
      
      java.util.concurrent.Future future = executor.submit(new Callable()
      {
         public Object call() throws Exception
         {
            try
            {
               Thread.currentThread().setContextClassLoader(cl);
               return copy.invokeNext();
            }
            catch (Throwable throwable)
            {
               if (throwable instanceof Exception)
               {
                  throw ((Exception) throwable);
               }
               else
                  throw new Exception(throwable);
            }
         }
      });

      return new FutureImplJavaUtilConcurrent(future);
   
public voidsetAdvisor(org.jboss.aop.Advisor advisor)