net.commerce.zocalo.freechart
Class ChartScheduler

java.lang.Object
  extended by net.commerce.zocalo.freechart.ChartScheduler

public class ChartScheduler
extends java.lang.Object

Schedule a task like generating a price history graph. Multiple requests may come in sporadically. We want to ensure that only one is being processed at a time. If we're busy processing when a request comes in, we'll remember to start another when this one is done. Multiple requests that come in while processing will spur a single restart.


Method Summary
static ChartScheduler create(java.lang.String name, java.util.concurrent.Callable<java.lang.Boolean> worker)
           
static ChartScheduler find(java.lang.String name)
           
 boolean generateNewChart()
           
 boolean isBusy()
           
 java.util.Date lastFinish()
           
 int runs()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static ChartScheduler create(java.lang.String name,
                                    java.util.concurrent.Callable<java.lang.Boolean> worker)

find

public static ChartScheduler find(java.lang.String name)

generateNewChart

public boolean generateNewChart()

isBusy

public boolean isBusy()

lastFinish

public java.util.Date lastFinish()

runs

public int runs()