hudson.remoting.Channel.getJarCache()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(292)

本文整理了Java中hudson.remoting.Channel.getJarCache()方法的一些代码示例,展示了Channel.getJarCache()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Channel.getJarCache()方法的具体详情如下:
包路径:hudson.remoting.Channel
类名称:Channel
方法名:getJarCache

Channel.getJarCache介绍

[英]If this channel is built with jar file caching, return the object that manages this cache.
[中]如果此通道是使用jar文件缓存构建的,则返回管理此缓存的对象。

代码示例

代码示例来源:origin: jenkinsci/remoting

  1. Future<URL> _resolveJarURL(Channel channel) throws IOException, InterruptedException {
  2. JarCache c = channel.getJarCache();
  3. if (c == null) {
  4. throw new IOException(String.format("Failed to resolve a jar %016x%016x. JAR Cache is disabled for the channel %s",
  5. sum1, sum2, channel.getName()));
  6. }
  7. return c.resolve(channel, sum1, sum2);
  8. // throw (IOException)new IOException(String.format("Failed to resolve a jar %016x%016x",sum1,sum2)).initCause(e);
  9. }

代码示例来源:origin: jenkinsci/remoting

  1. /**
  2. * Starts JAR retrieval over the channel.
  3. *
  4. * @param channel Channel instance
  5. * @return Future object. In the case of error the diagnostics info will be sent to {@link #LOGGER}.
  6. */
  7. @Nonnull
  8. private Future<URL> initiateJarRetrieval(@Nonnull Channel channel) throws IOException, InterruptedException {
  9. JarCache c = channel.getJarCache();
  10. if (c == null) {
  11. throw new IOException("Failed to initiate retrieval. JAR Cache is disabled for the channel " + channel.getName());
  12. }
  13. try {
  14. return c.resolve(channel, sum1, sum2);
  15. } catch (IOException e) {
  16. LOGGER.log(Level.WARNING, "Failed to initiate retrieval", e);
  17. throw e;
  18. } catch (InterruptedException e) {
  19. LOGGER.log(Level.WARNING, "Failed to initiate retrieval", e);
  20. Thread.currentThread().interrupt(); // process the interrupt later
  21. throw e;
  22. }
  23. }

代码示例来源:origin: jenkinsci/remoting

  1. private RemoteClassLoader(@CheckForNull ClassLoader parent, @Nonnull IClassLoader proxy) {
  2. super(new URL[0],parent);
  3. final Channel channel = RemoteInvocationHandler.unwrap(proxy);
  4. this.channel = channel == null ? null : channel.ref();
  5. this.underlyingProxy = proxy;
  6. if (channel == null || !channel.remoteCapability.supportsPrefetch() || channel.getJarCache()==null) {
  7. proxy = new DumbClassLoaderBridge(proxy);
  8. }
  9. this.proxy = proxy;
  10. }

代码示例来源:origin: jenkinsci/remoting

  1. public Void call() throws IOException {
  2. try {
  3. final Channel ch = Channel.currentOrFail();
  4. final JarCache jarCache = ch.getJarCache();
  5. if (jarCache == null) {
  6. throw new IOException("Cannot Force JAR load, JAR cache is disabled");
  7. }
  8. jarCache.resolve(ch,sum1,sum2).get();
  9. return null;
  10. } catch (InterruptedException e) {
  11. throw new IOException(e);
  12. } catch (ExecutionException e) {
  13. throw new IOException(e);
  14. }
  15. }
  16. }

相关文章