org.geotools.process
Class ThreadPoolProcessExecutor

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by java.util.concurrent.ThreadPoolExecutor
          extended by org.geotools.process.ThreadPoolProcessExecutor
All Implemented Interfaces:
java.util.concurrent.Executor, java.util.concurrent.ExecutorService, ProcessExecutor

public class ThreadPoolProcessExecutor
extends java.util.concurrent.ThreadPoolExecutor
implements ProcessExecutor


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
 
Constructor Summary
ThreadPoolProcessExecutor(int nThreads, java.util.concurrent.ThreadFactory threadFactory)
           
 
Method Summary
 Progress submit(Process task, java.util.Map<java.lang.String,java.lang.Object> input)
          Submits a process for execution and returns a Progress representing the pending results of the task.
 
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated
 
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
 
Methods inherited from interface java.util.concurrent.Executor
execute
 

Constructor Detail

ThreadPoolProcessExecutor

public ThreadPoolProcessExecutor(int nThreads,
                                 java.util.concurrent.ThreadFactory threadFactory)
Method Detail

submit

public Progress submit(Process task,
                       java.util.Map<java.lang.String,java.lang.Object> input)
Description copied from interface: ProcessExecutor
Submits a process for execution and returns a Progress representing the pending results of the task.

If you would like to immediately block waiting for a task, you can use constructions of the form result = exec.submit(aProcess).get();

Note: The Processors class includes a set of methods that can convert some other common closure-like objects, for example, Callable to Process form so they can be submitted.

Specified by:
submit in interface ProcessExecutor
Parameters:
task - the task to submit
Returns:
a Progress representing pending completion of the task


Copyright © 1996-2010 Geotools. All Rights Reserved.