|
|
@@ -19,6 +19,8 @@
|
|
|
|
|
|
package org.elasticsearch.plugins;
|
|
|
|
|
|
+import java.io.Closeable;
|
|
|
+import java.io.IOException;
|
|
|
import java.util.Collection;
|
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
@@ -70,7 +72,7 @@ import java.util.function.UnaryOperator;
|
|
|
* 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 {
|
|
|
+public abstract class Plugin implements Closeable {
|
|
|
|
|
|
/**
|
|
|
* Node level guice modules.
|
|
|
@@ -162,6 +164,16 @@ public abstract class Plugin {
|
|
|
return Collections.emptyList();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Close the resources opened by this plugin.
|
|
|
+ *
|
|
|
+ * @throws IOException if the plugin failed to close its resources
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void close() throws IOException {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Old-style guice index level extension point. {@code @Deprecated} and {@code final} to act as a signpost for plugin authors upgrading
|
|
|
* from 2.x.
|