|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectplay.Invoker.Invocation
play.jobs.Job<V>
V - The job result type (if any)public class Job<V>
A job is an asynchronously executed unit of work
| Field Summary | |
|---|---|
protected ExecutorService |
executor
|
protected Throwable |
lastException
|
protected long |
lastRun
|
protected boolean |
wasError
|
| Constructor Summary | |
|---|---|
Job()
|
|
| Method Summary | |
|---|---|
void |
_finally()
Things to do in all cases after the invocation. |
V |
call()
|
void |
doJob()
Here you do the job |
V |
doJobWithResult()
Here you do the job and return a result |
void |
every(int seconds)
Run this job every n seconds |
void |
every(String delay)
Run this job every n seconds |
void |
execute()
Override this method |
Future<V> |
in(int seconds)
Start this job in several seconds |
Future<V> |
in(String delay)
Start this job in several seconds |
Future<V> |
now()
Start this job now (well ASAP) |
void |
onException(Throwable e)
Things to do if the Invocation code thrown an exception |
void |
run()
It's time to execute. |
String |
toString()
|
| Methods inherited from class play.Invoker.Invocation |
|---|
after, before, init, suspend |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected ExecutorService executor
protected long lastRun
protected boolean wasError
protected Throwable lastException
| Constructor Detail |
|---|
public Job()
| Method Detail |
|---|
public void doJob()
throws Exception
Exception
public V doJobWithResult()
throws Exception
Exception
public void execute()
throws Exception
Invoker.Invocation
execute in class Invoker.InvocationExceptionpublic Future<V> now()
public Future<V> in(String delay)
public Future<V> in(int seconds)
public void every(String delay)
public void every(int seconds)
public void onException(Throwable e)
Invoker.Invocation
onException in class Invoker.Invocationpublic void run()
Invoker.Invocation
run in interface Runnablerun in class Invoker.Invocationpublic V call()
call in interface Callable<V>public void _finally()
Invoker.Invocation
_finally in class Invoker.Invocationpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||