net.i2p.router.startup
Class ClientAppConfig

java.lang.Object
  extended by net.i2p.router.startup.ClientAppConfig

public class ClientAppConfig
extends java.lang.Object

Contains a really simple ClientApp "structure" and some static methods so they can be used both by LoadClientAppsJob and by the configuration page in the router console.


 clients.config format:

 Lines are of the form clientApp.x.prop=val, where x is the app number.
 App numbers MUST start with 0 and be consecutive.

 Properties are as follows:
        main: Full class name. Required. The main() method in this
              class will be run.
        name: Name to be displayed on console.
        args: Arguments to the main class, separated by spaces or tabs.
              Arguments containing spaces or tabs may be quoted with ' or "
        delay: Seconds before starting, default 120
        onBoot: {true|false}, default false, forces a delay of 0,
                overrides delay setting
        startOnLoad: {true|false} Is the client to be run at all?
                    Default true

 The following additional properties are used only by plugins:
        stopargs: Arguments to stop the client.
        uninstallargs: Arguments to stop the client.
        classpath: Additional classpath elements for the client,
                   separated by commas.

 The following substitutions are made in the args, stopargs,
 uninstallargs, and classpath lines, for plugins only:
        $I2P: The base I2P install directory
        $CONFIG: The user's configuration directory (e.g. ~/.i2p)
        $PLUGIN: This plugin's directory (e.g. ~/.i2p/plugins/foo)

 All properties except "main" are optional.
 Lines starting with "#" are comments.

 If the delay is less than zero, the client is run immediately,
 in the same thread, so that exceptions may be propagated to the console.
 In this case, the client should either throw an exception, return quickly,
 or spawn its own thread.
 If the delay is greater than or equal to zero, it will be run
 in a new thread, and exceptions will be logged but not propagated
 to the console.

 


Field Summary
 java.lang.String args
           
 java.lang.String className
           
 java.lang.String classpath
           
 java.lang.String clientName
           
 long delay
           
 boolean disabled
           
 java.lang.String stopargs
           
 java.lang.String uninstallargs
           
 
Constructor Summary
ClientAppConfig(java.lang.String cl, java.lang.String client, java.lang.String a, long d, boolean dis)
           
ClientAppConfig(java.lang.String cl, java.lang.String client, java.lang.String a, long d, boolean dis, java.lang.String cp, java.lang.String sa, java.lang.String ua)
           
 
Method Summary
static java.io.File configFile(I2PAppContext ctx)
           
static java.util.List<ClientAppConfig> getClientApps(java.io.File cfgFile)
           
static java.util.List<ClientAppConfig> getClientApps(RouterContext ctx)
           
static void writeClientAppConfig(RouterContext ctx, java.util.List apps)
          classpath and stopargs not supported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

className

public java.lang.String className

clientName

public java.lang.String clientName

args

public java.lang.String args

delay

public long delay

disabled

public boolean disabled

classpath

public java.lang.String classpath
Since:
0.7.12

stopargs

public java.lang.String stopargs
Since:
0.7.12

uninstallargs

public java.lang.String uninstallargs
Since:
0.7.12
Constructor Detail

ClientAppConfig

public ClientAppConfig(java.lang.String cl,
                       java.lang.String client,
                       java.lang.String a,
                       long d,
                       boolean dis)

ClientAppConfig

public ClientAppConfig(java.lang.String cl,
                       java.lang.String client,
                       java.lang.String a,
                       long d,
                       boolean dis,
                       java.lang.String cp,
                       java.lang.String sa,
                       java.lang.String ua)
Since:
0.7.12
Method Detail

configFile

public static java.io.File configFile(I2PAppContext ctx)

getClientApps

public static java.util.List<ClientAppConfig> getClientApps(RouterContext ctx)

getClientApps

public static java.util.List<ClientAppConfig> getClientApps(java.io.File cfgFile)

writeClientAppConfig

public static void writeClientAppConfig(RouterContext ctx,
                                        java.util.List apps)
classpath and stopargs not supported