Made executorCell.jelly customizable per Executable.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@34620 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2010-09-09 22:30:15 +00:00
1 parent 27cb0e90b6
commit 3cf4b8f18a
6 files changed
+89 -22

No files matched your search

@@ -1126,6 +1126,11 @@ public class Queue extends ResourceController implements Saveable {
/**
* Represents the real meet of the computation run by {@link Executor}.
*
* <h2>Views</h2>
* <p>
* Implementation must have <tt>executorCell.jelly</tt>, which is
* used to render the HTML that indicates this executable is executing.
*/
public interface Executable extends Runnable {
/**
@@ -53,17 +53,8 @@ public class WideJobProperty extends JobProperty<AbstractProject<?,?>> {
List<SubTask> r = new ArrayList<SubTask>();
for (int i=1; i< weight; i++)
r.add(new AbstractSubTask() {
private final AbstractSubTask outerThis = this;
public Executable createExecutable() throws IOException {
return new Executable() {
public SubTask getParent() {
return outerThis;
}
public void run() {
// nothing. we just waste time
}
};
return new ExecutableImpl(this);
}
@Override
@@ -99,4 +90,20 @@ public class WideJobProperty extends JobProperty<AbstractProject<?,?>> {
return "This project occupies multiple executors";
}
}
private static class ExecutableImpl implements Executable {
private final SubTask parent;
private ExecutableImpl(SubTask parent) {
this.parent = parent;
}
public SubTask getParent() {
return parent;
}
public void run() {
// nothing. we just waste time
}
}
}