提交 795b6732 编写于 作者: K kohsuke

added another convenience method.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5118 71c3de6d-444a-0410-be80-ed276b4c234a
上级 08babbd8
......@@ -5,6 +5,8 @@ import hudson.Functions;
import hudson.remoting.Callable;
import hudson.remoting.Channel;
import hudson.remoting.VirtualChannel;
import hudson.tasks.Publisher;
import hudson.tasks.BuildWrapper;
import hudson.util.DaemonThreadFactory;
import hudson.util.RunList;
import org.kohsuke.stapler.StaplerRequest;
......@@ -356,4 +358,13 @@ public abstract class Computer extends AbstractModelObject {
((Channel)getChannel()).dumpExportTable(w);
w.close();
}
/**
* Gets the current {@link Computer} that the build is running.
* This method only works when called during a build, such as by
* {@link Publisher}, {@link BuildWrapper}, etc.
*/
public static Computer currentComputer() {
return Executor.currentExecutor().getOwner();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册