|
org.codehaus.gpars | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectgroovyx.gpars.GParsExecutorsPoolEnhancer
class GParsExecutorsPoolEnhancer
GParsExecutorsPoolEnhancer allows classes or instances to be enhanced with asynchronous 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 an ExecutorService. The pool itself is stored in a final property threadPool and can be managed through static methods on the GParsExecutorsPoolEnhancer class. All enhanced classes and instances will share the underlying pool.
Property Summary | |
---|---|
private static DefaultPool |
threadPool
Holds the internal ExecutorService instance wrapped into a DefaultPool |
Constructor Summary | |
GParsExecutorsPoolEnhancer()
|
Method Summary | |
---|---|
boolean
|
anyParallel(groovy.lang.Closure cl)
Performs the any() operation using an asynchronous variant of the supplied closure to evaluate each collection's/object's element. |
java.lang.Object
|
collectParallel(groovy.lang.Closure cl)
Iterates over a collection/object with the collect() method using an asynchronous variant of the supplied closure to evaluate each collection's element. |
java.lang.Object
|
eachParallel(groovy.lang.Closure cl)
Iterates over a collection/object with the each() method using an asynchronous variant of the supplied closure to evaluate each collection's element. |
java.lang.Object
|
eachWithIndexParallel(groovy.lang.Closure cl)
Iterates over a collection/object with the eachWithIndex() method using an asynchronous variant of the supplied closure to evaluate each collection's element. |
static void
|
enhanceClass(java.lang.Class clazz)
Enhances a class and so all instances created in the future by mixing-in an instance of GParsExecutorsPoolEnhancer. |
static void
|
enhanceInstance(java.lang.Object collection)
Enhances a single instance by mixing-in an instance of GParsExecutorsPoolEnhancer. |
boolean
|
everyParallel(groovy.lang.Closure cl)
Performs the all() operation using an asynchronous variant of the supplied closure to evaluate each collection's/object's element. |
java.lang.Object
|
findAllParallel(groovy.lang.Closure cl)
Performs the findAll() operation using an asynchronous variant of the supplied closure to evaluate each collection's/object's element. |
java.lang.Object
|
findParallel(groovy.lang.Closure cl)
Performs the find() operation using an asynchronous variant of the supplied closure to evaluate each collection's/object's element. |
Pool
|
getThreadPool()
Retrieves the underlying pool |
java.lang.Object
|
grepParallel(groovy.lang.Closure cl)
Performs the grep()() operation using an asynchronous variant of the supplied closure to evaluate each collection's/object's element. |
java.lang.Object
|
groupByParallel(groovy.lang.Closure cl)
Performs the groupBy() operation using an asynchronous variant of the supplied closure to evaluate each collection's/object's element. |
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 |
---|
@SuppressWarnings("GroovyConstantNamingConvention") private static final DefaultPool threadPool
Constructor Detail |
---|
GParsExecutorsPoolEnhancer()
Method Detail |
---|
public boolean anyParallel(groovy.lang.Closure cl)
public java.lang.Object collectParallel(groovy.lang.Closure cl)
public java.lang.Object eachParallel(groovy.lang.Closure cl)
public java.lang.Object eachWithIndexParallel(groovy.lang.Closure cl)
public static void enhanceClass(java.lang.Class clazz)
public static void enhanceInstance(java.lang.Object collection)
public boolean everyParallel(groovy.lang.Closure cl)
public java.lang.Object findAllParallel(groovy.lang.Closure cl)
public java.lang.Object findParallel(groovy.lang.Closure cl)
public Pool getThreadPool()
public java.lang.Object grepParallel(groovy.lang.Closure cl)
public java.lang.Object groupByParallel(groovy.lang.Closure cl)
Copyright © 2008–2010 Václav Pech. All Rights Reserved.