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

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

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

Plugin.start介绍

[英]Called to allow plugins to initialize themselves.

This method is called after #setServletContext(ServletContext) is invoked. You can also use Hudson#getInstance() to access the singleton hudson instance, although the plugin start up happens relatively early in the initialization stage and not all the data are loaded in Hudson.

If a plugin wants to run an initialization step after all plugins and extension points are registered, a good place to do that is #postInitialize(). If a plugin wants to run an initialization step after all the jobs are loaded, ItemListener#onLoaded() is a good place.
[中]调用以允许插件自行初始化。
调用#setServletContext(ServletContext)后调用此方法。您还可以使用Hudson#getInstance()访问单例Hudson实例,尽管插件启动在初始化阶段相对较早,并且并非所有数据都加载到Hudson中。
如果一个插件想在所有插件和扩展点注册后运行初始化步骤,那么最好是#postInitialize()。如果插件希望在加载所有作业后运行初始化步骤,ItemListener#onLoaded()是一个好地方。

代码示例

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

public void startPlugin(PluginWrapper plugin) throws Exception {
  plugin.getPlugin().start();
}

代码示例来源:origin: stackoverflow.com

ObjectRecipe recipe = new ObjectRecipe(redDefinition.remove("className").toString());
recipe.setAllProperties(redDefinition);

Plugin red = (Plugin) recipe.create();
red.start();

代码示例来源:origin: stackoverflow.com

ObjectRecipe recipe = new ObjectRecipe("com.example.plugins.RedPlugin");
recipe.setProperty("myDateField","2011-08-29");
recipe.setProperty("myIntField","100");
recipe.setProperty("myBooleanField","true");
recipe.setProperty("myUrlField","http://www.stackoverflow.com");
Plugin red = (Plugin) recipe.create();
red.start();

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

@Override
public void start() throws Exception {
 LOG.log(Level.INFO, "Starting {0}", getClass().getSimpleName());
 super.start();
}

代码示例来源:origin: org.jvnet.hudson.main/maven-plugin

@Override
public void start() throws Exception {
  super.start();
  Items.XSTREAM.alias("maven2", MavenModule.class);
  Items.XSTREAM.alias("dependency", ModuleDependency.class);
  Items.XSTREAM.alias("maven2-module-set", MavenModule.class);  // this was a bug, but now we need to keep it for compatibility
  Items.XSTREAM.alias("maven2-moduleset", MavenModuleSet.class);
}

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

/**
 * {@inheritDoc}
 */
@Override
public void start() throws Exception {
  super.start();
  this.imPlugin.start();
}

代码示例来源:origin: jenkinsci/docker-commons-plugin

@Override
public void start() throws Exception {
  super.start();
  registerIcons();
}

代码示例来源:origin: org.jenkins-ci.plugins/docker-commons

@Override
public void start() throws Exception {
  super.start();
  registerIcons();
}

代码示例来源:origin: org.jenkins-ci.plugins/scriptler

@Override
public void start() throws Exception {
  super.start();
  synchronizeConfig();
}

代码示例来源:origin: jenkinsci/thin-backup-plugin

@Override
public void start() throws Exception {
 super.start();
 load();
 LOGGER.fine("'thinBackup' plugin initialized.");
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

public void startPlugin(PluginWrapper plugin) throws Exception {
  plugin.getPlugin().start();
}

代码示例来源:origin: hudson/hudson-2.x

public void startPlugin(PluginWrapper plugin) throws Exception {
  plugin.getPlugin().start();
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public void startPlugin(PluginWrapper plugin) throws Exception {
  plugin.getPlugin().start();
}

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

@Override
public void start() throws Exception {
  super.start();
  Items.XSTREAM.alias("maven2-module-set", MavenModule.class);  // this was a bug, but now we need to keep it for compatibility
  Items.XSTREAM.alias("maven2", MavenModule.class);
  Items.XSTREAM.alias("dependency", ModuleDependency.class);
  Items.XSTREAM.alias("maven2-moduleset", MavenModuleSet.class);
  Run.XSTREAM.registerLocalConverter(MavenArtifact.class, "md5sum", new LRUStringConverter(5000));
}

代码示例来源:origin: com.marvelution.jira.plugins/jenkins-jira-plugin

@Override
public void start() throws Exception {
  super.start();
  load();
  LOGGER.info("Adding the required filters");
  for (Filter filter : filters) {
    PluginServletFilter.addFilter(filter);
  }
  self = this;
}

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

@Override
public void start() throws Exception {
  super.start();
  load();
  PluginServletFilter.addFilter(new PartyParrotStatusFilter());
  try {
    wrapper = null;
    Field wrapperField = Plugin.class.getDeclaredField("wrapper");
    wrapperField.setAccessible(true);
    wrapper = (PluginWrapper) wrapperField.get(this);
  } catch (Exception e) {
  }
}

代码示例来源:origin: org.jenkins-ci.plugins/collabnet

@Override
public void start() throws Exception {
  PluginServletFilter.addFilter(new CNFilter());
  super.start();
}

代码示例来源:origin: org.eclipse.hudson/hudson-inject

/**
 * Configures and starts the {@link hudson.Plugin} instance.
 */
private void start(final PluginWrapper plugin) throws Exception {
  assert plugin != null;
  if (log.isDebugEnabled()) {
    log.debug("Starting plugin: {}", plugin.getShortName());
  }
  Plugin instance = plugin.getPlugin();
  instance.setServletContext(Hudson.getInstance().servletContext);
  instance.start();
}

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

@Override
public void start() throws Exception {
  super.start();
  Items.XSTREAM2.addCompatibilityAlias("jenkins.plugins.nodejs.tools.NpmPackagesBuildWrapper", NodeJSBuildWrapper.class);
  Items.XSTREAM2.addCompatibilityAlias("jenkins.plugins.nodejs.NodeJsCommandInterpreter", NodeJSCommandInterpreter.class);
  try {
    load();
  } catch (IOException e) { // NOSONAR
    // ignore read XStream errors
  }
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-inject

/**
 * Configures and starts the {@link hudson.Plugin} instance.
 */
private void start(final PluginWrapper plugin) throws Exception {
  assert plugin != null;
  if (log.isDebugEnabled()) {
    log.debug("Starting plugin: {}", plugin.getShortName());
  }
  Plugin instance = plugin.getPlugin();
  instance.setServletContext(Hudson.getInstance().servletContext);
  instance.start();
}

相关文章