org.xwiki.job
Interface Job

All Superinterfaces:
Runnable

@Role
@Unstable
public interface Job
extends Runnable

A Job produced from a Request and exposing a JobStatus.

Since:
4.0M1
Version:
$Id: fc77c751943fe55249ad2b415faf6619d725452e $

Method Summary
 Request getRequest()
           
 JobStatus getStatus()
           
 String getType()
           
 void initialize(Request request)
           
 void join()
          Causes the current thread to wait until this job has FINSHED state.
 boolean join(long time, TimeUnit unit)
          Causes the current thread to wait until this job has FINSHED state.
 void start(Request request)
          Deprecated. since 5.1M2 use initialize(Request) then Runnable.run() instead
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

getType

String getType()
Returns:
the type of the job

getStatus

JobStatus getStatus()
Returns:
the status of the job

getRequest

Request getRequest()
Returns:
the job request

start

@Deprecated
void start(Request request)
Deprecated. since 5.1M2 use initialize(Request) then Runnable.run() instead

Parameters:
request - start the job with provided request

initialize

void initialize(Request request)
Parameters:
request - configure the job
Since:
5.1M1

join

void join()
          throws InterruptedException
Causes the current thread to wait until this job has FINSHED state.

Throws:
InterruptedException - if any thread has interrupted the current thread. The interrupted status of the current thread is cleared when this exception is thrown.

join

boolean join(long time,
             TimeUnit unit)
             throws InterruptedException
Causes the current thread to wait until this job has FINSHED state.

Parameters:
time - the maximum time to wait
unit - the time unit of the time argument
Returns:
false if the waiting time detectably elapsed before return from the method, else true
Throws:
InterruptedException - if the current thread is interrupted (and interruption of thread suspension is supported)


Copyright © 2004–2013 XWiki. All rights reserved.