cascading.management
Class UnitOfWorkExecutorStrategy

java.lang.Object
  extended by cascading.management.UnitOfWorkExecutorStrategy
All Implemented Interfaces:
UnitOfWorkSpawnStrategy

public class UnitOfWorkExecutorStrategy
extends java.lang.Object
implements UnitOfWorkSpawnStrategy

Class UnitOfWorkExecutorStrategy uses a simple Executors.newFixedThreadPool(int) ExecutorService to spawn threads.

This is the default spawn strategy.


Constructor Summary
UnitOfWorkExecutorStrategy()
           
 
Method Summary
 void complete(UnitOfWork unitOfWork, int duration, java.util.concurrent.TimeUnit unit)
           
 boolean isCompleted(UnitOfWork unitOfWork)
           
 java.util.List<java.util.concurrent.Future<java.lang.Throwable>> start(UnitOfWork unitOfWork, int maxConcurrentThreads, java.util.Collection<java.util.concurrent.Callable<java.lang.Throwable>> values)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnitOfWorkExecutorStrategy

public UnitOfWorkExecutorStrategy()
Method Detail

start

public java.util.List<java.util.concurrent.Future<java.lang.Throwable>> start(UnitOfWork unitOfWork,
                                                                              int maxConcurrentThreads,
                                                                              java.util.Collection<java.util.concurrent.Callable<java.lang.Throwable>> values)
                                                                       throws java.lang.InterruptedException
Specified by:
start in interface UnitOfWorkSpawnStrategy
Throws:
java.lang.InterruptedException

isCompleted

public boolean isCompleted(UnitOfWork unitOfWork)
Specified by:
isCompleted in interface UnitOfWorkSpawnStrategy

complete

public void complete(UnitOfWork unitOfWork,
                     int duration,
                     java.util.concurrent.TimeUnit unit)
              throws java.lang.InterruptedException
Specified by:
complete in interface UnitOfWorkSpawnStrategy
Throws:
java.lang.InterruptedException


Copyright © 2007-2011 Concurrent, Inc. All Rights Reserved.