|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
hudson.model.Executor
@ExportedBean public class Executor
Thread that executes builds.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected Computer |
owner
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
Executor(Computer owner,
int n)
|
|
| Method Summary | ||
|---|---|---|
Result |
abortResult()
|
|
static Executor |
currentExecutor()
Returns the executor of the current thread or null if current thread is not an executor. |
|
org.kohsuke.stapler.HttpResponse |
doStop()
Stops the current build. |
|
void |
doStop(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Deprecated. as of 1.489 Use doStop(). |
|
org.kohsuke.stapler.HttpResponse |
doYank()
Throws away this executor and get a new one. |
|
Api |
getApi()
Exposes the executor to the remote API. |
|
Throwable |
getCauseOfDeath()
If this thread dies unexpectedly, obtain the cause of the failure. |
|
Queue.Executable |
getCurrentExecutable()
Returns the current Queue.Task this executor is running. |
|
FilePath |
getCurrentWorkspace()
If current executable is AbstractBuild,
return the workspace that this executor is using, or null if the build hasn't gotten
to that point yet. |
|
WorkUnit |
getCurrentWorkUnit()
Returns the current WorkUnit (of the current executable)
that this executor is running. |
|
String |
getDisplayName()
Same as Thread.getName(). |
|
long |
getElapsedTime()
|
|
static long |
getEstimatedDurationFor(Queue.Executable e)
Deprecated. as of 1.388 Use Executables#getEstimatedDurationFor(Executable) |
|
String |
getEstimatedRemainingTime()
Computes a human-readable text that shows the expected remaining time until the build completes. |
|
long |
getEstimatedRemainingTimeMillis()
The same as getEstimatedRemainingTime() but return
it as a number of milli-seconds. |
|
long |
getIdleStartMilliseconds()
Returns when this executor started or should start being idle. |
|
int |
getNumber()
Gets the executor number that uniquely identifies it among other Executors for the same computer. |
|
Computer |
getOwner()
|
|
int |
getProgress()
Returns the progress of the current build in the number between 0-100. |
|
long |
getTimeSpentInQueue()
Returns the number of milli-seconds the currently executing job spent in the queue waiting for an available executor. |
|
String |
getTimestampString()
Gets the string that says how long since this build has started. |
|
protected WorkUnit |
grabJob()
|
|
boolean |
hasStopPermission()
Checks if the current user has a permission to stop this build. |
|
void |
interrupt()
|
|
void |
interrupt(Result result)
Interrupt the execution, but instead of marking the build as aborted, mark it as specified result. |
|
void |
interrupt(Result result,
CauseOfInterruption... causes)
Interrupt the execution. |
|
boolean |
isBusy()
The opposite of isIdle() — the executor is doing some work. |
|
boolean |
isIdle()
Returns true if this Executor is ready for action. |
|
boolean |
isLikelyStuck()
Returns true if the current build is likely stuck. |
|
void |
killHard()
For testing only. |
|
|
newImpersonatingProxy(Class<T> type,
T core)
Creates a proxy object that executes the callee in the context that impersonates this executor. |
|
void |
recordCauseOfInterruption(Run<?,?> build,
TaskListener listener)
report cause of interruption and record it to the build, if available. |
|
void |
run()
|
|
protected boolean |
shouldRun()
Returns true if we should keep going. |
|
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final Computer owner
| Constructor Detail |
|---|
public Executor(Computer owner,
int n)
| Method Detail |
|---|
public void interrupt()
interrupt in class Threadpublic void interrupt(Result result)
public void interrupt(Result result,
CauseOfInterruption... causes)
public Result abortResult()
public void recordCauseOfInterruption(Run<?,?> build,
TaskListener listener)
public void run()
run in interface Runnablerun in class Threadpublic void killHard()
protected boolean shouldRun()
protected WorkUnit grabJob()
throws InterruptedException
InterruptedException@Exported public Queue.Executable getCurrentExecutable()
Queue.Task this executor is running.
@Exported public WorkUnit getCurrentWorkUnit()
WorkUnit (of the current executable)
that this executor is running.
public FilePath getCurrentWorkspace()
AbstractBuild,
return the workspace that this executor is using, or null if the build hasn't gotten
to that point yet.
public String getDisplayName()
Thread.getName().
getDisplayName in interface ModelObject@Exported public int getNumber()
Executors for the same computer.
@Exported public boolean isIdle()
Executor is ready for action.
public boolean isBusy()
isIdle() — the executor is doing some work.
public Throwable getCauseOfDeath()
still alive.@Exported public int getProgress()
@Exported public boolean isLikelyStuck()
This is a heuristics based approach, but if the build is suspiciously taking for a long time, this method returns true.
public long getElapsedTime()
public long getTimeSpentInQueue()
public String getTimestampString()
public String getEstimatedRemainingTime()
public long getEstimatedRemainingTimeMillis()
getEstimatedRemainingTime() but return
it as a number of milli-seconds.
public void doStop(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
javax.servlet.ServletException
doStop().
IOException
javax.servlet.ServletExceptionpublic org.kohsuke.stapler.HttpResponse doStop()
public org.kohsuke.stapler.HttpResponse doYank()
public boolean hasStopPermission()
public Computer getOwner()
public long getIdleStartMilliseconds()
public Api getApi()
public <T> T newImpersonatingProxy(Class<T> type,
T core)
public static Executor currentExecutor()
public static long getEstimatedDurationFor(Queue.Executable e)
Executables#getEstimatedDurationFor(Executable)
AbstractMethodErrors if the Queue.Executable implementation
was compiled against Hudson < 1.383
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||