Skip to content

Plugins deactivation

thomasdelhomenie edited this page Apr 4, 2013 · 2 revisions

Objectives

  • be able to deactivate a plugin by configuration
  • be able a dynamically activate/deactivate a plugin

Configuration

This is done in the configuration.properties, with the parameter crash.plugins.<plugin>.enable. The default value is true, so a plugin is activated by default.

The plugin identifier must be unique. We can rely on the type (for example org.crsh.telnet.TelnetPlugin for the Telnet plugin), or should each plugin define an explicit identifier (by implementing a getName method for instance) ?

Implementation

ServiceLoaderDiscovery is responsible for filtering the deactivated plugins. So it must be updated to pass him the PluginContext so he can read the configuration properties.

Dynamic activation/deactivation could be done with a command. Maybe the "shell plugins" command can be extended for that, so we can do : shell plugins enable <plugin> or shell plugins disable <plugin>

PluginManager must be enhanced to accept to register/unregister plugins after the init phase.

Clone this wiki locally