diff --git a/core/src/main/java/org/elasticsearch/plugins/Plugin.java b/core/src/main/java/org/elasticsearch/plugins/Plugin.java index 1c79986e18f27..180c8efd73096 100644 --- a/core/src/main/java/org/elasticsearch/plugins/Plugin.java +++ b/core/src/main/java/org/elasticsearch/plugins/Plugin.java @@ -48,16 +48,22 @@ import java.util.function.UnaryOperator; /** - * An extension point allowing to plug in custom functionality. - *

- * Implement any of these interfaces to extend Elasticsearch: + * An extension point allowing to plug in custom functionality. This class has a number of extension points that are available to all + * plugins, in addition you can implement any of the following interfaces to further customize Elasticsearch: *

+ *

In addition to extension points this class also declares some {@code @Deprecated} {@code public final void onModule} methods. These + * methods should cause any extensions of {@linkplain Plugin} that used the pre-5.x style extension syntax to fail to build and point the + * plugin author at the new extension syntax. We hope that these make the process of upgrading a plugin from 2.x to 5.x only mildly painful. */ public abstract class Plugin { @@ -141,7 +147,19 @@ public UnaryOperator> getCustomMetaDataUpgrader() { } /** - * Old-style guice index level extension point. + * Provides the list of this plugin's custom thread pools, empty if + * none. + * + * @param settings the current settings + * @return executors builders for this plugin's custom thread pools + */ + public List> getExecutorBuilders(Settings settings) { + return Collections.emptyList(); + } + + /** + * Old-style guice index level extension point. {@code @Deprecated} and {@code final} to act as a signpost for plugin authors upgrading + * from 2.x. * * @deprecated use #onIndexModule instead */ @@ -150,7 +168,8 @@ public final void onModule(IndexModule indexModule) {} /** - * Old-style guice settings extension point. + * Old-style guice settings extension point. {@code @Deprecated} and {@code final} to act as a signpost for plugin authors upgrading + * from 2.x. * * @deprecated use #getSettings and #getSettingsFilter instead */ @@ -158,7 +177,8 @@ public final void onModule(IndexModule indexModule) {} public final void onModule(SettingsModule settingsModule) {} /** - * Old-style guice scripting extension point. + * Old-style guice scripting extension point. {@code @Deprecated} and {@code final} to act as a signpost for plugin authors upgrading + * from 2.x. * * @deprecated implement {@link ScriptPlugin} instead */ @@ -166,7 +186,8 @@ public final void onModule(SettingsModule settingsModule) {} public final void onModule(ScriptModule module) {} /** - * Old-style analysis extension point. + * Old-style analysis extension point. {@code @Deprecated} and {@code final} to act as a signpost for plugin authors upgrading + * from 2.x. * * @deprecated implement {@link AnalysisPlugin} instead */ @@ -174,7 +195,8 @@ public final void onModule(ScriptModule module) {} public final void onModule(AnalysisModule module) {} /** - * Old-style action extension point. + * Old-style action extension point. {@code @Deprecated} and {@code final} to act as a signpost for plugin authors upgrading + * from 2.x. * * @deprecated implement {@link ActionPlugin} instead */ @@ -182,21 +204,11 @@ public final void onModule(AnalysisModule module) {} public final void onModule(ActionModule module) {} /** - * Old-style action extension point. + * Old-style action extension point. {@code @Deprecated} and {@code final} to act as a signpost for plugin authors upgrading + * from 2.x. * * @deprecated implement {@link SearchPlugin} instead */ @Deprecated public final void onModule(SearchModule module) {} - - /** - * Provides the list of this plugin's custom thread pools, empty if - * none. - * - * @param settings the current settings - * @return executors builders for this plugin's custom thread pools - */ - public List> getExecutorBuilders(Settings settings) { - return Collections.emptyList(); - } }