felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michiel Vermandel <mverm...@yahoo.com>
Subject Re: [iPOJO] constructor with BundleContext issue
Date Thu, 25 Apr 2013 19:47:28 GMT
O-o, no I did not.
Now I do and it works!
Thank you so much!

 
-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at http://twitter.com/#!/Codessentials


________________________________
 From: Richard S. Hall <heavy@ungoverned.org>
To: users@felix.apache.org 
Sent: Thursday, April 25, 2013 9:26 PM
Subject: Re: [iPOJO] constructor with BundleContext issue
 

If I recall, you have your own build system...are you importing the 
org.osgi.framework package in your bundle?

-> richard

On 4/25/13 15:19 , Michiel Vermandel wrote:
> Hi,
>
> I have a simple pojo annotated with iPOJO.
>
> This works:
>
> package com.ce.flowbeans.impl;
>
> import org.apache.felix.ipojo.annotations.Component;
> import org.apache.felix.ipojo.annotations.Instantiate;
> import org.apache.felix.ipojo.annotations.Provides;
> import org.apache.felix.ipojo.annotations.Validate;
>
> import com.ce.flowbeans.spi.FlowAdmin;
>
> @Component
> @Instantiate
> @Provides
> public class FlowAdminImpl implements FlowAdmin {
>      
>      public FlowAdminImpl(){
>          System.out.println("Instantiated");
>      }
>      
>      @Override
>      public void sayHello() {
>          System.out.println("I say hello");
>      }
>      
>      @Validate
>      public void starts(){
>          System.out.println("Started");
>      }
>      
> }
>
> I get
>
>  
>   Instantiated
>   Started
>
>
> But when I use a constructor with the BundleContext, the component is not instantiated
nor started.
> It is also not listed in the iPOJO instances:
>
> package com.ce.flowbeans.impl;
>
> import org.apache.felix.ipojo.annotations.Component;
> import org.apache.felix.ipojo.annotations.Instantiate;
> import org.apache.felix.ipojo.annotations.Provides;
> import org.apache.felix.ipojo.annotations.Validate;
> import org.osgi.framework.BundleContext;
>
> import com.ce.flowbeans.spi.FlowAdmin;
>
> @Component
> @Instantiate
> @Provides
> public class FlowAdminImpl implements FlowAdmin {
>      
>      public FlowAdminImpl(BundleContext context){
>          System.out.println("Instanciated");
>      }
>      
>      @Override
>      public void sayHello() {
>          System.out.println("I say hello");
>      }
>      
>      @Validate
>      public void starts(){
>          System.out.println("Started");
>      }
>      
> }
>
> what can be the cause of this?
>
> Thanks!
>
>  
> -----------------
> http://www.codessentials.com - Your essential software, for free!
> Follow us at http://twitter.com/#!/Codessentials


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message