org.jvnet.hk2.component.concurrent
Class WorkManager

java.lang.Object
  extended by org.jvnet.hk2.component.concurrent.WorkManager
All Implemented Interfaces:
Executor

Deprecated.

@Deprecated
public class WorkManager
extends Object
implements Executor

Simple helper for managing work sent to a foreign executor service.

Has similarities to Fork and Join.

The implementation is designed such that Tasks-1 are sent to the executor service for possibly another thread to handle. The last task is executed by the caller thread so that all threads are attempted to be fully utilized for processing including the caller's thread.

Author:
Jeff Trent

Nested Class Summary
static class WorkManager.ExecutionException
          Deprecated.  
 
Constructor Summary
WorkManager(Executor exec)
          Deprecated.  
WorkManager(Executor exec, int tasksToDo)
          Deprecated.  
 
Method Summary
 void awaitCompletion()
          Deprecated.  
 void awaitCompletion(long timeout, TimeUnit unit)
          Deprecated.  
protected  void completed(org.jvnet.hk2.component.concurrent.WorkManager.Watcher<?> watcher, Exception e)
          Deprecated.  
 void execute(Runnable task)
          Deprecated.  
 void executeAll(Collection<Runnable> tasks)
          Deprecated.  
 int getWorkInProgressCount()
          Deprecated.  
<V> Future<V>
submit(Callable<V> task)
          Deprecated.  
<V> Collection<Future<V>>
submitAll(Collection<Callable<V>> tasks)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkManager

public WorkManager(Executor exec)
Deprecated. 

WorkManager

public WorkManager(Executor exec,
                   int tasksToDo)
Deprecated. 
Method Detail

getWorkInProgressCount

public int getWorkInProgressCount()
Deprecated. 

awaitCompletion

public void awaitCompletion()
Deprecated. 

awaitCompletion

public void awaitCompletion(long timeout,
                            TimeUnit unit)
                     throws TimeoutException
Deprecated. 
Throws:
TimeoutException

completed

protected void completed(org.jvnet.hk2.component.concurrent.WorkManager.Watcher<?> watcher,
                         Exception e)
Deprecated. 

submitAll

public <V> Collection<Future<V>> submitAll(Collection<Callable<V>> tasks)
Deprecated. 

executeAll

public void executeAll(Collection<Runnable> tasks)
Deprecated. 

submit

public <V> Future<V> submit(Callable<V> task)
Deprecated. 

execute

public void execute(Runnable task)
Deprecated. 
Specified by:
execute in interface Executor


Copyright © 2013 Oracle Corporation. All Rights Reserved.