本文整理了Java中hudson.remoting.Channel.getJarCache()
方法的一些代码示例,展示了Channel.getJarCache()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Channel.getJarCache()
方法的具体详情如下:
包路径:hudson.remoting.Channel
类名称:Channel
方法名:getJarCache
[英]If this channel is built with jar file caching, return the object that manages this cache.
[中]如果此通道是使用jar文件缓存构建的,则返回管理此缓存的对象。
代码示例来源:origin: jenkinsci/remoting
Future<URL> _resolveJarURL(Channel channel) throws IOException, InterruptedException {
JarCache c = channel.getJarCache();
if (c == null) {
throw new IOException(String.format("Failed to resolve a jar %016x%016x. JAR Cache is disabled for the channel %s",
sum1, sum2, channel.getName()));
}
return c.resolve(channel, sum1, sum2);
// throw (IOException)new IOException(String.format("Failed to resolve a jar %016x%016x",sum1,sum2)).initCause(e);
}
代码示例来源:origin: jenkinsci/remoting
/**
* Starts JAR retrieval over the channel.
*
* @param channel Channel instance
* @return Future object. In the case of error the diagnostics info will be sent to {@link #LOGGER}.
*/
@Nonnull
private Future<URL> initiateJarRetrieval(@Nonnull Channel channel) throws IOException, InterruptedException {
JarCache c = channel.getJarCache();
if (c == null) {
throw new IOException("Failed to initiate retrieval. JAR Cache is disabled for the channel " + channel.getName());
}
try {
return c.resolve(channel, sum1, sum2);
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Failed to initiate retrieval", e);
throw e;
} catch (InterruptedException e) {
LOGGER.log(Level.WARNING, "Failed to initiate retrieval", e);
Thread.currentThread().interrupt(); // process the interrupt later
throw e;
}
}
代码示例来源:origin: jenkinsci/remoting
private RemoteClassLoader(@CheckForNull ClassLoader parent, @Nonnull IClassLoader proxy) {
super(new URL[0],parent);
final Channel channel = RemoteInvocationHandler.unwrap(proxy);
this.channel = channel == null ? null : channel.ref();
this.underlyingProxy = proxy;
if (channel == null || !channel.remoteCapability.supportsPrefetch() || channel.getJarCache()==null) {
proxy = new DumbClassLoaderBridge(proxy);
}
this.proxy = proxy;
}
代码示例来源:origin: jenkinsci/remoting
public Void call() throws IOException {
try {
final Channel ch = Channel.currentOrFail();
final JarCache jarCache = ch.getJarCache();
if (jarCache == null) {
throw new IOException("Cannot Force JAR load, JAR cache is disabled");
}
jarCache.resolve(ch,sum1,sum2).get();
return null;
} catch (InterruptedException e) {
throw new IOException(e);
} catch (ExecutionException e) {
throw new IOException(e);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!