mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
Revert "Tests: Remove a couple test uses of onModule (#21414)"
This reverts commit b326f0bc51
.
This commit is contained in:
parent
10d358a985
commit
2f32c1173b
12 changed files with 84 additions and 100 deletions
|
@ -20,11 +20,17 @@ If you squashed the whole thing into one class it'd look like:
|
|||
|
||||
[source,java]
|
||||
--------------------------------------------------
|
||||
public class MyNativeScriptPlugin extends Plugin implements ScriptPlugin {
|
||||
|
||||
public class MyNativeScriptPlugin extends Plugin {
|
||||
@Override
|
||||
public List<NativeScriptFactory> getNativeScripts() {
|
||||
return Collections.singletonList(new MyNativeScriptFactory());
|
||||
public String name() {
|
||||
return "my-native-script";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "my native script that does something great";
|
||||
}
|
||||
public void onModule(ScriptModule scriptModule) {
|
||||
scriptModule.registerScript("my_script", MyNativeScriptFactory.class);
|
||||
}
|
||||
|
||||
public static class MyNativeScriptFactory implements NativeScriptFactory {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue