net.i2p.router.web
Class PluginStarter

java.lang.Object
  extended by net.i2p.router.web.PluginStarter
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
PluginStopper

public class PluginStarter
extends java.lang.Object
implements java.lang.Runnable

Start/stop/delete plugins that are already installed Get properties of installed plugins Get or change settings in plugins.config

Since:
0.7.12
Author:
zzz

Field Summary
protected  RouterContext _context
           
(package private) static java.lang.String ENABLED
           
(package private) static java.lang.String PREFIX
           
 
Constructor Summary
PluginStarter(RouterContext ctx)
           
 
Method Summary
static void addPath(java.net.URL u)
          http://jimlife.wordpress.com/2007/12/19/java-adding-new-classpath-at-runtime/
(package private) static boolean deletePlugin(RouterContext ctx, java.lang.String appName)
           
static java.util.Map<java.lang.String,java.lang.String> getPluginKeys(I2PAppContext ctx)
          The signing keys from all the plugins
static java.util.List<java.lang.String> getPlugins()
          all installed plugins whether enabled or not
static boolean isPluginRunning(java.lang.String pluginName, RouterContext ctx)
           
static java.util.Properties pluginProperties()
          plugins.config this auto-adds a propery for every dir in the plugin directory
static java.util.Properties pluginProperties(I2PAppContext ctx, java.lang.String appName)
          plugin.config
(package private) static boolean pluginsEnabled(I2PAppContext ctx)
           
 void run()
           
(package private) static boolean startPlugin(RouterContext ctx, java.lang.String appName)
           
(package private) static void startPlugins(RouterContext ctx)
          this shouldn't throw anything
(package private) static boolean stopPlugin(RouterContext ctx, java.lang.String appName)
           
static void storePluginProperties(java.util.Properties props)
          plugins.config
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_context

protected RouterContext _context

PREFIX

static final java.lang.String PREFIX
See Also:
Constant Field Values

ENABLED

static final java.lang.String ENABLED
See Also:
Constant Field Values
Constructor Detail

PluginStarter

public PluginStarter(RouterContext ctx)
Method Detail

pluginsEnabled

static boolean pluginsEnabled(I2PAppContext ctx)

run

public void run()
Specified by:
run in interface java.lang.Runnable

startPlugins

static void startPlugins(RouterContext ctx)
this shouldn't throw anything


startPlugin

static boolean startPlugin(RouterContext ctx,
                           java.lang.String appName)
                    throws java.lang.Exception
Returns:
true on success
Throws:
just - about anything, caller would be wise to catch Throwable
java.lang.Exception

stopPlugin

static boolean stopPlugin(RouterContext ctx,
                          java.lang.String appName)
                   throws java.lang.Exception
Returns:
true on success
Throws:
just - about anything, caller would be wise to catch Throwable
java.lang.Exception

deletePlugin

static boolean deletePlugin(RouterContext ctx,
                            java.lang.String appName)
                     throws java.lang.Exception
Returns:
true on success - caller should call stopPlugin() first
Throws:
java.lang.Exception

pluginProperties

public static java.util.Properties pluginProperties(I2PAppContext ctx,
                                                    java.lang.String appName)
plugin.config


pluginProperties

public static java.util.Properties pluginProperties()
plugins.config this auto-adds a propery for every dir in the plugin directory


getPlugins

public static java.util.List<java.lang.String> getPlugins()
all installed plugins whether enabled or not


getPluginKeys

public static java.util.Map<java.lang.String,java.lang.String> getPluginKeys(I2PAppContext ctx)
The signing keys from all the plugins

Returns:
Map of key to keyname Last one wins if a dup (installer should prevent dups)

storePluginProperties

public static void storePluginProperties(java.util.Properties props)
plugins.config


isPluginRunning

public static boolean isPluginRunning(java.lang.String pluginName,
                                      RouterContext ctx)

addPath

public static void addPath(java.net.URL u)
                    throws java.lang.Exception
http://jimlife.wordpress.com/2007/12/19/java-adding-new-classpath-at-runtime/

Throws:
java.lang.Exception