|
||||||||||
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(java.lang.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. |
java.lang.Object |
callMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.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. |
java.util.Collection<hudson.ExtensionComponent> |
getExtensions()
|
java.io.File |
getLibPath()
|
java.io.File |
getModelsPath()
|
java.lang.Object |
getNativeRubyPlugin()
|
java.lang.String |
getResourceURI(java.lang.String relativePathFormat,
java.lang.Object... args)
|
java.io.File |
getScriptDir()
Returns a directory that stores all the Ruby scripts. |
org.jruby.embed.ScriptingContainer |
getScriptingContainer()
|
java.lang.String |
loadBootScript()
Loads the models.rb |
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 java.lang.Object callMethod(java.lang.Object object, java.lang.String methodName, java.lang.Object... args)
ScriptingContainer
object
- JRuby object to use as invocantmethodName
- the method to endargs
- arguments to the method
public void addExtension(java.lang.Object extension)
extension
- public java.util.Collection<hudson.ExtensionComponent> getExtensions()
RubyExtensionFinder
to present extension points to Jenkinspublic java.lang.String loadBootScript() throws java.io.IOException
java.io.IOException
public void start() throws java.lang.Exception
start
in class hudson.Plugin
java.lang.Exception
public static RubyPlugin from(org.jruby.Ruby r)
public void stop() throws java.lang.Exception
stop
in class hudson.Plugin
java.lang.Exception
public java.lang.String getResourceURI(java.lang.String relativePathFormat, java.lang.Object... args)
public java.io.File getScriptDir()
public java.io.File getLibPath()
public java.io.File getModelsPath()
public org.jruby.embed.ScriptingContainer getScriptingContainer()
public java.lang.Object getNativeRubyPlugin()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |