hudson.Plugin.load()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(88)

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

Plugin.load介绍

[英]Loads serializable fields of this instance from the persisted storage.

If there was no previously persisted state, this method is no-op.
[中]从持久化存储中加载此实例的可序列化字段。
如果之前没有持久化状态,则此方法为no-op。

代码示例

代码示例来源:origin: org.jenkins-ci.plugins/global-build-stats

/**
 * Highered visibility of load method
 */
public void load() throws IOException {
  super.load();
}

代码示例来源:origin: jenkinsci/gerrit-trigger-plugin

@Override
public void load() throws IOException {
  super.load();
  if (pluginConfig == null) {
    PluginConfig conf = new PluginConfig();
    if (config != null) {
      conf.setNumberOfReceivingWorkerThreads(config.getNumberOfReceivingWorkerThreads());
      conf.setNumberOfSendingWorkerThreads(config.getNumberOfSendingWorkerThreads());
    }
    pluginConfig = conf;
  }
  if (servers.isEmpty()) {
    if (config != null) { //have loaded data in old format, so add a new server with the old config to the list.
      GerritServer defaultServer = new GerritServer(DEFAULT_SERVER_NAME);
      defaultServer.setConfig(config);
      servers.add(defaultServer);
    }
    save();
  }
  //For unit/integration testing only...
  if (System.getProperty(TEST_SSH_KEYFILE_LOCATION_PROPERTY) != null && !servers.isEmpty()) {
    File location = new File(System.getProperty(TEST_SSH_KEYFILE_LOCATION_PROPERTY));
    for (GerritServer server : servers) {
      ((Config)server.getConfig()).setGerritAuthKeyFile(location);
    }
  }
}

相关文章