You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Matej Pončák <ma...@r-sys.sk> on 2009/05/26 09:47:17 UTC

Old example?

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: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Old example?

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 5/26/09 4:24 PM, peter.doornbosch wrote:
> Hi Richard,
>
> On 26 May , 2009, at 16:39 , Richard S. Hall wrote:
>
>> I will try to update these examples today or tomorrow. Thanks for 
>> reporting the issue. In the meantime, checkout:
>>
>>    
>> http://felix.apache.org/site/apache-felix-framework-launching-and-embedding.html 
>>
>>
>> This explains the new framework API.
>
> Yeah, but it is a bit confusing that it starts with the warning that 
> it is based on Felix 1.4.
> I embedded felix 1.6 a few weeks ago and noticed some discrepancies, 
> but i see now that these are all fixed, so i guess it should mention 
> that it is based on 1.6 ;-)

Well, the change occurred in Felix 1.4.0 and remains backwards 
compatible through the current release, so there was no reason to update 
the documentation. However, I can add a note to make it more clear.

-> richard

>
> Regards,
> Peter
>
>
>>
>>
>> -> richard
>>
>> On 5/26/09 3: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: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

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


Re: Old example?

Posted by "peter.doornbosch" <pe...@gmail.com>.
Hi Richard,

On 26 May , 2009, at 16:39 , Richard S. Hall wrote:

> I will try to update these examples today or tomorrow. Thanks for  
> reporting the issue. In the meantime, checkout:
>
>    http://felix.apache.org/site/apache-felix-framework-launching-and-embedding.html
>
> This explains the new framework API.

Yeah, but it is a bit confusing that it starts with the warning that  
it is based on Felix 1.4.
I embedded felix 1.6 a few weeks ago and noticed some discrepancies,  
but i see now that these are all fixed, so i guess it should mention  
that it is based on 1.6 ;-)

Regards,
Peter


>
>
> -> richard
>
> On 5/26/09 3: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: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


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


Re: Old example?

Posted by "Richard S. Hall" <he...@ungoverned.org>.
I will try to update these examples today or tomorrow. Thanks for 
reporting the issue. In the meantime, checkout:

     
http://felix.apache.org/site/apache-felix-framework-launching-and-embedding.html

This explains the new framework API.

-> richard

On 5/26/09 3: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: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>    

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


Re: Old example?

Posted by "Richard S. Hall" <he...@ungoverned.org>.
FYI, I have committed versions of the examples that work with the 1.8.0 
framework release...

-> richard

On 5/26/09 3: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: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>    

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


Re: Old example?

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
You can take a look at the ASF's not quite final license policy:
http://www.apache.org/legal/3party.html
Although it's not formally finalized, it is essentially in use as
presented today and it shows the license environment as it presents
itself to us.

The Free Software Foundation comes from a different viewpoint. The
following page gives a glimpse at their perspective:
http://www.gnu.org/licenses/quick-guide-gplv3.html

In the end, when choosing a license, you have to ask yourself what you
want to accomplish. But going into any detail about this here is
off-topic for this list. I'm sure there are lots of additional resources
on the net.

On 26.05.2009 19:53:13 Eelco Meuter wrote:
> Thanks for the comment. I'll look into that and will adapt the eclipse  
> template and present references if necessary. Feel free to use the  
> given example. The overall project of which the snippet was taken is  
> under development and the license discussion still has to start. Are  
> there any good web sites to provide a good comparison between suitable  
> licenses that are compatible with Felix?
> 
> Eelco
> 
> On May 26, 2009, at 7:23 PM, Jeremias Maerki wrote:
> 
> > Depends. ALv2 + GPL = GPL. If you're working in a GPL environment  
> > that's
> > not a problem. But GPL in the ASF is a no go.
> >
> > On 26.05.2009 16:40:46 Richard S. Hall wrote:
> >> GPL and Apache aren't compatible, are they?
> >>
> >> -> richard
> > <snip/>
> >
> >


Jeremias Maerki


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


Re: Old example?

Posted by Eelco Meuter <ee...@wur.nl>.
Thanks for the comment. I'll look into that and will adapt the eclipse  
template and present references if necessary. Feel free to use the  
given example. The overall project of which the snippet was taken is  
under development and the license discussion still has to start. Are  
there any good web sites to provide a good comparison between suitable  
licenses that are compatible with Felix?

Eelco

On May 26, 2009, at 7:23 PM, Jeremias Maerki wrote:

> Depends. ALv2 + GPL = GPL. If you're working in a GPL environment  
> that's
> not a problem. But GPL in the ASF is a no go.
>
> On 26.05.2009 16:40:46 Richard S. Hall wrote:
>> GPL and Apache aren't compatible, are they?
>>
>> -> richard
> <snip/>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Wageningen University
Plant Production Systems
P.O. Box 430
6700 AK WAGENINGEN
The Netherlands
http://www.pps.wur.nl






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


Re: Old example?

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Depends. ALv2 + GPL = GPL. If you're working in a GPL environment that's
not a problem. But GPL in the ASF is a no go.

On 26.05.2009 16:40:46 Richard S. Hall wrote:
> GPL and Apache aren't compatible, are they?
> 
> -> richard
<snip/> 


Jeremias Maerki


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


Re: Old example?

Posted by "Richard S. Hall" <he...@ungoverned.org>.
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: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>
> Wageningen University
> Plant Production Systems
> P.O. Box 430
> 6700 AK WAGENINGEN
> The Netherlands
> http://www.pps.wur.nl
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

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


Re: Old example?

Posted by Eelco Meuter <ee...@wur.nl>.
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: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Wageningen University
Plant Production Systems
P.O. Box 430
6700 AK WAGENINGEN
The Netherlands
http://www.pps.wur.nl






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