On 10/27/09 10:47, Niko_K wrote:

Richard S. Hall wrote:
You have two options:

    1. You can modify your other bundles to wait until a log service is
       available before continuing, thus they won't try to use it before
       it appears.
    2. You can install the log service into start level 1 and all your
       other bundles into start level 2 (look in the spec for start
levels).

Approach 2 is simpler, but your bundles are more fragile and difficult
to reuse in other projects.

->  richard

I guess that using a comination of both approaches is the best way to go.
I am planning to use the log service only if it is available. Otherwise the
jdk log will be available.

Is there a tutorial somewhere around the web that shows how to work with
startlevels.
How do i have to modify my startup class to work with startlevel:
<code>
                Map<String, String>  configMap = new HashMap<String, String>();
                configMap.put(AutoProcessor.AUTO_DEPLOY_DIR_VALUE, "bundle");
                configMap.put(AutoProcessor.AUTO_DEPLOY_ACTION_PROPERY,
AutoProcessor.AUTO_DEPLOY_UNINSTALL_VALUE + ',' +
                                                                                
                                                
AutoProcessor.AUTO_DEPLOY_INSTALL_VALUE + ',' +
                                                                                
                                                
AutoProcessor.AUTO_DEPLOY_START_VALUE + ',' +
                                                                                
                                                
AutoProcessor.AUTO_DEPLOY_UPDATE_VALUE);

The auto-deploy directory does not support start levels. If you want start levels, you will have to use the Felix framework launcher auto-start property or install the bundles programmatically.

-> richard

                configMap.put(Constants.FRAMEWORK_STORAGE, "cache");
                configMap.put(Constants.FRAMEWORK_STORAGE_CLEAN,
Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);
                configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA,
"javax.swing.plaf," +
                                                                                          
                                      "javax.swing.plaf.metal," +
                                                                                          
                                      "com.sun.java.swing.plaf.gtk," +
                                                                                          
                                      "com.sun.java.swing.plaf.motif," +
                                                                                          
                                      "com.sun.java.swing.plaf.nimbus," +
                                                                                          
                                      "com.sun.java.swing.plaf.windows");

                try {
                        framework = 
getFrameworkFactory().newFramework(configMap);
                        framework.init();
                        AutoProcessor.process(configMap, 
framework.getBundleContext());
                        framework.start();
                        framework.waitForStop(0);
                        System.exit(0);
                } catch (Exception ex) {
                        System.err.println("Could not create framework: " + ex);
                        System.exit(-1);
                }
</code>

Greetings.
Niko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to