|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.main.Main
public class Main
This class is the default way to instantiate and execute the framework. It is not intended to be the only way to instantiate and execute the framework; rather, it is one example of how to do so. When embedding the framework in a host application, this class can serve as a simple guide of how to do so. It may even be worthwhile to reuse some of its property handling capabilities.
Field Summary | |
---|---|
static String |
CONFIG_DIRECTORY
Name of the configuration directory. |
static String |
CONFIG_PROPERTIES_FILE_VALUE
The default name used for the configuration properties file. |
static String |
CONFIG_PROPERTIES_PROP
The property name used to specify an URL to the configuration property file to be used for the created the framework instance. |
static String |
SYSTEM_PROPERTIES_FILE_VALUE
The default name used for the system properties file. |
static String |
SYSTEM_PROPERTIES_PROP
The property name used to specify an URL to the system property file. |
Constructor Summary | |
---|---|
Main()
|
Method Summary | |
---|---|
static void |
copySystemProperties(Properties configProps)
|
static Properties |
loadConfigProperties()
Loads the configuration properties in the configuration property file associated with the framework installation; these properties are accessible to the framework and to bundles and are intended for configuration purposes. |
static void |
loadSystemProperties()
Loads the properties in the system property file associated with the framework installation into System.setProperty(). |
static void |
main(String[] args)
This method performs the main task of constructing an framework instance and starting its execution. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SYSTEM_PROPERTIES_PROP
public static final String SYSTEM_PROPERTIES_FILE_VALUE
public static final String CONFIG_PROPERTIES_PROP
public static final String CONFIG_PROPERTIES_FILE_VALUE
public static final String CONFIG_DIRECTORY
Constructor Detail |
---|
public Main()
Method Detail |
---|
public static void main(String[] args) throws Exception
This method performs the main task of constructing an framework instance and starting its execution. The following functions are performed when invoked:
It should be noted that simply starting an instance of the framework is not enough to create an interactive session with it. It is necessary to install and start bundles that provide a some means to interact with the framework; this is generally done by specifying an "auto-start" property in the configuration property file. If no bundles providing a means to interact with the framework are installed or if the configuration property file cannot be found, the framework will appear to be hung or deadlocked. This is not the case, it is executing correctly, there is just no way to interact with it. The default launcher provides two configuration properties to help you automatically install and/or start bundles, which are:
These properties should be specified in the config.properties so that they can be processed by the launcher during the framework startup process.
argv
- Accepts a single argument, which is the path to use as the
framework's bundle cache.
Exception
- If an error occurs.public static void loadSystemProperties()
Loads the properties in the system property file associated with the framework installation into System.setProperty(). These properties are not directly used by the framework in anyway. By default, the system property file is located in the conf/ directory of the Felix installation directory and is called "system.properties". The installation directory of Felix is assumed to be the parent directory of the felix.jar file as found on the system class path property. The precise file from which to load system properties can be set by initializing the "felix.system.properties" system property to an arbitrary URL.
public static Properties loadConfigProperties()
Loads the configuration properties in the configuration property file associated with the framework installation; these properties are accessible to the framework and to bundles and are intended for configuration purposes. By default, the configuration property file is located in the conf/ directory of the Felix installation directory and is called "config.properties". The installation directory of Felix is assumed to be the parent directory of the felix.jar file as found on the system class path property. The precise file from which to load configuration properties can be set by initializing the "felix.config.properties" system property to an arbitrary URL.
public static void copySystemProperties(Properties configProps)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |