hudson.init
Class InitStrategy

java.lang.Object
  extended by hudson.init.InitStrategy

public class InitStrategy
extends Object

Strategy pattern of the various key decision making during the Jenkins initialization.

Because the act of initializing plugins is a part of the Jenkins initialization, this extension point cannot be implemented in a plugin. You need to place your jar inside WEB-INF/lib instead.

To register, put MetaInfServices on your implementation.

Author:
Kohsuke Kawaguchi

Constructor Summary
InitStrategy()
           
 
Method Summary
static InitStrategy get(ClassLoader cl)
          Obtains the instance to be used.
protected  void getBundledPluginsFromProperty(List<File> r)
          Lists up additional bundled plugins from the system property hudson.bundled.plugins.
 List<File> listPluginArchives(PluginManager pm)
          Returns the list of *.jpi, *.hpi and *.hpl to expand and load.
 boolean skipInitTask(org.jvnet.hudson.reactor.Task task)
          Selectively skip some of the initialization tasks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InitStrategy

public InitStrategy()
Method Detail

listPluginArchives

public List<File> listPluginArchives(PluginManager pm)
                              throws IOException
Returns the list of *.jpi, *.hpi and *.hpl to expand and load.

Normally we look at $JENKINS_HOME/plugins/*.jpi and *.hpi and *.hpl.

Returns:
never null but can be empty. The list can contain different versions of the same plugin, and when that happens, Jenkins will ignore all but the first one in the list.
Throws:
IOException

getBundledPluginsFromProperty

protected void getBundledPluginsFromProperty(List<File> r)
Lists up additional bundled plugins from the system property hudson.bundled.plugins. Since 1.480 glob syntax is supported. For use in the "mvn hudson-dev:run". TODO: maven-hpi-plugin should inject its own InitStrategy instead of having this in the core.


skipInitTask

public boolean skipInitTask(org.jvnet.hudson.reactor.Task task)
Selectively skip some of the initialization tasks.

Returns:
true to skip the execution.

get

public static InitStrategy get(ClassLoader cl)
                        throws IOException
Obtains the instance to be used.

Throws:
IOException


Copyright © 2004-2013. All Rights Reserved.