com.path.android.jobqueue.executor
Class JobConsumerExecutor

java.lang.Object
  extended by com.path.android.jobqueue.executor.JobConsumerExecutor

public class JobConsumerExecutor
extends java.lang.Object

An executor class that takes care of spinning consumer threads and making sure enough is alive. works deeply coupled with JobManager


Nested Class Summary
static interface JobConsumerExecutor.Contract
          contract between the JobManager and JobConsumerExecutor
 
Constructor Summary
JobConsumerExecutor(Configuration config, JobConsumerExecutor.Contract contract)
           
 
Method Summary
 void considerAddingConsumer()
          creates a new consumer thread if needed.
 boolean isRunning(long id, boolean persistent)
          returns true if job is currently handled by one of the executor threads
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobConsumerExecutor

public JobConsumerExecutor(Configuration config,
                           JobConsumerExecutor.Contract contract)
Method Detail

considerAddingConsumer

public void considerAddingConsumer()
creates a new consumer thread if needed.


isRunning

public boolean isRunning(long id,
                         boolean persistent)
returns true if job is currently handled by one of the executor threads

Parameters:
id - id of the job
persistent - boolean flag to distinguish id conflicts
Returns:
true if job is currently handled here