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);
                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
-- 
View this message in context: 
http://www.nabble.com/LogService-start-order---can-start-be-forced-before-oth%C3%A9r-bundles--tp26074675p26079047.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


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

Reply via email to