play.jobs
类 Job<V>

java.lang.Object
  继承者 play.Invoker.Invocation
      继承者 play.jobs.Job<V>
类型参数:
V - The job result type (if any)
所有已实现的接口:
java.lang.Runnable, java.util.concurrent.Callable<V>

public class Job<V>
extends Invoker.Invocation
implements java.util.concurrent.Callable<V>

A job is an asynchronously executed unit of work


字段摘要
protected  java.util.concurrent.ExecutorService executor
           
static java.lang.String invocationType
           
protected  java.lang.Throwable lastException
           
protected  long lastRun
           
protected  boolean wasError
           
 
构造方法摘要
Job()
           
 
方法摘要
 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
 Invoker.InvocationContext getInvocationContext()
           
 F.Promise<V> in(int seconds)
          Start this job in several seconds
 F.Promise<V> in(java.lang.String delay)
          Start this job in several seconds
 F.Promise<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()
           
 
从类 play.Invoker.Invocation 继承的方法
after, before, init, onSuccess, preInit, suspend
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

invocationType

public static final java.lang.String invocationType
另请参见:
常量字段值

executor

protected java.util.concurrent.ExecutorService executor

lastRun

protected long lastRun

wasError

protected boolean wasError

lastException

protected java.lang.Throwable lastException
构造方法详细信息

Job

public Job()
方法详细信息

getInvocationContext

public Invoker.InvocationContext getInvocationContext()
指定者:
Invoker.Invocation 中的 getInvocationContext

doJob

public void doJob()
           throws java.lang.Exception
Here you do the job

抛出:
java.lang.Exception

doJobWithResult

public V doJobWithResult()
                  throws java.lang.Exception
Here you do the job and return a result

抛出:
java.lang.Exception

execute

public void execute()
             throws java.lang.Exception
从类 Invoker.Invocation 复制的描述
Override this method

指定者:
Invoker.Invocation 中的 execute
抛出:
java.lang.Exception

now

public F.Promise<V> now()
Start this job now (well ASAP)

返回:
the job completion

in

public F.Promise<V> in(java.lang.String delay)
Start this job in several seconds

返回:
the job completion

in

public F.Promise<V> in(int seconds)
Start this job in several seconds

返回:
the job completion

every

public void every(java.lang.String delay)
Run this job every n seconds


every

public void every(int seconds)
Run this job every n seconds


onException

public void onException(java.lang.Throwable e)
从类 Invoker.Invocation 复制的描述
Things to do if the Invocation code thrown an exception

覆盖:
Invoker.Invocation 中的 onException

run

public void run()
从类 Invoker.Invocation 复制的描述
It's time to execute.

指定者:
接口 java.lang.Runnable 中的 run
覆盖:
Invoker.Invocation 中的 run

call

public V call()
指定者:
接口 java.util.concurrent.Callable<V> 中的 call

_finally

public void _finally()
从类 Invoker.Invocation 复制的描述
Things to do in all cases after the invocation.

覆盖:
Invoker.Invocation 中的 _finally

toString

public java.lang.String toString()
覆盖:
java.lang.Object 中的 toString


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly