WebVM

  1. WebVM
  2. Configuration
    1. Requirements
    2. Interface
    3. Configuration storage format
    4. Default option keys
    5. Unix
    6. Windows

Configuration

Each WebVM installation can be customized to fit best with the underlying operating system, Java VM and browser using a generic interface which needs to be implemented for different platforms and storage mechanisms.

Requirements

The configuration of WebVM needs to implement the following requirements:

Interface

The interface of the Configuration looks like the following abstract class definition:

class Setup {

public:

    // Returns the value of the option key, NULL if option is not
    // set/unknown.
    const char *getOption(const char *key) = 0;

    // Sets the option value with the specific key. If the value is
    // NULL, the option is unset. If key is NULL the call has no
    // effect.
    void setOption(const char *key, const char *value) = 0;

    // Discards the existing options and reads the new options from
    // the specified input stream.
    bool readOptions(istream *in) = 0;

    // Writes the existing options to the specified output stream.
    bool writeOptions(ostream *out) = 0;

};

Configuration storage format

The option storage format is implementation-dependent. However the default storage format of the file-based implementation uses the following syntax:

# comment
key: value

Each line might contain a single key value pair, which are separated by the first occurrence of the colon character. Leading and trailing whitespace characters are dropped from the key and value. Values containing a sequence of $NAME will be evaluated to the value of environment variables, if present.

Default option keys

To implement the above requirements using a file-based configuration approach, the following default keys are specified:

# Home directory/namespace of WebVM
home: /usr/lib/webvm 
# Temporary directory/storage
store.temp: /tmp
# Persistent storage
store.persistent: $HOME/.webvm/modules
# Security policy storage
store.security: $HOME/.webvm/security
# The VM provider
java.vm: /usr/lib/java/jre/lib/i386/client/libjvm.so
# The number of additional VM options
java.vm.nOptions: 2
# Additional VM options
java.vm.option.0: -Djava.library.path=/usr/lib/webvm/jni/lib
java.vm.option.1: -Dverbose=class
# Java class file major.minor version
java.classfile.version: 49.0
# The default Java classpath to execute WebVM modules
java.class.path: /usr/lib/webvm/java/lib/J2SE.jar:/usr/lib/webvm/java/lib/midlet.jar

Unix

The system-wide webvm configuration file should be stored in

/etc/webvm.conf

If WebVM is deployed only by a single user, the user’s WebVM configuration should be stored in

$HOME/.webvm.conf

Windows

The system-wide webvm configuration file should be the value of the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Aplix Corporation\WebVM\ConfigFile

If WebVM is deployed only by a single user, the user’s WebVM configuration file should be the value of the following registry key:

HKEY_CURRENT_USER\SOFTWARE\Aplix Corporation\WebVM\ConfigFile