com.ning.http.client.listenable
Class ExecutionList

java.lang.Object
  extended by com.ning.http.client.listenable.ExecutionList
All Implemented Interfaces:
Runnable

public final class ExecutionList
extends Object
implements Runnable

A list of (Runnable, Executor) pairs that guarantees that every Runnable that is added using the add method will be executed in its associated Executor after run() is called. Runnables added after run is called are still guaranteed to execute.

Since:
1
Author:
Nishant Thakkar, Sven Mawson

Constructor Summary
ExecutionList()
           
 
Method Summary
 void add(Runnable runnable, Executor executor)
          Add the runnable/executor pair to the list of pairs to execute.
 void run()
          Runs this execution list, executing all pairs in the order they were added.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutionList

public ExecutionList()
Method Detail

add

public void add(Runnable runnable,
                Executor executor)
Add the runnable/executor pair to the list of pairs to execute. Executes the pair immediately if we've already started execution.


run

public void run()
Runs this execution list, executing all pairs in the order they were added. Pairs added after this method has started executing the list will be executed immediately.

Specified by:
run in interface Runnable


Copyright © 2011. All Rights Reserved.