package io.trygvis.queue; import org.quartz.*; import java.util.*; public interface AsyncService { JpaAsyncService.JpaQueueRef registerQueue(String name, int interval, AsyncCallable callable) throws SchedulerException; QueueRef getQueue(String name); ExecutionRef schedule(QueueRef queue, String... args); ExecutionRef update(ExecutionRef ref); interface QueueRef { } interface ExecutionRef { List getArguments(); Date getScheduled(); Date getLastRun(); Date getCompleted(); boolean isDone(); } interface AsyncCallable { void run() throws Exception; } }