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

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

本文整理了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

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);
    }
  }
}

相关文章