Deprecating subclassing of Plugin.

This commit is contained in:
Jesse Glick committed 2015-12-01 17:27:25 -05:00
1 parent 2f92cadb96
commit 3a83504e3d
4 files changed
+23 -7

No files matched your search

+20 -1
View File
@@ -40,15 +40,18 @@ import java.io.File;
import net.sf.json.JSONObject;
import com.thoughtworks.xstream.XStream;
import hudson.init.Initializer;
import hudson.init.Terminator;
import java.net.URI;
import java.net.URISyntaxException;
import jenkins.model.GlobalConfiguration;
import org.kohsuke.stapler.HttpResponses;
/**
* Base class of Hudson plugin.
*
* <p>
* A plugin may derive from this class, or it may directly define extension
* A plugin may {@linkplain #Plugin derive from this class}, or it may directly define extension
* points annotated with {@link hudson.Extension}. For a list of extension
* points, see <a href="https://wiki.jenkins-ci.org/display/JENKINS/Extension+points">
* https://wiki.jenkins-ci.org/display/JENKINS/Extension+points</a>.
@@ -78,6 +81,22 @@ import org.kohsuke.stapler.HttpResponses;
*/
public abstract class Plugin implements Saveable {
/**
* You do not need to create custom subtypes:
* <ul>
* <li>{@code config.jelly}, {@link #configure(StaplerRequest, JSONObject)}, {@link #load}, and {@link #save}
* can be replaced by {@link GlobalConfiguration}
* <li>{@link #start} and {@link #postInitialize} can be replaced by {@link Initializer} (or {@link ItemListener#onLoaded})
* <li>{@link #stop} can be replaced by {@link Terminator}
* <li>{@link #setServletContext} can be replaced by {@link Jenkins#servletContext}
* </ul>
* Note that every plugin gets a {@link DummyImpl} by default,
* which will still route the URL space, serve {@link #getWrapper}, and so on.
* @deprecated Use more modern APIs rather than subclassing.
*/
@Deprecated
protected Plugin() {}
/**
* Set by the {@link PluginManager}, before the {@link #start()} method is called.
* This points to the {@link PluginWrapper} that wraps