|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.Plugin
ruby.PluginImpl
ruby.RubyPlugin
public class RubyPlugin
The primary Java interface to a plugin which is implemented in Ruby. One instance is created per each Ruby plugin.
When this plugin initializes, it will instantiate a Jenkins::Plugin object which acts as the gateway for Ruby to interact with the java side.
When the RubyPlugin is loaded, it will discover, load and provide a mechanism for extensions written in Ruby that it contains to register themselves.
These Extensions are presented to Jenkins via the RubyExtensionFinder
Each plugin has its own JRuby environment
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class hudson.Plugin |
|---|
hudson.Plugin.DummyImpl |
| Field Summary |
|---|
| Fields inherited from interface hudson.model.Saveable |
|---|
NOOP |
| Constructor Summary | |
|---|---|
RubyPlugin()
|
|
| Method Summary | |
|---|---|
void |
addExtension(Object extension)
Registers an extension with this Ruby plugin so that it will be found later on This method is generally called from inside Ruby, as objects that implement extension points register themselves. |
Object |
callMethod(Object object,
String methodName,
Object... args)
invokes a Ruby method on the specified object in the context of this plugin's ScriptingContainer |
static RubyPlugin |
from(org.jruby.Ruby r)
Gets the plugin that owns the container. |
Collection<hudson.ExtensionComponent> |
getExtensions()
|
File |
getLibPath()
|
File |
getModelsPath()
|
Object |
getNativeRubyPlugin()
|
String |
getResourceURI(String relativePathFormat,
Object... args)
|
File |
getScriptDir()
Returns a directory that stores all the Ruby scripts. |
org.jruby.embed.ScriptingContainer |
getScriptingContainer()
|
org.kohsuke.stapler.lang.Klass<org.jruby.RubyModule> |
klassFor(org.jruby.RubyModule module)
|
String |
loadBootScript()
Loads the models.rb |
void |
rack(org.jruby.runtime.builtin.IRubyObject servletHandler)
Let a Rack application handle the current request. |
void |
start()
Jenkins will call this method whenever the plugin is initialized The plugin will in turn delegate to its instance of Jenkins::Plugin which can take action on the Ruby side. |
void |
stop()
Jenkins will call this method whenever the plugin is shut down The plugin will in turn delegate to its instance of Jenkins::Plugin which can take action on the Ruby side |
| Methods inherited from class hudson.Plugin |
|---|
configure, configure, doDynamic, getConfigXml, getWrapper, load, postInitialize, save, setServletContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RubyPlugin()
| Method Detail |
|---|
public Object callMethod(Object object,
String methodName,
Object... args)
ScriptingContainer
object - JRuby object to use as invocantmethodName - the method to endargs - arguments to the method
public void addExtension(Object extension)
extension - public Collection<hudson.ExtensionComponent> getExtensions()
RubyExtensionFinder to present extension points to Jenkins
public String loadBootScript()
throws IOException
IOException
public void start()
throws Exception
start in class hudson.PluginExceptionpublic static RubyPlugin from(org.jruby.Ruby r)
public org.kohsuke.stapler.lang.Klass<org.jruby.RubyModule> klassFor(org.jruby.RubyModule module)
public void stop()
throws Exception
stop in class hudson.PluginException
public String getResourceURI(String relativePathFormat,
Object... args)
public File getScriptDir()
public File getLibPath()
public File getModelsPath()
public org.jruby.embed.ScriptingContainer getScriptingContainer()
public Object getNativeRubyPlugin()
public void rack(org.jruby.runtime.builtin.IRubyObject servletHandler)
servletHandler - Instance of Rack::Handler::Servlet which wraps the actual rack application and provides
the ruby part of the rack implementation.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||