|
||||||||||
| 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 java.util.concurrent.ExecutorService |
executor
|
protected java.lang.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(java.lang.String delay)
Run this job every n seconds |
void |
execute()
Override this method |
java.util.concurrent.Future |
in(int seconds)
Start this job in several seconds |
java.util.concurrent.Future<V> |
in(java.lang.String delay)
Start this job in several seconds |
java.util.concurrent.Future<V> |
now()
Start this job now (well ASAP) |
void |
onException(java.lang.Throwable e)
Things to do if the Invocation code thrown an exception |
void |
run()
It's time to execute. |
java.lang.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 java.util.concurrent.ExecutorService executor
protected long lastRun
protected boolean wasError
protected java.lang.Throwable lastException
| Constructor Detail |
|---|
public Job()
| Method Detail |
|---|
public void doJob()
throws java.lang.Exception
java.lang.Exception
public V doJobWithResult()
throws java.lang.Exception
java.lang.Exception
public void execute()
throws java.lang.Exception
Invoker.Invocation
execute in class Invoker.Invocationjava.lang.Exceptionpublic java.util.concurrent.Future<V> now()
public java.util.concurrent.Future<V> in(java.lang.String delay)
public java.util.concurrent.Future in(int seconds)
public void every(java.lang.String delay)
public void every(int seconds)
public void onException(java.lang.Throwable e)
Invoker.Invocation
onException in class Invoker.Invocationpublic void run()
Invoker.Invocation
run in interface java.lang.Runnablerun in class Invoker.Invocationpublic V call()
call in interface java.util.concurrent.Callable<V>public void _finally()
Invoker.Invocation
_finally in class Invoker.Invocationpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||