com.atlassian.util.concurrent
Interface ExecutorSubmitter

All Superinterfaces:
Executor

public interface ExecutorSubmitter
extends Executor

Adds the ExecutorService job submission methods without exposing the life-cycle management API. Is tweaked to return promises rather than anemic futures.

Since:
2.6.2

Method Summary
<T> Promise<T>
submit(Callable<T> task)
          Submits a value-returning task for execution and returns a Promise representing the pending results of the task.
<T> Promise<T>
submit(Supplier<T> task)
          Submits a value-returning task for execution and returns a Promise representing the pending results of the task.
 
Methods inherited from interface java.util.concurrent.Executor
execute
 

Method Detail

submit

<T> Promise<T> submit(Callable<T> task)
Submits a value-returning task for execution and returns a Promise representing the pending results of the task.

Parameters:
task - the task to submit
Returns:
a Promise representing pending completion of the task
Throws:
RejectedExecutionException - if the task cannot be scheduled for execution
NullPointerException - if the task is null

submit

<T> Promise<T> submit(Supplier<T> task)
Submits a value-returning task for execution and returns a Promise representing the pending results of the task.

Parameters:
task - the task to submit
Returns:
a Promise representing pending completion of the task
Throws:
RejectedExecutionException - if the task cannot be scheduled for execution
NullPointerException - if the task is null


Copyright © 2014 Atlassian. All Rights Reserved.