mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
parent
5e08c4a271
commit
8759050aa4
5 changed files with 38 additions and 15 deletions
|
@ -1,13 +1 @@
|
|||
# encoding: utf-8
|
||||
module LogStash
|
||||
class UniversalPlugin
|
||||
def initialize
|
||||
end
|
||||
|
||||
def register_hooks(hookManager)
|
||||
end
|
||||
|
||||
def additionals_settings(settings)
|
||||
end
|
||||
end
|
||||
end
|
||||
# Keeping this file for backwards compatibility with plugins that include it directly.
|
||||
|
|
|
@ -37,6 +37,7 @@ import org.logstash.log.LoggableExt;
|
|||
import org.logstash.log.LoggerExt;
|
||||
import org.logstash.log.SlowLoggerExt;
|
||||
import org.logstash.plugins.PluginFactoryExt;
|
||||
import org.logstash.plugins.UniversalPluginExt;
|
||||
|
||||
/**
|
||||
* Utilities around interaction with the {@link Ruby} runtime.
|
||||
|
@ -150,6 +151,8 @@ public final class RubyUtil {
|
|||
|
||||
public static final RubyClass CONFIGURATION_ERROR_CLASS;
|
||||
|
||||
public static final RubyClass UNIVERSAL_PLUGIN_CLASS;
|
||||
|
||||
/**
|
||||
* Logstash Ruby Module.
|
||||
*/
|
||||
|
@ -411,6 +414,8 @@ public final class RubyUtil {
|
|||
"PluginFactory", RUBY.getObject(), PluginFactoryExt.Plugins::new
|
||||
);
|
||||
PLUGIN_FACTORY_CLASS.defineAnnotatedMethods(PluginFactoryExt.Plugins.class);
|
||||
UNIVERSAL_PLUGIN_CLASS =
|
||||
setupLogstashClass(UniversalPluginExt::new, UniversalPluginExt.class);
|
||||
RUBY.getGlobalVariables().set("$LS_JARS_LOADED", RUBY.newString("true"));
|
||||
RubyJavaIntegration.setupRubyJavaIntegration(RUBY);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package org.logstash.plugins;
|
||||
|
||||
import org.jruby.Ruby;
|
||||
import org.jruby.RubyBasicObject;
|
||||
import org.jruby.RubyClass;
|
||||
import org.jruby.anno.JRubyClass;
|
||||
import org.jruby.anno.JRubyMethod;
|
||||
import org.jruby.runtime.ThreadContext;
|
||||
import org.jruby.runtime.builtin.IRubyObject;
|
||||
|
||||
@JRubyClass(name = "UniversalPlugin")
|
||||
public final class UniversalPluginExt extends RubyBasicObject {
|
||||
|
||||
public UniversalPluginExt(final Ruby runtime, final RubyClass metaClass) {
|
||||
super(runtime, metaClass);
|
||||
}
|
||||
|
||||
@JRubyMethod
|
||||
public IRubyObject initialize(final ThreadContext context) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@JRubyMethod(name = "register_hooks")
|
||||
public IRubyObject registerHooks(final ThreadContext context, final IRubyObject hookManager) {
|
||||
return context.nil;
|
||||
}
|
||||
|
||||
@JRubyMethod(name = "additionals_settings")
|
||||
public IRubyObject additionalSettings(final ThreadContext context, final IRubyObject settings) {
|
||||
return context.nil;
|
||||
}
|
||||
}
|
|
@ -3,7 +3,6 @@
|
|||
# you may not use this file except in compliance with the Elastic License.
|
||||
|
||||
require "logstash/environment"
|
||||
require "logstash/universal_plugin"
|
||||
require "config_management/hooks"
|
||||
require "config_management/elasticsearch_source"
|
||||
require "config_management/bootstrap_check"
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
# you may not use this file except in compliance with the Elastic License.
|
||||
|
||||
require "logstash/agent"
|
||||
require "logstash/universal_plugin"
|
||||
require "monitoring/internal_pipeline_source"
|
||||
require "logstash/config/pipeline_config"
|
||||
require 'helpers/elasticsearch_options'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue