public class WorkflowExecutorService<E extends ExecutorService>
extends org.apache.hadoop.service.AbstractService
ExecutorService.shutdownNow() is invoked.| Constructor and Description |
|---|
WorkflowExecutorService(String name)
Construct an instance with the given name -but
no executor
|
WorkflowExecutorService(String name,
E executor)
Construct an instance with the given name and executor
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Runnable runnable)
Execute the runnable with the executor (which
must have been created already)
|
E |
getExecutor()
Get the executor
|
protected void |
serviceStop()
Stop the service: halt the executor.
|
void |
setExecutor(E executor)
Set the executor.
|
protected void |
stopExecutor()
Stop the executor if it is not null.
|
<V> Future<V> |
submit(Callable<V> callable)
Submit a callable
|
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, serviceStart, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStoppublic WorkflowExecutorService(String name)
name - service namepublic E getExecutor()
public void setExecutor(E executor)
executor - executorpublic void execute(Runnable runnable)
runnable - runnable to executepublic <V> Future<V> submit(Callable<V> callable)
V - type of the final getcallable - callableprotected void serviceStop()
throws Exception
serviceStop in class org.apache.hadoop.service.AbstractServiceException - exception.protected void stopExecutor()
ExecutorService.shutdownNow()
and so does not block until they have completed.Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.