org.knopflerfish.framework.Main Class Reference

List of all members.


Detailed Description

This is the main startup code for the framework and enables basic operations as install, start, stop, uninstall and update.

Author:
Jan Stein, Erik Wistrand, Mats-Ola Persson

Definition at line 56 of file Main.java.


Static Public Member Functions

static void main (String[] args)
 Help class for starting the OSGi framework.
static void shutdown (final int exitcode)
 Shutdown framework.
static void restart ()
 Restart framework.

Static Package Functions

static String[] expandArgs (String[] argv)
 Expand all occurance of -xargs URL into a new array without any -xargs.
static void printResource (String name)
 Print help for starting the platform.
static void printJVMInfo ()
 Print help for starting the platform.
static String getDefaultXArgs (String[] oldArgs)
 Helper method which tries to find default xargs files.
static void setDefaultSysProps ()
 Check current system properties and set default values if importand ones are missing.
static String[] sanityArgs (String[] args)
 Loop over args array and check that it looks reasonable.
static String[] loadArgs (String xargsPath, String[] oldArgs)
 Helper method when OS shell does not allow long command lines.
static void println (String s, int level)
 Print string to System.out if level >= current verbosity.
static void error (String s)
 Report error and exit.

Static Package Attributes

static String[][] defaultSysProps
 Default values for some system properties.

Member Function Documentation

static void org.knopflerfish.framework.Main.shutdown ( final int  exitcode  )  [static]

Shutdown framework.

This code is called in SystemBundle.stop(), which is the preferred way to shut down the framework.

Definition at line 517 of file Main.java.

References org.osgi.framework.BundleException.getNestedException(), org.knopflerfish.framework.Main.println(), org.knopflerfish.framework.Framework.shutdown(), and org.knopflerfish.framework.Framework.stopBundle().

static void org.knopflerfish.framework.Main.restart (  )  [static]

Restart framework.

This code is called in SystemBundle.update()

Definition at line 548 of file Main.java.

References org.osgi.framework.BundleException.getNestedException(), org.knopflerfish.framework.Framework.launch(), org.knopflerfish.framework.Main.println(), org.knopflerfish.framework.Framework.shutdown(), and org.knopflerfish.framework.Framework.stopBundle().

static void org.knopflerfish.framework.Main.setDefaultSysProps (  )  [static, package]

Check current system properties and set default values if importand ones are missing.

The default values are taken from the defaultSysProps variable.

The org.knopflerfish.gosg.jars property (if not defined) is created by scanning the "jars" directory for subdirs.

See also:
defaultSysProps

Definition at line 772 of file Main.java.

References org.knopflerfish.framework.Main.defaultSysProps, and org.knopflerfish.framework.Main.println().

Referenced by org.knopflerfish.framework.Main.main().

static String [] org.knopflerfish.framework.Main.sanityArgs ( String[]  args  )  [static, package]

Loop over args array and check that it looks reasonable.

If really bad things are found, they might be fixed ;)

This method is intended to be called in the "zeroargs" startup case to preserve backwards compatibility.

Returns:
new, fixed args array.

Definition at line 844 of file Main.java.

References org.knopflerfish.framework.Main.println().

Referenced by org.knopflerfish.framework.Main.main().

static String [] org.knopflerfish.framework.Main.loadArgs ( String  xargsPath,
String[]  oldArgs 
) [static, package]

Helper method when OS shell does not allow long command lines.

This method has nowadays become the only reasonable way to start the framework due to the amount of properties.

Loads a specified file or URL and creates a new String array where each entry corresponds to entries in the loaded file.

File format:

Parameters:
argv Original command line arguments. These should begin with "-xargs" "<file to load>". If argv.length < 2 return original argv.
Returns:
Original argv + argv loaded from file

Definition at line 899 of file Main.java.

References org.knopflerfish.framework.Main.getDefaultXArgs(), and org.knopflerfish.framework.Main.println().

Referenced by org.knopflerfish.framework.Main.expandArgs().

static void org.knopflerfish.framework.Main.println ( String  s,
int  level 
) [static, package]

Print string to System.out if level >= current verbosity.

Parameters:
s String to print.
level print level.

Definition at line 1025 of file Main.java.

Referenced by org.knopflerfish.framework.Main.getDefaultXArgs(), org.knopflerfish.framework.Main.loadArgs(), org.knopflerfish.framework.Main.main(), org.knopflerfish.framework.Main.restart(), org.knopflerfish.framework.Main.sanityArgs(), org.knopflerfish.framework.Main.setDefaultSysProps(), and org.knopflerfish.framework.Main.shutdown().


The documentation for this class was generated from the following file:
Generated on Mon Jan 11 21:19:19 2010 for OpenMobileIS by  doxygen 1.5.4