提交 6b056fa0 编写于 作者: W wolfgarnet

Added callable wrapper to actAsync

上级 020e46b2
......@@ -913,8 +913,17 @@ public final class FilePath implements Serializable {
*/
public <T> Future<T> actAsync(final FileCallable<T> callable) throws IOException, InterruptedException {
try {
DelegatingCallable<T,IOException> wrapper = new FileCallableWrapper<T>(callable);
Jenkins instance = Jenkins.getInstance();
if (instance != null) { // this happens during unit tests
ExtensionList<FileCallableWrapperFactory> factories = instance.getExtensionList(FileCallableWrapperFactory.class);
for (FileCallableWrapperFactory factory : factories) {
wrapper = factory.wrap(wrapper);
}
}
return (channel!=null ? channel : Jenkins.MasterComputer.localChannel)
.callAsync(new FileCallableWrapper<T>(callable));
.callAsync(wrapper);
} catch (IOException e) {
// wrap it into a new IOException so that we get the caller's stack trace as well.
throw new IOException2("remote file operation failed",e);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册