Package org.jboss.weld.executor
Class CommonForkJoinPoolExecutorServices
- java.lang.Object
-
- org.jboss.weld.executor.AbstractExecutorServices
-
- org.jboss.weld.executor.CommonForkJoinPoolExecutorServices
-
- All Implemented Interfaces:
org.jboss.weld.bootstrap.api.Service
,org.jboss.weld.manager.api.ExecutorServices
public class CommonForkJoinPoolExecutorServices extends AbstractExecutorServices
Wrapper forForkJoinPool.commonPool()
. ThisExecutorService
implementation ignores threadPoolSize and threadPoolKeepAliveTime configuration options.- Author:
- Jozef Hartinger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.weld.manager.api.ExecutorServices
org.jboss.weld.manager.api.ExecutorServices.TaskFactory<T extends Object>
-
-
Constructor Summary
Constructors Constructor Description CommonForkJoinPoolExecutorServices()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanup()
ExecutorService
getTaskExecutor()
protected int
getThreadPoolSize()
Indicates the maximum number of threads in this thread pool.<T> Collection<? extends Callable<T>>
wrap(Collection<? extends Callable<T>> tasks)
If in SE environment, this method wraps the collection of tasks in such a way that it sets the TCCL to null before executing them and re-sets it to previous value once done.-
Methods inherited from class org.jboss.weld.executor.AbstractExecutorServices
checkForExceptions, getTimerExecutor, invokeAllAndCheckForExceptions, invokeAllAndCheckForExceptions, shutdown
-
-
-
-
Method Detail
-
getTaskExecutor
public ExecutorService getTaskExecutor()
-
cleanup
public void cleanup()
- Specified by:
cleanup
in interfaceorg.jboss.weld.bootstrap.api.Service
- Overrides:
cleanup
in classAbstractExecutorServices
-
getThreadPoolSize
protected int getThreadPoolSize()
Description copied from class:AbstractExecutorServices
Indicates the maximum number of threads in this thread pool. If the value is unknown or if the max number of threads is not bounded this method should return -1- Specified by:
getThreadPoolSize
in classAbstractExecutorServices
-
wrap
public <T> Collection<? extends Callable<T>> wrap(Collection<? extends Callable<T>> tasks)
If in SE environment, this method wraps the collection of tasks in such a way that it sets the TCCL to null before executing them and re-sets it to previous value once done. This affect the CL Weld will pick up when invokingorg.jboss.weld.environment.deployment.WeldResourceLoader#getClassLoader()
.- Overrides:
wrap
in classAbstractExecutorServices
-
-