|
org.codehaus.gpars | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectgroovyx.gpars.ParallelEnhancer
class ParallelEnhancer
ParallelEnhancer allows classes or instances to be enhanced with parallel variants of iterative methods, like eachParallel(), collectParallel(), findAllParallel() and others. These operations split processing into multiple concurrently executable tasks and perform them on the underlying instance of the ForkJoinPool class from JSR-166y. The pool itself is stored in a final property threadPool and can be managed through static methods on the ParallelEnhancer class. All enhanced classes and instances will share the underlying pool. Use the getThreadPool() method to get hold of the thread pool.
Property Summary | |
---|---|
private static FJPool |
threadPool
Holds the internal ForkJoinPool instance wrapped into a FJPool |
Constructor Summary | |
ParallelEnhancer()
|
Method Summary | |
---|---|
static void
|
enhanceClass(java.lang.Class clazz)
Enhances a class and so all instances created in the future by mixing-in an instance of Parallel. |
static java.lang.Object
|
enhanceInstance(java.lang.Object collection)
Enhances a single instance by mixing-in an instance of Parallel. |
static Pool
|
getThreadPool()
Retrieves the underlying pool |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Property Detail |
---|
private static final FJPool threadPool
Constructor Detail |
---|
ParallelEnhancer()
Method Detail |
---|
public static void enhanceClass(java.lang.Class clazz)
public static java.lang.Object enhanceInstance(java.lang.Object collection)
public static Pool getThreadPool()
Copyright © 2008–2010 Václav Pech. All Rights Reserved.