GPL and Apache aren't compatible, are they?
-> richard
On 5/26/09 4:27 AM, Eelco Meuter wrote:
This adapted implementation can be used instead to invoke felix:
/**
* Thread safe singleton for the creation of an instance of the Felix
framework.
*
* @author Eelco Meuter
*
* <p>
* Copyright 2009. All rights reserved under GPL license.
* </p>
*/
public class FelixLauncher {
private final Felix felix;
private static File cacheDir;
/**
*This constructor creates a volatile Felix framework instance
based upon
*a configurable map.
*/
@SuppressWarnings("unchecked")
private FelixLauncher() {
Map configMap = new StringMap(false);
configMap.put(FelixConstants.FRAMEWORK_SYSTEMPACKAGES_EXTRA,
"org.apache.felix.framework.util,"
+ "org.apache.felix.framework");
configMap.put(FelixConstants.LOG_LEVEL_PROP, "1");
configMap.put(BundleCache.CACHE_ROOTDIR_PROP,
FelixLauncher.cacheDir
.getAbsolutePath());
felix = new Felix(configMap);
}
/**
*...@param cacheDir
*...@return An instance of the Felix framework.
*...@throws Exception
* If something goes wrong.
*/
public static Felix instance(final File cacheDir) throws Exception {
FelixLauncher.cacheDir = cacheDir;
return FelixHolder.INSTANCE.felix;
}
/**
*Private holder class to make the singleton threadsafe.
*/
private final static class FelixHolder {
private static final FelixLauncher INSTANCE = new
FelixLauncher();
}
}
On May 26, 2009, at 9:47 AM, Matej Pončák wrote:
I tried to create GUI application with Felix. i downloaded example from
http://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Application+Demonstration
It runs very well and its exactly what I need.
But I tried to create my own application with actual version of Felix. I
found out that there are some changes .
For example constructor doesnt have 2 arguments but only 1
here Is old example from org.apache.felix.example.servicebased.host
<codeexample>
// Create list to hold custom framework activators.
List list = new ArrayList();
// Add activator to process auto-start/install properties.
list.add(new AutoActivator(configMap));
// Add our own activator.
list.add(new Activator());
try
{
// Now create an instance of the framework.
Felix felix = new Felix(configMap, list);
felix.start();
}
catch (Exception ex)
{
System.err.println("Could not create framework: " + ex);
ex.printStackTrace();
System.exit(-1);
}
</codeexample>
In actual version of Felix is only
<codeexamplefromsource>
public Felix(Map configMap)
{
</codeexamplefromsource>
So what is necessary to change in example code
org.apache.felix.example.servicebased.host ?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Wageningen University
Plant Production Systems
P.O. Box 430
6700 AK WAGENINGEN
The Netherlands
http://www.pps.wur.nl
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]