You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Michiel Vermandel <mv...@yahoo.com> on 2013/05/02 17:10:18 UTC

[iPOJO] using External Handler

Hi,

In my previous post I mentioned an issue with my custom annotations.
Now I'm trying to write a iPOJO Handler to inject these dependencies.

I have created a class implementing PrimitiveHandler:

@Handler(name = "Channel", namespace = "com.ce.flowbeans.channels")
public class EventChannelHandler extends PrimitiveHandler {

I have implemented the required methods, but have only put some system.out for the moment.

I also have my annotation @Channel in the package "com.ce.flowbeans.channels".

When I startup the framework I see the handler: 

>handlers
Handler org.apache.felix.ipojo:properties (VALID)
Handler org.apache.felix.ipojo:requires (VALID)
Handler org.apache.felix.ipojo:architecture (VALID)
Handler org.apache.felix.ipojo:callback (VALID)
Handler org.apache.felix.ipojo:controller (VALID)
Handler org.apache.felix.ipojo:provides (VALID)
Handler com.ce.flowbeans.channels:Channel (VALID)    <==

But when a field in a component is annotated with the @Channel annotation, it gets not injected.
Neither do I see any call to the initializeComponentFactory(...) or configure(...) or start() methods of the handler.

Do I need to specifically attach the handler to the component instance in some way?

Thanks

  

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

Fw: [iPOJO] using External Handler

Posted by Michiel Vermandel <mv...@yahoo.com>.

Hi,


Yes everything is valid:

Handler com.ce.flowbeans.channels:Channel (VALID)    
Factory com.ce.flowbeans.io.DeviceService (VALID) 

Instance com.ce.flowbeans.io.DeviceService-0 -> valid 


The issue is, I think, that the Handler is simply never called.
I have put some System.out in the constructor and the start method, but I do not see these comments in the console...

Any ideas?

Thnaks


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


________________________________
 From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
To: users@felix.apache.org; Michiel Vermandel <mv...@yahoo.com> 
Sent: Thursday, May 2, 2013 8:43 PM
Subject: Re: [iPOJO] using External Handler
 


If you take a look at the details of the instance (ipojo:instance <name>), what do you see ?
Is the factory of your component valid ?


--G



2013/5/2 Michiel Vermandel <mv...@yahoo.com>

Hi,
>
>In my previous post I mentioned an issue with my custom annotations.
>Now I'm trying to write a iPOJO Handler to inject these dependencies.
>
>I have created a class implementing PrimitiveHandler:
>
>@Handler(name = "Channel", namespace = "com.ce.flowbeans.channels")
>public class EventChannelHandler extends PrimitiveHandler {
>
>I have implemented the required methods, but have only put some system.out for the moment.
>
>I also have my annotation @Channel in the package "com.ce.flowbeans.channels".
>
>When I startup the framework I see the handler:
>
>>handlers
>Handler org.apache.felix.ipojo:properties (VALID)
>Handler org.apache.felix.ipojo:requires (VALID)
>Handler org.apache.felix.ipojo:architecture (VALID)
>Handler org.apache.felix.ipojo:callback (VALID)
>Handler org.apache.felix.ipojo:controller (VALID)
>Handler org.apache.felix.ipojo:provides (VALID)
>Handler com.ce.flowbeans.channels:Channel (VALID)    <==
>
>But when a field in a component is annotated with the @Channel annotation, it gets not injected.
>Neither do I see any call to the initializeComponentFactory(...) or configure(...) or start() methods of the handler.
>
>Do I need to specifically attach the handler to the component instance in some way?
>
>Thanks
>
> 
>
>-----------------
>http://www.codessentials.com - Your essential software, for free!
>Follow us at http://twitter.com/#!/Codessentials

Re: [iPOJO] using External Handler

Posted by "Guillaume Sauthier (OW2/GMail)" <gu...@gmail.com>.
If you take a look at the details of the instance (ipojo:instance <name>),
what do you see ?
Is the factory of your component valid ?

--G


2013/5/2 Michiel Vermandel <mv...@yahoo.com>

> Hi,
>
> In my previous post I mentioned an issue with my custom annotations.
> Now I'm trying to write a iPOJO Handler to inject these dependencies.
>
> I have created a class implementing PrimitiveHandler:
>
> @Handler(name = "Channel", namespace = "com.ce.flowbeans.channels")
> public class EventChannelHandler extends PrimitiveHandler {
>
> I have implemented the required methods, but have only put some system.out
> for the moment.
>
> I also have my annotation @Channel in the package
> "com.ce.flowbeans.channels".
>
> When I startup the framework I see the handler:
>
> >handlers
> Handler org.apache.felix.ipojo:properties (VALID)
> Handler org.apache.felix.ipojo:requires (VALID)
> Handler org.apache.felix.ipojo:architecture (VALID)
> Handler org.apache.felix.ipojo:callback (VALID)
> Handler org.apache.felix.ipojo:controller (VALID)
> Handler org.apache.felix.ipojo:provides (VALID)
> Handler com.ce.flowbeans.channels:Channel (VALID)    <==
>
> But when a field in a component is annotated with the @Channel annotation,
> it gets not injected.
> Neither do I see any call to the initializeComponentFactory(...) or
> configure(...) or start() methods of the handler.
>
> Do I need to specifically attach the handler to the component instance in
> some way?
>
> Thanks
>
>
>
> -----------------
> http://www.codessentials.com - Your essential software, for free!
> Follow us at http://twitter.com/#!/Codessentials

Re: [iPOJO] using External Handler

Posted by Michiel Vermandel <mv...@yahoo.com>.
Hi,

I have no clue why but today my custom handler is working with iPOJO 1.8.6.
I even removed the custom annotation on class level.
I must have gotten something wrong or out of sync the other day.
Thanks for the tips and the support.
I'm on my way again :-)

Regards,

Michiel

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


________________________________
 From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
To: users@felix.apache.org 
Sent: Friday, May 3, 2013 1:45 PM
Subject: Re: [iPOJO] using External Handler
 

Can you make a try with latest manipulator : 1.9.0-SNAPSHOT ?


2013/5/3 Michiel Vermandel <mv...@yahoo.com>

> Hi,
>
> No the factory description did not change:
>
> g! Factory com.ce.flowbeans.io.DeviceService
> factory name="com.ce.flowbeans.io.DeviceService" bundle="30" state="valid"
> implementation-class="com.ce.flowbeans.io.DeviceService"
>     requiredhandlers list="[org.apache.felix.ipojo:requires,
> org.apache.felix.ipojo:callback, org.apache.felix.ipojo:provides,
> org.apache.felix.ipojo:architecture]"
>     missinghandlers list="[]"
>     provides specification="com.ce.flowbeans.io.DeviceService"
>     inherited interfaces="[]" superclasses="[]"
>
> Manipulator: 1.8.6
>
>
> -----------------
> http://www.codessentials.com - Your essential software, for free!
> Follow us at http://twitter.com/#!/Codessentials
>
>
> ________________________________
>  From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
> To: users@felix.apache.org
> Sent: Friday, May 3, 2013 11:46 AM
> Subject: Re: [iPOJO] using External Handler
>
>
> The factory description did not change ?
> What is the manipulator version you're using ?
> --G
>
>
> 2013/5/3 Michiel Vermandel <mv...@yahoo.com>
>
> > I changed my Handler to this:
> >
> >    @Handler(name = "ScanCustom", namespace = "com.ce.flowbeans.channels")
> >    public class EventChannelHandler extends PrimitiveHandler {
> >
> > Created the new Annotation:
> >
> >    package com.ce.flowbeans.channels;
> >
> >    import java.lang.annotation.ElementType;
> >    import java.lang.annotation.Retention;
> >    import java.lang.annotation.RetentionPolicy;
> >    import java.lang.annotation.Target;
> >
> >    @Target(ElementType.TYPE)
> >    @Retention(RetentionPolicy.SOURCE)
> >    public @interface ScanCustom {}
> >
> > And changed my DeviceService class:
> >
> >    @Component
> >    @Provides
> >    @ScanCustom
> >    public class DeviceService{
> >
> >        public static final String
> > VOLUME_STATE_CHANGED="com/ce/flowbeans/io/VOLUME_STATE_CHANGED";
> >
> >       private DeviceWatcher deviceWatcher = null;
> >
> >        @Requires
> >       EventService flowService;
> >
> >        @Channel(payload = DeviceBean.class, topic = VOLUME_STATE_CHANGED)
> >       EventSender volumeStateChanged;
> >
> >        ...
> >     }
> >
> > No change however...
> >
> >
> > -----------------
> > http://www.codessentials.com - Your essential software, for free!
> > Follow us at http://twitter.com/#!/Codessentials
> >
> >
> > ________________________________
> >  From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
> > To: users@felix.apache.org
> > Sent: Friday, May 3, 2013 10:48 AM
> > Subject: Re: [iPOJO] using External Handler
> >
> >
> > Looking at your factory description, you can see that your handler is not
> > in the required handler's list.
> >
> > Hmm I think I got it.
> >
> > This is probably because of FELIX-3889
> > Runtime visible annotations cannot be iPOJO handler's markers.
> >
> > Maybe you can simply have a class level marker annotation (not runtime
> > visible, probably no attributes, depending on what you need to read in
> your
> > handler). this annotation will enable your own handler.
> > And this handler will be able to read your own @Channel annotation
> >
> >
> > https://issues.apache.org/jira/browse/FELIX-3889
> >
> >
> > 2013/5/3 Michiel Vermandel <mv...@yahoo.com>
> >
> > > Handler com.ce.flowbeans.channels:Channel  (VALID)
> > >
> > > @Component
> > > @Provides
> > > public class DeviceService{
> > >
> > >     public static final String
> > > VOLUME_STATE_CHANGED="com/ce/flowbeans/io/VOLUME_STATE_CHANGED";
> > >
> > >     private DeviceWatcher deviceWatcher = null;
> > >
> > >     @Requires
> > >     EventService flowService;
> > >
> > >     @Channel(payload = DeviceBean.class, topic = VOLUME_STATE_CHANGED)
> > >     EventSender volumeStateChanged;
> > >
> > > ...
> > > }
> > >
> > >
> > > g! Factory com.ce.flowbeans.io.DeviceService
> > > factory name="com.ce.flowbeans.io.DeviceService" bundle="30"
> > state="valid"
> > > implementation-class="com.ce.flowbeans.io.DeviceService"
> > >     requiredhandlers list="[org.apache.felix.ipojo:requires,
> > > org.apache.felix.ipojo:callback, org.apache.felix.ipojo:provides,
> > > org.apache.felix.ipojo:architecture]"
> > >     missinghandlers list="[]"
> > >     provides specification="com.ce.flowbeans.io.DeviceService"
> > >     inherited interfaces="[]" superclasses="[]"
> > >
> > > g! Instance com.ce.flowbeans.io.DeviceService-0
> > > instance name="com.ce.flowbeans.io.DeviceService-0" state="valid"
> > > bundle="30" component.type="com.ce.flowbeans.io.DeviceService"
> > >     handler name="org.apache.felix.ipojo:requires" state="valid"
> > >         requires specification="com.ce.flowbeans.EventService"
> > > id="com.ce.flowbeans.EventService" optional="false" aggregate="false"
> > > proxy="true" binding-policy="dynamic" state="resolved"
> > >     handler name="org.apache.felix.ipojo:callback" state="valid"
> > >     handler name="org.apache.felix.ipojo:provides" state="valid"
> > >         provides specifications="[com.ce.flowbeans.io.DeviceService]"
> > > state="registered" service.id="59"
> > >             property name="factory.name"
> > > value="com.ce.flowbeans.io.DeviceService"
> > >             property name="instance.name"
> > > value="com.ce.flowbeans.io.DeviceService-0"
> > >     handler name="org.apache.felix.ipojo:architecture" state="valid"
> > >     object name="com.ce.flowbeans.io.DeviceService@662f743b"
> > >
> > >
> > > -----------------
> > > http://www.codessentials.com - Your essential software, for free!
> > > Follow us at http://twitter.com/#!/Codessentials
> > >
> > >
> > > ________________________________
> > >  From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
> > > To: users@felix.apache.org
> > > Sent: Friday, May 3, 2013 10:11 AM
> > > Subject: Re: [iPOJO] using External Handler
> > >
> > >
> > > Can you show me the details of the following commands:
> > > >$ factory com.ce.flowbeans.io.DeviceService
> > > >$ instance com.ce.flowbeans.io.DeviceService-0
> > >
> > > Thanks
> > >
> > >
> > > 2013/5/3 Michiel Vermandel <mv...@yahoo.com>
> > >
> > > > Hi,
> > > >
> > > >
> > > > I did not do that yet.
> > > > I just wanted to see the Handler getting invoked.
> > > > I have added a System.out in the constructor of the handler and in
> the
> > > > start method but I do not see any of these comments in the console.
> > > >
> > > > When exactly is/should the Handler be instantiated?
> > > >
> > > > Thanks
> > > >
> > > > -----------------
> > > > http://www.codessentials.com - Your essential software, for free!
> > > > Follow us at http://twitter.com/#!/Codessentials
> > > >
> > > >
> > > > ________________________________
> > > >  From: Clement Escoffier <cl...@gmail.com>
> > > > To: users@felix.apache.org; Michiel Vermandel <mv...@yahoo.com>
> > > > Sent: Thursday, May 2, 2013 8:06 PM
> > > > Subject: Re: [iPOJO] using External Handler
> > > >
> > > >
> > > > Hi,
> > > >
> > > > Did you implement the configure method and parsed the given metadata
> ?
> > > You
> > > > must register a field interceptor for each field you need to inject.
> > > >
> > > > Regards,
> > > >
> > > > Clement
> > > >
> > > > On 2 mai 2013, at 17:10, Michiel Vermandel <mv...@yahoo.com>
> wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > In my previous post I mentioned an issue with my custom
> annotations.
> > > > > Now I'm trying to write a iPOJO Handler to inject these
> dependencies.
> > > > >
> > > > > I have created a class implementing PrimitiveHandler:
> > > > >
> > > > > @Handler(name = "Channel", namespace = "com.ce.flowbeans.channels")
> > > > > public class EventChannelHandler extends PrimitiveHandler {
> > > > >
> > > > > I have implemented the required methods, but have only put some
> > > > system.out for the moment.
> > > > >
> > > > > I also have my annotation @Channel in the package
> > > > "com.ce.flowbeans.channels".
> > > > >
> > > > > When I startup the framework I see the handler:
> > > > >
> > > > >> handlers
> > > > > Handler org.apache.felix.ipojo:properties (VALID)
> > > > > Handler org.apache.felix.ipojo:requires (VALID)
> > > > > Handler org.apache.felix.ipojo:architecture (VALID)
> > > > > Handler
> > > >  org.apache.felix.ipojo:callback (VALID)
> > > > > Handler org.apache.felix.ipojo:controller (VALID)
> > > > > Handler org.apache.felix.ipojo:provides (VALID)
> > > > > Handler com.ce.flowbeans.channels:Channel (VALID)    <==
> > > > >
> > > > > But when a field in a component is annotated with the @Channel
> > > > annotation, it gets not injected.
> > > > > Neither do I see any call to the initializeComponentFactory(...) or
> > > > configure(...) or start() methods of the handler.
> > > > >
> > > > > Do I need to specifically attach the handler to the component
> > instance
> > > > in some way?
> > > > >
> > > > > Thanks
> > > > >
> > > > >
> > > > >
> > > > > -----------------
> > > > > http://www.codessentials.com - Your essential software, for free!
> > > > > Follow us at http://twitter.com/#!/Codessentials
> > > >
> > >
> >
>

Re: [iPOJO] using External Handler

Posted by Michiel Vermandel <mv...@yahoo.com>.
Hi,

I'll try, but it will probably be after the weekend.
Thanks already for the assistance!

Michiel

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


________________________________
 From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
To: users@felix.apache.org 
Sent: Friday, May 3, 2013 1:45 PM
Subject: Re: [iPOJO] using External Handler
 

Can you make a try with latest manipulator : 1.9.0-SNAPSHOT ?


2013/5/3 Michiel Vermandel <mv...@yahoo.com>

> Hi,
>
> No the factory description did not change:
>
> g! Factory com.ce.flowbeans.io.DeviceService
> factory name="com.ce.flowbeans.io.DeviceService" bundle="30" state="valid"
> implementation-class="com.ce.flowbeans.io.DeviceService"
>     requiredhandlers list="[org.apache.felix.ipojo:requires,
> org.apache.felix.ipojo:callback, org.apache.felix.ipojo:provides,
> org.apache.felix.ipojo:architecture]"
>     missinghandlers list="[]"
>     provides specification="com.ce.flowbeans.io.DeviceService"
>     inherited interfaces="[]" superclasses="[]"
>
> Manipulator: 1.8.6
>
>
> -----------------
> http://www.codessentials.com - Your essential software, for free!
> Follow us at http://twitter.com/#!/Codessentials
>
>
> ________________________________
>  From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
> To: users@felix.apache.org
> Sent: Friday, May 3, 2013 11:46 AM
> Subject: Re: [iPOJO] using External Handler
>
>
> The factory description did not change ?
> What is the manipulator version you're using ?
> --G
>
>
> 2013/5/3 Michiel Vermandel <mv...@yahoo.com>
>
> > I changed my Handler to this:
> >
> >    @Handler(name = "ScanCustom", namespace = "com.ce.flowbeans.channels")
> >    public class EventChannelHandler extends PrimitiveHandler {
> >
> > Created the new Annotation:
> >
> >    package com.ce.flowbeans.channels;
> >
> >    import java.lang.annotation.ElementType;
> >    import java.lang.annotation.Retention;
> >    import java.lang.annotation.RetentionPolicy;
> >    import java.lang.annotation.Target;
> >
> >    @Target(ElementType.TYPE)
> >    @Retention(RetentionPolicy.SOURCE)
> >    public @interface ScanCustom {}
> >
> > And changed my DeviceService class:
> >
> >    @Component
> >    @Provides
> >    @ScanCustom
> >    public class DeviceService{
> >
> >        public static final String
> > VOLUME_STATE_CHANGED="com/ce/flowbeans/io/VOLUME_STATE_CHANGED";
> >
> >       private DeviceWatcher deviceWatcher = null;
> >
> >        @Requires
> >       EventService flowService;
> >
> >        @Channel(payload = DeviceBean.class, topic = VOLUME_STATE_CHANGED)
> >       EventSender volumeStateChanged;
> >
> >        ...
> >     }
> >
> > No change however...
> >
> >
> > -----------------
> > http://www.codessentials.com - Your essential software, for free!
> > Follow us at http://twitter.com/#!/Codessentials
> >
> >
> > ________________________________
> >  From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
> > To: users@felix.apache.org
> > Sent: Friday, May 3, 2013 10:48 AM
> > Subject: Re: [iPOJO] using External Handler
> >
> >
> > Looking at your factory description, you can see that your handler is not
> > in the required handler's list.
> >
> > Hmm I think I got it.
> >
> > This is probably because of FELIX-3889
> > Runtime visible annotations cannot be iPOJO handler's markers.
> >
> > Maybe you can simply have a class level marker annotation (not runtime
> > visible, probably no attributes, depending on what you need to read in
> your
> > handler). this annotation will enable your own handler.
> > And this handler will be able to read your own @Channel annotation
> >
> >
> > https://issues.apache.org/jira/browse/FELIX-3889
> >
> >
> > 2013/5/3 Michiel Vermandel <mv...@yahoo.com>
> >
> > > Handler com.ce.flowbeans.channels:Channel  (VALID)
> > >
> > > @Component
> > > @Provides
> > > public class DeviceService{
> > >
> > >     public static final String
> > > VOLUME_STATE_CHANGED="com/ce/flowbeans/io/VOLUME_STATE_CHANGED";
> > >
> > >     private DeviceWatcher deviceWatcher = null;
> > >
> > >     @Requires
> > >     EventService flowService;
> > >
> > >     @Channel(payload = DeviceBean.class, topic = VOLUME_STATE_CHANGED)
> > >     EventSender volumeStateChanged;
> > >
> > > ...
> > > }
> > >
> > >
> > > g! Factory com.ce.flowbeans.io.DeviceService
> > > factory name="com.ce.flowbeans.io.DeviceService" bundle="30"
> > state="valid"
> > > implementation-class="com.ce.flowbeans.io.DeviceService"
> > >     requiredhandlers list="[org.apache.felix.ipojo:requires,
> > > org.apache.felix.ipojo:callback, org.apache.felix.ipojo:provides,
> > > org.apache.felix.ipojo:architecture]"
> > >     missinghandlers list="[]"
> > >     provides specification="com.ce.flowbeans.io.DeviceService"
> > >     inherited interfaces="[]" superclasses="[]"
> > >
> > > g! Instance com.ce.flowbeans.io.DeviceService-0
> > > instance name="com.ce.flowbeans.io.DeviceService-0" state="valid"
> > > bundle="30" component.type="com.ce.flowbeans.io.DeviceService"
> > >     handler name="org.apache.felix.ipojo:requires" state="valid"
> > >         requires specification="com.ce.flowbeans.EventService"
> > > id="com.ce.flowbeans.EventService" optional="false" aggregate="false"
> > > proxy="true" binding-policy="dynamic" state="resolved"
> > >     handler name="org.apache.felix.ipojo:callback" state="valid"
> > >     handler name="org.apache.felix.ipojo:provides" state="valid"
> > >         provides specifications="[com.ce.flowbeans.io.DeviceService]"
> > > state="registered" service.id="59"
> > >             property name="factory.name"
> > > value="com.ce.flowbeans.io.DeviceService"
> > >             property name="instance.name"
> > > value="com.ce.flowbeans.io.DeviceService-0"
> > >     handler name="org.apache.felix.ipojo:architecture" state="valid"
> > >     object name="com.ce.flowbeans.io.DeviceService@662f743b"
> > >
> > >
> > > -----------------
> > > http://www.codessentials.com - Your essential software, for free!
> > > Follow us at http://twitter.com/#!/Codessentials
> > >
> > >
> > > ________________________________
> > >  From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
> > > To: users@felix.apache.org
> > > Sent: Friday, May 3, 2013 10:11 AM
> > > Subject: Re: [iPOJO] using External Handler
> > >
> > >
> > > Can you show me the details of the following commands:
> > > >$ factory com.ce.flowbeans.io.DeviceService
> > > >$ instance com.ce.flowbeans.io.DeviceService-0
> > >
> > > Thanks
> > >
> > >
> > > 2013/5/3 Michiel Vermandel <mv...@yahoo.com>
> > >
> > > > Hi,
> > > >
> > > >
> > > > I did not do that yet.
> > > > I just wanted to see the Handler getting invoked.
> > > > I have added a System.out in the constructor of the handler and in
> the
> > > > start method but I do not see any of these comments in the console.
> > > >
> > > > When exactly is/should the Handler be instantiated?
> > > >
> > > > Thanks
> > > >
> > > > -----------------
> > > > http://www.codessentials.com - Your essential software, for free!
> > > > Follow us at http://twitter.com/#!/Codessentials
> > > >
> > > >
> > > > ________________________________
> > > >  From: Clement Escoffier <cl...@gmail.com>
> > > > To: users@felix.apache.org; Michiel Vermandel <mv...@yahoo.com>
> > > > Sent: Thursday, May 2, 2013 8:06 PM
> > > > Subject: Re: [iPOJO] using External Handler
> > > >
> > > >
> > > > Hi,
> > > >
> > > > Did you implement the configure method and parsed the given metadata
> ?
> > > You
> > > > must register a field interceptor for each field you need to inject.
> > > >
> > > > Regards,
> > > >
> > > > Clement
> > > >
> > > > On 2 mai 2013, at 17:10, Michiel Vermandel <mv...@yahoo.com>
> wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > In my previous post I mentioned an issue with my custom
> annotations.
> > > > > Now I'm trying to write a iPOJO Handler to inject these
> dependencies.
> > > > >
> > > > > I have created a class implementing PrimitiveHandler:
> > > > >
> > > > > @Handler(name = "Channel", namespace = "com.ce.flowbeans.channels")
> > > > > public class EventChannelHandler extends PrimitiveHandler {
> > > > >
> > > > > I have implemented the required methods, but have only put some
> > > > system.out for the moment.
> > > > >
> > > > > I also have my annotation @Channel in the package
> > > > "com.ce.flowbeans.channels".
> > > > >
> > > > > When I startup the framework I see the handler:
> > > > >
> > > > >> handlers
> > > > > Handler org.apache.felix.ipojo:properties (VALID)
> > > > > Handler org.apache.felix.ipojo:requires (VALID)
> > > > > Handler org.apache.felix.ipojo:architecture (VALID)
> > > > > Handler
> > > >  org.apache.felix.ipojo:callback (VALID)
> > > > > Handler org.apache.felix.ipojo:controller (VALID)
> > > > > Handler org.apache.felix.ipojo:provides (VALID)
> > > > > Handler com.ce.flowbeans.channels:Channel (VALID)    <==
> > > > >
> > > > > But when a field in a component is annotated with the @Channel
> > > > annotation, it gets not injected.
> > > > > Neither do I see any call to the initializeComponentFactory(...) or
> > > > configure(...) or start() methods of the handler.
> > > > >
> > > > > Do I need to specifically attach the handler to the component
> > instance
> > > > in some way?
> > > > >
> > > > > Thanks
> > > > >
> > > > >
> > > > >
> > > > > -----------------
> > > > > http://www.codessentials.com - Your essential software, for free!
> > > > > Follow us at http://twitter.com/#!/Codessentials
> > > >
> > >
> >
>

Re: [iPOJO] using External Handler

Posted by "Guillaume Sauthier (OW2/GMail)" <gu...@gmail.com>.
Can you make a try with latest manipulator : 1.9.0-SNAPSHOT ?


2013/5/3 Michiel Vermandel <mv...@yahoo.com>

> Hi,
>
> No the factory description did not change:
>
> g! Factory com.ce.flowbeans.io.DeviceService
> factory name="com.ce.flowbeans.io.DeviceService" bundle="30" state="valid"
> implementation-class="com.ce.flowbeans.io.DeviceService"
>     requiredhandlers list="[org.apache.felix.ipojo:requires,
> org.apache.felix.ipojo:callback, org.apache.felix.ipojo:provides,
> org.apache.felix.ipojo:architecture]"
>     missinghandlers list="[]"
>     provides specification="com.ce.flowbeans.io.DeviceService"
>     inherited interfaces="[]" superclasses="[]"
>
> Manipulator: 1.8.6
>
>
> -----------------
> http://www.codessentials.com - Your essential software, for free!
> Follow us at http://twitter.com/#!/Codessentials
>
>
> ________________________________
>  From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
> To: users@felix.apache.org
> Sent: Friday, May 3, 2013 11:46 AM
> Subject: Re: [iPOJO] using External Handler
>
>
> The factory description did not change ?
> What is the manipulator version you're using ?
> --G
>
>
> 2013/5/3 Michiel Vermandel <mv...@yahoo.com>
>
> > I changed my Handler to this:
> >
> >    @Handler(name = "ScanCustom", namespace = "com.ce.flowbeans.channels")
> >    public class EventChannelHandler extends PrimitiveHandler {
> >
> > Created the new Annotation:
> >
> >    package com.ce.flowbeans.channels;
> >
> >    import java.lang.annotation.ElementType;
> >    import java.lang.annotation.Retention;
> >    import java.lang.annotation.RetentionPolicy;
> >    import java.lang.annotation.Target;
> >
> >    @Target(ElementType.TYPE)
> >    @Retention(RetentionPolicy.SOURCE)
> >    public @interface ScanCustom {}
> >
> > And changed my DeviceService class:
> >
> >    @Component
> >    @Provides
> >    @ScanCustom
> >    public class DeviceService{
> >
> >        public static final String
> > VOLUME_STATE_CHANGED="com/ce/flowbeans/io/VOLUME_STATE_CHANGED";
> >
> >       private DeviceWatcher deviceWatcher = null;
> >
> >        @Requires
> >       EventService flowService;
> >
> >        @Channel(payload = DeviceBean.class, topic = VOLUME_STATE_CHANGED)
> >       EventSender volumeStateChanged;
> >
> >        ...
> >     }
> >
> > No change however...
> >
> >
> > -----------------
> > http://www.codessentials.com - Your essential software, for free!
> > Follow us at http://twitter.com/#!/Codessentials
> >
> >
> > ________________________________
> >  From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
> > To: users@felix.apache.org
> > Sent: Friday, May 3, 2013 10:48 AM
> > Subject: Re: [iPOJO] using External Handler
> >
> >
> > Looking at your factory description, you can see that your handler is not
> > in the required handler's list.
> >
> > Hmm I think I got it.
> >
> > This is probably because of FELIX-3889
> > Runtime visible annotations cannot be iPOJO handler's markers.
> >
> > Maybe you can simply have a class level marker annotation (not runtime
> > visible, probably no attributes, depending on what you need to read in
> your
> > handler). this annotation will enable your own handler.
> > And this handler will be able to read your own @Channel annotation
> >
> >
> > https://issues.apache.org/jira/browse/FELIX-3889
> >
> >
> > 2013/5/3 Michiel Vermandel <mv...@yahoo.com>
> >
> > > Handler com.ce.flowbeans.channels:Channel  (VALID)
> > >
> > > @Component
> > > @Provides
> > > public class DeviceService{
> > >
> > >     public static final String
> > > VOLUME_STATE_CHANGED="com/ce/flowbeans/io/VOLUME_STATE_CHANGED";
> > >
> > >     private DeviceWatcher deviceWatcher = null;
> > >
> > >     @Requires
> > >     EventService flowService;
> > >
> > >     @Channel(payload = DeviceBean.class, topic = VOLUME_STATE_CHANGED)
> > >     EventSender volumeStateChanged;
> > >
> > > ...
> > > }
> > >
> > >
> > > g! Factory com.ce.flowbeans.io.DeviceService
> > > factory name="com.ce.flowbeans.io.DeviceService" bundle="30"
> > state="valid"
> > > implementation-class="com.ce.flowbeans.io.DeviceService"
> > >     requiredhandlers list="[org.apache.felix.ipojo:requires,
> > > org.apache.felix.ipojo:callback, org.apache.felix.ipojo:provides,
> > > org.apache.felix.ipojo:architecture]"
> > >     missinghandlers list="[]"
> > >     provides specification="com.ce.flowbeans.io.DeviceService"
> > >     inherited interfaces="[]" superclasses="[]"
> > >
> > > g! Instance com.ce.flowbeans.io.DeviceService-0
> > > instance name="com.ce.flowbeans.io.DeviceService-0" state="valid"
> > > bundle="30" component.type="com.ce.flowbeans.io.DeviceService"
> > >     handler name="org.apache.felix.ipojo:requires" state="valid"
> > >         requires specification="com.ce.flowbeans.EventService"
> > > id="com.ce.flowbeans.EventService" optional="false" aggregate="false"
> > > proxy="true" binding-policy="dynamic" state="resolved"
> > >     handler name="org.apache.felix.ipojo:callback" state="valid"
> > >     handler name="org.apache.felix.ipojo:provides" state="valid"
> > >         provides specifications="[com.ce.flowbeans.io.DeviceService]"
> > > state="registered" service.id="59"
> > >             property name="factory.name"
> > > value="com.ce.flowbeans.io.DeviceService"
> > >             property name="instance.name"
> > > value="com.ce.flowbeans.io.DeviceService-0"
> > >     handler name="org.apache.felix.ipojo:architecture" state="valid"
> > >     object name="com.ce.flowbeans.io.DeviceService@662f743b"
> > >
> > >
> > > -----------------
> > > http://www.codessentials.com - Your essential software, for free!
> > > Follow us at http://twitter.com/#!/Codessentials
> > >
> > >
> > > ________________________________
> > >  From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
> > > To: users@felix.apache.org
> > > Sent: Friday, May 3, 2013 10:11 AM
> > > Subject: Re: [iPOJO] using External Handler
> > >
> > >
> > > Can you show me the details of the following commands:
> > > >$ factory com.ce.flowbeans.io.DeviceService
> > > >$ instance com.ce.flowbeans.io.DeviceService-0
> > >
> > > Thanks
> > >
> > >
> > > 2013/5/3 Michiel Vermandel <mv...@yahoo.com>
> > >
> > > > Hi,
> > > >
> > > >
> > > > I did not do that yet.
> > > > I just wanted to see the Handler getting invoked.
> > > > I have added a System.out in the constructor of the handler and in
> the
> > > > start method but I do not see any of these comments in the console.
> > > >
> > > > When exactly is/should the Handler be instantiated?
> > > >
> > > > Thanks
> > > >
> > > > -----------------
> > > > http://www.codessentials.com - Your essential software, for free!
> > > > Follow us at http://twitter.com/#!/Codessentials
> > > >
> > > >
> > > > ________________________________
> > > >  From: Clement Escoffier <cl...@gmail.com>
> > > > To: users@felix.apache.org; Michiel Vermandel <mv...@yahoo.com>
> > > > Sent: Thursday, May 2, 2013 8:06 PM
> > > > Subject: Re: [iPOJO] using External Handler
> > > >
> > > >
> > > > Hi,
> > > >
> > > > Did you implement the configure method and parsed the given metadata
> ?
> > > You
> > > > must register a field interceptor for each field you need to inject.
> > > >
> > > > Regards,
> > > >
> > > > Clement
> > > >
> > > > On 2 mai 2013, at 17:10, Michiel Vermandel <mv...@yahoo.com>
> wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > In my previous post I mentioned an issue with my custom
> annotations.
> > > > > Now I'm trying to write a iPOJO Handler to inject these
> dependencies.
> > > > >
> > > > > I have created a class implementing PrimitiveHandler:
> > > > >
> > > > > @Handler(name = "Channel", namespace = "com.ce.flowbeans.channels")
> > > > > public class EventChannelHandler extends PrimitiveHandler {
> > > > >
> > > > > I have implemented the required methods, but have only put some
> > > > system.out for the moment.
> > > > >
> > > > > I also have my annotation @Channel in the package
> > > > "com.ce.flowbeans.channels".
> > > > >
> > > > > When I startup the framework I see the handler:
> > > > >
> > > > >> handlers
> > > > > Handler org.apache.felix.ipojo:properties (VALID)
> > > > > Handler org.apache.felix.ipojo:requires (VALID)
> > > > > Handler org.apache.felix.ipojo:architecture (VALID)
> > > > > Handler
> > > >  org.apache.felix.ipojo:callback (VALID)
> > > > > Handler org.apache.felix.ipojo:controller (VALID)
> > > > > Handler org.apache.felix.ipojo:provides (VALID)
> > > > > Handler com.ce.flowbeans.channels:Channel (VALID)    <==
> > > > >
> > > > > But when a field in a component is annotated with the @Channel
> > > > annotation, it gets not injected.
> > > > > Neither do I see any call to the initializeComponentFactory(...) or
> > > > configure(...) or start() methods of the handler.
> > > > >
> > > > > Do I need to specifically attach the handler to the component
> > instance
> > > > in some way?
> > > > >
> > > > > Thanks
> > > > >
> > > > >
> > > > >
> > > > > -----------------
> > > > > http://www.codessentials.com - Your essential software, for free!
> > > > > Follow us at http://twitter.com/#!/Codessentials
> > > >
> > >
> >
>

Re: [iPOJO] using External Handler

Posted by Michiel Vermandel <mv...@yahoo.com>.
Hi,

No the factory description did not change:

g! Factory com.ce.flowbeans.io.DeviceService
factory name="com.ce.flowbeans.io.DeviceService" bundle="30" state="valid" implementation-class="com.ce.flowbeans.io.DeviceService"
    requiredhandlers list="[org.apache.felix.ipojo:requires, org.apache.felix.ipojo:callback, org.apache.felix.ipojo:provides, org.apache.felix.ipojo:architecture]"
    missinghandlers list="[]"
    provides specification="com.ce.flowbeans.io.DeviceService"
    inherited interfaces="[]" superclasses="[]"

Manipulator: 1.8.6

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


________________________________
 From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
To: users@felix.apache.org 
Sent: Friday, May 3, 2013 11:46 AM
Subject: Re: [iPOJO] using External Handler
 

The factory description did not change ?
What is the manipulator version you're using ?
--G


2013/5/3 Michiel Vermandel <mv...@yahoo.com>

> I changed my Handler to this:
>
>    @Handler(name = "ScanCustom", namespace = "com.ce.flowbeans.channels")
>    public class EventChannelHandler extends PrimitiveHandler {
>
> Created the new Annotation:
>
>    package com.ce.flowbeans.channels;
>
>    import java.lang.annotation.ElementType;
>    import java.lang.annotation.Retention;
>    import java.lang.annotation.RetentionPolicy;
>    import java.lang.annotation.Target;
>
>    @Target(ElementType.TYPE)
>    @Retention(RetentionPolicy.SOURCE)
>    public @interface ScanCustom {}
>
> And changed my DeviceService class:
>
>    @Component
>    @Provides
>    @ScanCustom
>    public class DeviceService{
>
>        public static final String
> VOLUME_STATE_CHANGED="com/ce/flowbeans/io/VOLUME_STATE_CHANGED";
>
>       private DeviceWatcher deviceWatcher = null;
>
>        @Requires
>       EventService flowService;
>
>        @Channel(payload = DeviceBean.class, topic = VOLUME_STATE_CHANGED)
>       EventSender volumeStateChanged;
>
>        ...
>     }
>
> No change however...
>
>
> -----------------
> http://www.codessentials.com - Your essential software, for free!
> Follow us at http://twitter.com/#!/Codessentials
>
>
> ________________________________
>  From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
> To: users@felix.apache.org
> Sent: Friday, May 3, 2013 10:48 AM
> Subject: Re: [iPOJO] using External Handler
>
>
> Looking at your factory description, you can see that your handler is not
> in the required handler's list.
>
> Hmm I think I got it.
>
> This is probably because of FELIX-3889
> Runtime visible annotations cannot be iPOJO handler's markers.
>
> Maybe you can simply have a class level marker annotation (not runtime
> visible, probably no attributes, depending on what you need to read in your
> handler). this annotation will enable your own handler.
> And this handler will be able to read your own @Channel annotation
>
>
> https://issues.apache.org/jira/browse/FELIX-3889
>
>
> 2013/5/3 Michiel Vermandel <mv...@yahoo.com>
>
> > Handler com.ce.flowbeans.channels:Channel  (VALID)
> >
> > @Component
> > @Provides
> > public class DeviceService{
> >
> >     public static final String
> > VOLUME_STATE_CHANGED="com/ce/flowbeans/io/VOLUME_STATE_CHANGED";
> >
> >     private DeviceWatcher deviceWatcher = null;
> >
> >     @Requires
> >     EventService flowService;
> >
> >     @Channel(payload = DeviceBean.class, topic = VOLUME_STATE_CHANGED)
> >     EventSender volumeStateChanged;
> >
> > ...
> > }
> >
> >
> > g! Factory com.ce.flowbeans.io.DeviceService
> > factory name="com.ce.flowbeans.io.DeviceService" bundle="30"
> state="valid"
> > implementation-class="com.ce.flowbeans.io.DeviceService"
> >     requiredhandlers list="[org.apache.felix.ipojo:requires,
> > org.apache.felix.ipojo:callback, org.apache.felix.ipojo:provides,
> > org.apache.felix.ipojo:architecture]"
> >     missinghandlers list="[]"
> >     provides specification="com.ce.flowbeans.io.DeviceService"
> >     inherited interfaces="[]" superclasses="[]"
> >
> > g! Instance com.ce.flowbeans.io.DeviceService-0
> > instance name="com.ce.flowbeans.io.DeviceService-0" state="valid"
> > bundle="30" component.type="com.ce.flowbeans.io.DeviceService"
> >     handler name="org.apache.felix.ipojo:requires" state="valid"
> >         requires specification="com.ce.flowbeans.EventService"
> > id="com.ce.flowbeans.EventService" optional="false" aggregate="false"
> > proxy="true" binding-policy="dynamic" state="resolved"
> >     handler name="org.apache.felix.ipojo:callback" state="valid"
> >     handler name="org.apache.felix.ipojo:provides" state="valid"
> >         provides specifications="[com.ce.flowbeans.io.DeviceService]"
> > state="registered" service.id="59"
> >             property name="factory.name"
> > value="com.ce.flowbeans.io.DeviceService"
> >             property name="instance.name"
> > value="com.ce.flowbeans.io.DeviceService-0"
> >     handler name="org.apache.felix.ipojo:architecture" state="valid"
> >     object name="com.ce.flowbeans.io.DeviceService@662f743b"
> >
> >
> > -----------------
> > http://www.codessentials.com - Your essential software, for free!
> > Follow us at http://twitter.com/#!/Codessentials
> >
> >
> > ________________________________
> >  From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
> > To: users@felix.apache.org
> > Sent: Friday, May 3, 2013 10:11 AM
> > Subject: Re: [iPOJO] using External Handler
> >
> >
> > Can you show me the details of the following commands:
> > >$ factory com.ce.flowbeans.io.DeviceService
> > >$ instance com.ce.flowbeans.io.DeviceService-0
> >
> > Thanks
> >
> >
> > 2013/5/3 Michiel Vermandel <mv...@yahoo.com>
> >
> > > Hi,
> > >
> > >
> > > I did not do that yet.
> > > I just wanted to see the Handler getting invoked.
> > > I have added a System.out in the constructor of the handler and in the
> > > start method but I do not see any of these comments in the console.
> > >
> > > When exactly is/should the Handler be instantiated?
> > >
> > > Thanks
> > >
> > > -----------------
> > > http://www.codessentials.com - Your essential software, for free!
> > > Follow us at http://twitter.com/#!/Codessentials
> > >
> > >
> > > ________________________________
> > >  From: Clement Escoffier <cl...@gmail.com>
> > > To: users@felix.apache.org; Michiel Vermandel <mv...@yahoo.com>
> > > Sent: Thursday, May 2, 2013 8:06 PM
> > > Subject: Re: [iPOJO] using External Handler
> > >
> > >
> > > Hi,
> > >
> > > Did you implement the configure method and parsed the given metadata ?
> > You
> > > must register a field interceptor for each field you need to inject.
> > >
> > > Regards,
> > >
> > > Clement
> > >
> > > On 2 mai 2013, at 17:10, Michiel Vermandel <mv...@yahoo.com> wrote:
> > >
> > > > Hi,
> > > >
> > > > In my previous post I mentioned an issue with my custom annotations.
> > > > Now I'm trying to write a iPOJO Handler to inject these dependencies.
> > > >
> > > > I have created a class implementing PrimitiveHandler:
> > > >
> > > > @Handler(name = "Channel", namespace = "com.ce.flowbeans.channels")
> > > > public class EventChannelHandler extends PrimitiveHandler {
> > > >
> > > > I have implemented the required methods, but have only put some
> > > system.out for the moment.
> > > >
> > > > I also have my annotation @Channel in the package
> > > "com.ce.flowbeans.channels".
> > > >
> > > > When I startup the framework I see the handler:
> > > >
> > > >> handlers
> > > > Handler org.apache.felix.ipojo:properties (VALID)
> > > > Handler org.apache.felix.ipojo:requires (VALID)
> > > > Handler org.apache.felix.ipojo:architecture (VALID)
> > > > Handler
> > >  org.apache.felix.ipojo:callback (VALID)
> > > > Handler org.apache.felix.ipojo:controller (VALID)
> > > > Handler org.apache.felix.ipojo:provides (VALID)
> > > > Handler com.ce.flowbeans.channels:Channel (VALID)    <==
> > > >
> > > > But when a field in a component is annotated with the @Channel
> > > annotation, it gets not injected.
> > > > Neither do I see any call to the initializeComponentFactory(...) or
> > > configure(...) or start() methods of the handler.
> > > >
> > > > Do I need to specifically attach the handler to the component
> instance
> > > in some way?
> > > >
> > > > Thanks
> > > >
> > > >
> > > >
> > > > -----------------
> > > > http://www.codessentials.com - Your essential software, for free!
> > > > Follow us at http://twitter.com/#!/Codessentials
> > >
> >
>

Re: [iPOJO] using External Handler

Posted by "Guillaume Sauthier (OW2/GMail)" <gu...@gmail.com>.
The factory description did not change ?
What is the manipulator version you're using ?
--G


2013/5/3 Michiel Vermandel <mv...@yahoo.com>

> I changed my Handler to this:
>
>    @Handler(name = "ScanCustom", namespace = "com.ce.flowbeans.channels")
>    public class EventChannelHandler extends PrimitiveHandler {
>
> Created the new Annotation:
>
>    package com.ce.flowbeans.channels;
>
>    import java.lang.annotation.ElementType;
>    import java.lang.annotation.Retention;
>    import java.lang.annotation.RetentionPolicy;
>    import java.lang.annotation.Target;
>
>    @Target(ElementType.TYPE)
>    @Retention(RetentionPolicy.SOURCE)
>    public @interface ScanCustom {}
>
> And changed my DeviceService class:
>
>    @Component
>    @Provides
>    @ScanCustom
>    public class DeviceService{
>
>        public static final String
> VOLUME_STATE_CHANGED="com/ce/flowbeans/io/VOLUME_STATE_CHANGED";
>
>       private DeviceWatcher deviceWatcher = null;
>
>        @Requires
>       EventService flowService;
>
>        @Channel(payload = DeviceBean.class, topic = VOLUME_STATE_CHANGED)
>       EventSender volumeStateChanged;
>
>        ...
>     }
>
> No change however...
>
>
> -----------------
> http://www.codessentials.com - Your essential software, for free!
> Follow us at http://twitter.com/#!/Codessentials
>
>
> ________________________________
>  From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
> To: users@felix.apache.org
> Sent: Friday, May 3, 2013 10:48 AM
> Subject: Re: [iPOJO] using External Handler
>
>
> Looking at your factory description, you can see that your handler is not
> in the required handler's list.
>
> Hmm I think I got it.
>
> This is probably because of FELIX-3889
> Runtime visible annotations cannot be iPOJO handler's markers.
>
> Maybe you can simply have a class level marker annotation (not runtime
> visible, probably no attributes, depending on what you need to read in your
> handler). this annotation will enable your own handler.
> And this handler will be able to read your own @Channel annotation
>
>
> https://issues.apache.org/jira/browse/FELIX-3889
>
>
> 2013/5/3 Michiel Vermandel <mv...@yahoo.com>
>
> > Handler com.ce.flowbeans.channels:Channel  (VALID)
> >
> > @Component
> > @Provides
> > public class DeviceService{
> >
> >     public static final String
> > VOLUME_STATE_CHANGED="com/ce/flowbeans/io/VOLUME_STATE_CHANGED";
> >
> >     private DeviceWatcher deviceWatcher = null;
> >
> >     @Requires
> >     EventService flowService;
> >
> >     @Channel(payload = DeviceBean.class, topic = VOLUME_STATE_CHANGED)
> >     EventSender volumeStateChanged;
> >
> > ...
> > }
> >
> >
> > g! Factory com.ce.flowbeans.io.DeviceService
> > factory name="com.ce.flowbeans.io.DeviceService" bundle="30"
> state="valid"
> > implementation-class="com.ce.flowbeans.io.DeviceService"
> >     requiredhandlers list="[org.apache.felix.ipojo:requires,
> > org.apache.felix.ipojo:callback, org.apache.felix.ipojo:provides,
> > org.apache.felix.ipojo:architecture]"
> >     missinghandlers list="[]"
> >     provides specification="com.ce.flowbeans.io.DeviceService"
> >     inherited interfaces="[]" superclasses="[]"
> >
> > g! Instance com.ce.flowbeans.io.DeviceService-0
> > instance name="com.ce.flowbeans.io.DeviceService-0" state="valid"
> > bundle="30" component.type="com.ce.flowbeans.io.DeviceService"
> >     handler name="org.apache.felix.ipojo:requires" state="valid"
> >         requires specification="com.ce.flowbeans.EventService"
> > id="com.ce.flowbeans.EventService" optional="false" aggregate="false"
> > proxy="true" binding-policy="dynamic" state="resolved"
> >     handler name="org.apache.felix.ipojo:callback" state="valid"
> >     handler name="org.apache.felix.ipojo:provides" state="valid"
> >         provides specifications="[com.ce.flowbeans.io.DeviceService]"
> > state="registered" service.id="59"
> >             property name="factory.name"
> > value="com.ce.flowbeans.io.DeviceService"
> >             property name="instance.name"
> > value="com.ce.flowbeans.io.DeviceService-0"
> >     handler name="org.apache.felix.ipojo:architecture" state="valid"
> >     object name="com.ce.flowbeans.io.DeviceService@662f743b"
> >
> >
> > -----------------
> > http://www.codessentials.com - Your essential software, for free!
> > Follow us at http://twitter.com/#!/Codessentials
> >
> >
> > ________________________________
> >  From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
> > To: users@felix.apache.org
> > Sent: Friday, May 3, 2013 10:11 AM
> > Subject: Re: [iPOJO] using External Handler
> >
> >
> > Can you show me the details of the following commands:
> > >$ factory com.ce.flowbeans.io.DeviceService
> > >$ instance com.ce.flowbeans.io.DeviceService-0
> >
> > Thanks
> >
> >
> > 2013/5/3 Michiel Vermandel <mv...@yahoo.com>
> >
> > > Hi,
> > >
> > >
> > > I did not do that yet.
> > > I just wanted to see the Handler getting invoked.
> > > I have added a System.out in the constructor of the handler and in the
> > > start method but I do not see any of these comments in the console.
> > >
> > > When exactly is/should the Handler be instantiated?
> > >
> > > Thanks
> > >
> > > -----------------
> > > http://www.codessentials.com - Your essential software, for free!
> > > Follow us at http://twitter.com/#!/Codessentials
> > >
> > >
> > > ________________________________
> > >  From: Clement Escoffier <cl...@gmail.com>
> > > To: users@felix.apache.org; Michiel Vermandel <mv...@yahoo.com>
> > > Sent: Thursday, May 2, 2013 8:06 PM
> > > Subject: Re: [iPOJO] using External Handler
> > >
> > >
> > > Hi,
> > >
> > > Did you implement the configure method and parsed the given metadata ?
> > You
> > > must register a field interceptor for each field you need to inject.
> > >
> > > Regards,
> > >
> > > Clement
> > >
> > > On 2 mai 2013, at 17:10, Michiel Vermandel <mv...@yahoo.com> wrote:
> > >
> > > > Hi,
> > > >
> > > > In my previous post I mentioned an issue with my custom annotations.
> > > > Now I'm trying to write a iPOJO Handler to inject these dependencies.
> > > >
> > > > I have created a class implementing PrimitiveHandler:
> > > >
> > > > @Handler(name = "Channel", namespace = "com.ce.flowbeans.channels")
> > > > public class EventChannelHandler extends PrimitiveHandler {
> > > >
> > > > I have implemented the required methods, but have only put some
> > > system.out for the moment.
> > > >
> > > > I also have my annotation @Channel in the package
> > > "com.ce.flowbeans.channels".
> > > >
> > > > When I startup the framework I see the handler:
> > > >
> > > >> handlers
> > > > Handler org.apache.felix.ipojo:properties (VALID)
> > > > Handler org.apache.felix.ipojo:requires (VALID)
> > > > Handler org.apache.felix.ipojo:architecture (VALID)
> > > > Handler
> > >  org.apache.felix.ipojo:callback (VALID)
> > > > Handler org.apache.felix.ipojo:controller (VALID)
> > > > Handler org.apache.felix.ipojo:provides (VALID)
> > > > Handler com.ce.flowbeans.channels:Channel (VALID)    <==
> > > >
> > > > But when a field in a component is annotated with the @Channel
> > > annotation, it gets not injected.
> > > > Neither do I see any call to the initializeComponentFactory(...) or
> > > configure(...) or start() methods of the handler.
> > > >
> > > > Do I need to specifically attach the handler to the component
> instance
> > > in some way?
> > > >
> > > > Thanks
> > > >
> > > >
> > > >
> > > > -----------------
> > > > http://www.codessentials.com - Your essential software, for free!
> > > > Follow us at http://twitter.com/#!/Codessentials
> > >
> >
>

Re: [iPOJO] using External Handler

Posted by Michiel Vermandel <mv...@yahoo.com>.
I changed my Handler to this:

   @Handler(name = "ScanCustom", namespace = "com.ce.flowbeans.channels")
   public class EventChannelHandler extends PrimitiveHandler {

Created the new Annotation:

   package com.ce.flowbeans.channels;

   import java.lang.annotation.ElementType;
   import java.lang.annotation.Retention;
   import java.lang.annotation.RetentionPolicy;
   import java.lang.annotation.Target;

   @Target(ElementType.TYPE)
   @Retention(RetentionPolicy.SOURCE)
   public @interface ScanCustom {}

And changed my DeviceService class:

   @Component
   @Provides
   @ScanCustom
   public class DeviceService{
    
       public static final String VOLUME_STATE_CHANGED="com/ce/flowbeans/io/VOLUME_STATE_CHANGED";

      private DeviceWatcher deviceWatcher = null;

       @Requires
      EventService flowService;
    
       @Channel(payload = DeviceBean.class, topic = VOLUME_STATE_CHANGED)
      EventSender volumeStateChanged;

       ...
    }

No change however...

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


________________________________
 From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
To: users@felix.apache.org 
Sent: Friday, May 3, 2013 10:48 AM
Subject: Re: [iPOJO] using External Handler
 

Looking at your factory description, you can see that your handler is not
in the required handler's list.

Hmm I think I got it.

This is probably because of FELIX-3889
Runtime visible annotations cannot be iPOJO handler's markers.

Maybe you can simply have a class level marker annotation (not runtime
visible, probably no attributes, depending on what you need to read in your
handler). this annotation will enable your own handler.
And this handler will be able to read your own @Channel annotation


https://issues.apache.org/jira/browse/FELIX-3889


2013/5/3 Michiel Vermandel <mv...@yahoo.com>

> Handler com.ce.flowbeans.channels:Channel  (VALID)
>
> @Component
> @Provides
> public class DeviceService{
>
>     public static final String
> VOLUME_STATE_CHANGED="com/ce/flowbeans/io/VOLUME_STATE_CHANGED";
>
>     private DeviceWatcher deviceWatcher = null;
>
>     @Requires
>     EventService flowService;
>
>     @Channel(payload = DeviceBean.class, topic = VOLUME_STATE_CHANGED)
>     EventSender volumeStateChanged;
>
> ...
> }
>
>
> g! Factory com.ce.flowbeans.io.DeviceService
> factory name="com.ce.flowbeans.io.DeviceService" bundle="30" state="valid"
> implementation-class="com.ce.flowbeans.io.DeviceService"
>     requiredhandlers list="[org.apache.felix.ipojo:requires,
> org.apache.felix.ipojo:callback, org.apache.felix.ipojo:provides,
> org.apache.felix.ipojo:architecture]"
>     missinghandlers list="[]"
>     provides specification="com.ce.flowbeans.io.DeviceService"
>     inherited interfaces="[]" superclasses="[]"
>
> g! Instance com.ce.flowbeans.io.DeviceService-0
> instance name="com.ce.flowbeans.io.DeviceService-0" state="valid"
> bundle="30" component.type="com.ce.flowbeans.io.DeviceService"
>     handler name="org.apache.felix.ipojo:requires" state="valid"
>         requires specification="com.ce.flowbeans.EventService"
> id="com.ce.flowbeans.EventService" optional="false" aggregate="false"
> proxy="true" binding-policy="dynamic" state="resolved"
>     handler name="org.apache.felix.ipojo:callback" state="valid"
>     handler name="org.apache.felix.ipojo:provides" state="valid"
>         provides specifications="[com.ce.flowbeans.io.DeviceService]"
> state="registered" service.id="59"
>             property name="factory.name"
> value="com.ce.flowbeans.io.DeviceService"
>             property name="instance.name"
> value="com.ce.flowbeans.io.DeviceService-0"
>     handler name="org.apache.felix.ipojo:architecture" state="valid"
>     object name="com.ce.flowbeans.io.DeviceService@662f743b"
>
>
> -----------------
> http://www.codessentials.com - Your essential software, for free!
> Follow us at http://twitter.com/#!/Codessentials
>
>
> ________________________________
>  From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
> To: users@felix.apache.org
> Sent: Friday, May 3, 2013 10:11 AM
> Subject: Re: [iPOJO] using External Handler
>
>
> Can you show me the details of the following commands:
> >$ factory com.ce.flowbeans.io.DeviceService
> >$ instance com.ce.flowbeans.io.DeviceService-0
>
> Thanks
>
>
> 2013/5/3 Michiel Vermandel <mv...@yahoo.com>
>
> > Hi,
> >
> >
> > I did not do that yet.
> > I just wanted to see the Handler getting invoked.
> > I have added a System.out in the constructor of the handler and in the
> > start method but I do not see any of these comments in the console.
> >
> > When exactly is/should the Handler be instantiated?
> >
> > Thanks
> >
> > -----------------
> > http://www.codessentials.com - Your essential software, for free!
> > Follow us at http://twitter.com/#!/Codessentials
> >
> >
> > ________________________________
> >  From: Clement Escoffier <cl...@gmail.com>
> > To: users@felix.apache.org; Michiel Vermandel <mv...@yahoo.com>
> > Sent: Thursday, May 2, 2013 8:06 PM
> > Subject: Re: [iPOJO] using External Handler
> >
> >
> > Hi,
> >
> > Did you implement the configure method and parsed the given metadata ?
> You
> > must register a field interceptor for each field you need to inject.
> >
> > Regards,
> >
> > Clement
> >
> > On 2 mai 2013, at 17:10, Michiel Vermandel <mv...@yahoo.com> wrote:
> >
> > > Hi,
> > >
> > > In my previous post I mentioned an issue with my custom annotations.
> > > Now I'm trying to write a iPOJO Handler to inject these dependencies.
> > >
> > > I have created a class implementing PrimitiveHandler:
> > >
> > > @Handler(name = "Channel", namespace = "com.ce.flowbeans.channels")
> > > public class EventChannelHandler extends PrimitiveHandler {
> > >
> > > I have implemented the required methods, but have only put some
> > system.out for the moment.
> > >
> > > I also have my annotation @Channel in the package
> > "com.ce.flowbeans.channels".
> > >
> > > When I startup the framework I see the handler:
> > >
> > >> handlers
> > > Handler org.apache.felix.ipojo:properties (VALID)
> > > Handler org.apache.felix.ipojo:requires (VALID)
> > > Handler org.apache.felix.ipojo:architecture (VALID)
> > > Handler
> >  org.apache.felix.ipojo:callback (VALID)
> > > Handler org.apache.felix.ipojo:controller (VALID)
> > > Handler org.apache.felix.ipojo:provides (VALID)
> > > Handler com.ce.flowbeans.channels:Channel (VALID)    <==
> > >
> > > But when a field in a component is annotated with the @Channel
> > annotation, it gets not injected.
> > > Neither do I see any call to the initializeComponentFactory(...) or
> > configure(...) or start() methods of the handler.
> > >
> > > Do I need to specifically attach the handler to the component instance
> > in some way?
> > >
> > > Thanks
> > >
> > >
> > >
> > > -----------------
> > > http://www.codessentials.com - Your essential software, for free!
> > > Follow us at http://twitter.com/#!/Codessentials
> >
>

Re: [iPOJO] using External Handler

Posted by "Guillaume Sauthier (OW2/GMail)" <gu...@gmail.com>.
Looking at your factory description, you can see that your handler is not
in the required handler's list.

Hmm I think I got it.

This is probably because of FELIX-3889
Runtime visible annotations cannot be iPOJO handler's markers.

Maybe you can simply have a class level marker annotation (not runtime
visible, probably no attributes, depending on what you need to read in your
handler). this annotation will enable your own handler.
And this handler will be able to read your own @Channel annotation


https://issues.apache.org/jira/browse/FELIX-3889


2013/5/3 Michiel Vermandel <mv...@yahoo.com>

> Handler com.ce.flowbeans.channels:Channel  (VALID)
>
> @Component
> @Provides
> public class DeviceService{
>
>     public static final String
> VOLUME_STATE_CHANGED="com/ce/flowbeans/io/VOLUME_STATE_CHANGED";
>
>     private DeviceWatcher deviceWatcher = null;
>
>     @Requires
>     EventService flowService;
>
>     @Channel(payload = DeviceBean.class, topic = VOLUME_STATE_CHANGED)
>     EventSender volumeStateChanged;
>
> ...
> }
>
>
> g! Factory com.ce.flowbeans.io.DeviceService
> factory name="com.ce.flowbeans.io.DeviceService" bundle="30" state="valid"
> implementation-class="com.ce.flowbeans.io.DeviceService"
>     requiredhandlers list="[org.apache.felix.ipojo:requires,
> org.apache.felix.ipojo:callback, org.apache.felix.ipojo:provides,
> org.apache.felix.ipojo:architecture]"
>     missinghandlers list="[]"
>     provides specification="com.ce.flowbeans.io.DeviceService"
>     inherited interfaces="[]" superclasses="[]"
>
> g! Instance com.ce.flowbeans.io.DeviceService-0
> instance name="com.ce.flowbeans.io.DeviceService-0" state="valid"
> bundle="30" component.type="com.ce.flowbeans.io.DeviceService"
>     handler name="org.apache.felix.ipojo:requires" state="valid"
>         requires specification="com.ce.flowbeans.EventService"
> id="com.ce.flowbeans.EventService" optional="false" aggregate="false"
> proxy="true" binding-policy="dynamic" state="resolved"
>     handler name="org.apache.felix.ipojo:callback" state="valid"
>     handler name="org.apache.felix.ipojo:provides" state="valid"
>         provides specifications="[com.ce.flowbeans.io.DeviceService]"
> state="registered" service.id="59"
>             property name="factory.name"
> value="com.ce.flowbeans.io.DeviceService"
>             property name="instance.name"
> value="com.ce.flowbeans.io.DeviceService-0"
>     handler name="org.apache.felix.ipojo:architecture" state="valid"
>     object name="com.ce.flowbeans.io.DeviceService@662f743b"
>
>
> -----------------
> http://www.codessentials.com - Your essential software, for free!
> Follow us at http://twitter.com/#!/Codessentials
>
>
> ________________________________
>  From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
> To: users@felix.apache.org
> Sent: Friday, May 3, 2013 10:11 AM
> Subject: Re: [iPOJO] using External Handler
>
>
> Can you show me the details of the following commands:
> >$ factory com.ce.flowbeans.io.DeviceService
> >$ instance com.ce.flowbeans.io.DeviceService-0
>
> Thanks
>
>
> 2013/5/3 Michiel Vermandel <mv...@yahoo.com>
>
> > Hi,
> >
> >
> > I did not do that yet.
> > I just wanted to see the Handler getting invoked.
> > I have added a System.out in the constructor of the handler and in the
> > start method but I do not see any of these comments in the console.
> >
> > When exactly is/should the Handler be instantiated?
> >
> > Thanks
> >
> > -----------------
> > http://www.codessentials.com - Your essential software, for free!
> > Follow us at http://twitter.com/#!/Codessentials
> >
> >
> > ________________________________
> >  From: Clement Escoffier <cl...@gmail.com>
> > To: users@felix.apache.org; Michiel Vermandel <mv...@yahoo.com>
> > Sent: Thursday, May 2, 2013 8:06 PM
> > Subject: Re: [iPOJO] using External Handler
> >
> >
> > Hi,
> >
> > Did you implement the configure method and parsed the given metadata ?
> You
> > must register a field interceptor for each field you need to inject.
> >
> > Regards,
> >
> > Clement
> >
> > On 2 mai 2013, at 17:10, Michiel Vermandel <mv...@yahoo.com> wrote:
> >
> > > Hi,
> > >
> > > In my previous post I mentioned an issue with my custom annotations.
> > > Now I'm trying to write a iPOJO Handler to inject these dependencies.
> > >
> > > I have created a class implementing PrimitiveHandler:
> > >
> > > @Handler(name = "Channel", namespace = "com.ce.flowbeans.channels")
> > > public class EventChannelHandler extends PrimitiveHandler {
> > >
> > > I have implemented the required methods, but have only put some
> > system.out for the moment.
> > >
> > > I also have my annotation @Channel in the package
> > "com.ce.flowbeans.channels".
> > >
> > > When I startup the framework I see the handler:
> > >
> > >> handlers
> > > Handler org.apache.felix.ipojo:properties (VALID)
> > > Handler org.apache.felix.ipojo:requires (VALID)
> > > Handler org.apache.felix.ipojo:architecture (VALID)
> > > Handler
> >  org.apache.felix.ipojo:callback (VALID)
> > > Handler org.apache.felix.ipojo:controller (VALID)
> > > Handler org.apache.felix.ipojo:provides (VALID)
> > > Handler com.ce.flowbeans.channels:Channel (VALID)    <==
> > >
> > > But when a field in a component is annotated with the @Channel
> > annotation, it gets not injected.
> > > Neither do I see any call to the initializeComponentFactory(...) or
> > configure(...) or start() methods of the handler.
> > >
> > > Do I need to specifically attach the handler to the component instance
> > in some way?
> > >
> > > Thanks
> > >
> > >
> > >
> > > -----------------
> > > http://www.codessentials.com - Your essential software, for free!
> > > Follow us at http://twitter.com/#!/Codessentials
> >
>

Re: [iPOJO] using External Handler

Posted by Michiel Vermandel <mv...@yahoo.com>.
Handler com.ce.flowbeans.channels:Channel  (VALID)

@Component
@Provides
public class DeviceService{
    
    public static final String VOLUME_STATE_CHANGED="com/ce/flowbeans/io/VOLUME_STATE_CHANGED";

    private DeviceWatcher deviceWatcher = null;

    @Requires
    EventService flowService;
    
    @Channel(payload = DeviceBean.class, topic = VOLUME_STATE_CHANGED)
    EventSender volumeStateChanged;

...
}


g! Factory com.ce.flowbeans.io.DeviceService
factory name="com.ce.flowbeans.io.DeviceService" bundle="30" state="valid" implementation-class="com.ce.flowbeans.io.DeviceService"
    requiredhandlers list="[org.apache.felix.ipojo:requires, org.apache.felix.ipojo:callback, org.apache.felix.ipojo:provides, org.apache.felix.ipojo:architecture]"
    missinghandlers list="[]"
    provides specification="com.ce.flowbeans.io.DeviceService"
    inherited interfaces="[]" superclasses="[]"

g! Instance com.ce.flowbeans.io.DeviceService-0
instance name="com.ce.flowbeans.io.DeviceService-0" state="valid" bundle="30" component.type="com.ce.flowbeans.io.DeviceService"
    handler name="org.apache.felix.ipojo:requires" state="valid"
        requires specification="com.ce.flowbeans.EventService" id="com.ce.flowbeans.EventService" optional="false" aggregate="false" proxy="true" binding-policy="dynamic" state="resolved"
    handler name="org.apache.felix.ipojo:callback" state="valid"
    handler name="org.apache.felix.ipojo:provides" state="valid"
        provides specifications="[com.ce.flowbeans.io.DeviceService]" state="registered" service.id="59"
            property name="factory.name" value="com.ce.flowbeans.io.DeviceService"
            property name="instance.name" value="com.ce.flowbeans.io.DeviceService-0"
    handler name="org.apache.felix.ipojo:architecture" state="valid"
    object name="com.ce.flowbeans.io.DeviceService@662f743b"

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


________________________________
 From: Guillaume Sauthier (OW2/GMail) <gu...@gmail.com>
To: users@felix.apache.org 
Sent: Friday, May 3, 2013 10:11 AM
Subject: Re: [iPOJO] using External Handler
 

Can you show me the details of the following commands:
>$ factory com.ce.flowbeans.io.DeviceService
>$ instance com.ce.flowbeans.io.DeviceService-0

Thanks


2013/5/3 Michiel Vermandel <mv...@yahoo.com>

> Hi,
>
>
> I did not do that yet.
> I just wanted to see the Handler getting invoked.
> I have added a System.out in the constructor of the handler and in the
> start method but I do not see any of these comments in the console.
>
> When exactly is/should the Handler be instantiated?
>
> Thanks
>
> -----------------
> http://www.codessentials.com - Your essential software, for free!
> Follow us at http://twitter.com/#!/Codessentials
>
>
> ________________________________
>  From: Clement Escoffier <cl...@gmail.com>
> To: users@felix.apache.org; Michiel Vermandel <mv...@yahoo.com>
> Sent: Thursday, May 2, 2013 8:06 PM
> Subject: Re: [iPOJO] using External Handler
>
>
> Hi,
>
> Did you implement the configure method and parsed the given metadata ? You
> must register a field interceptor for each field you need to inject.
>
> Regards,
>
> Clement
>
> On 2 mai 2013, at 17:10, Michiel Vermandel <mv...@yahoo.com> wrote:
>
> > Hi,
> >
> > In my previous post I mentioned an issue with my custom annotations.
> > Now I'm trying to write a iPOJO Handler to inject these dependencies.
> >
> > I have created a class implementing PrimitiveHandler:
> >
> > @Handler(name = "Channel", namespace = "com.ce.flowbeans.channels")
> > public class EventChannelHandler extends PrimitiveHandler {
> >
> > I have implemented the required methods, but have only put some
> system.out for the moment.
> >
> > I also have my annotation @Channel in the package
> "com.ce.flowbeans.channels".
> >
> > When I startup the framework I see the handler:
> >
> >> handlers
> > Handler org.apache.felix.ipojo:properties (VALID)
> > Handler org.apache.felix.ipojo:requires (VALID)
> > Handler org.apache.felix.ipojo:architecture (VALID)
> > Handler
>  org.apache.felix.ipojo:callback (VALID)
> > Handler org.apache.felix.ipojo:controller (VALID)
> > Handler org.apache.felix.ipojo:provides (VALID)
> > Handler com.ce.flowbeans.channels:Channel (VALID)    <==
> >
> > But when a field in a component is annotated with the @Channel
> annotation, it gets not injected.
> > Neither do I see any call to the initializeComponentFactory(...) or
> configure(...) or start() methods of the handler.
> >
> > Do I need to specifically attach the handler to the component instance
> in some way?
> >
> > Thanks
> >
> >
> >
> > -----------------
> > http://www.codessentials.com - Your essential software, for free!
> > Follow us at http://twitter.com/#!/Codessentials
>

Re: [iPOJO] using External Handler

Posted by "Guillaume Sauthier (OW2/GMail)" <gu...@gmail.com>.
Can you show me the details of the following commands:
>$ factory com.ce.flowbeans.io.DeviceService
>$ instance com.ce.flowbeans.io.DeviceService-0

Thanks


2013/5/3 Michiel Vermandel <mv...@yahoo.com>

> Hi,
>
>
> I did not do that yet.
> I just wanted to see the Handler getting invoked.
> I have added a System.out in the constructor of the handler and in the
> start method but I do not see any of these comments in the console.
>
> When exactly is/should the Handler be instantiated?
>
> Thanks
>
> -----------------
> http://www.codessentials.com - Your essential software, for free!
> Follow us at http://twitter.com/#!/Codessentials
>
>
> ________________________________
>  From: Clement Escoffier <cl...@gmail.com>
> To: users@felix.apache.org; Michiel Vermandel <mv...@yahoo.com>
> Sent: Thursday, May 2, 2013 8:06 PM
> Subject: Re: [iPOJO] using External Handler
>
>
> Hi,
>
> Did you implement the configure method and parsed the given metadata ? You
> must register a field interceptor for each field you need to inject.
>
> Regards,
>
> Clement
>
> On 2 mai 2013, at 17:10, Michiel Vermandel <mv...@yahoo.com> wrote:
>
> > Hi,
> >
> > In my previous post I mentioned an issue with my custom annotations.
> > Now I'm trying to write a iPOJO Handler to inject these dependencies.
> >
> > I have created a class implementing PrimitiveHandler:
> >
> > @Handler(name = "Channel", namespace = "com.ce.flowbeans.channels")
> > public class EventChannelHandler extends PrimitiveHandler {
> >
> > I have implemented the required methods, but have only put some
> system.out for the moment.
> >
> > I also have my annotation @Channel in the package
> "com.ce.flowbeans.channels".
> >
> > When I startup the framework I see the handler:
> >
> >> handlers
> > Handler org.apache.felix.ipojo:properties (VALID)
> > Handler org.apache.felix.ipojo:requires (VALID)
> > Handler org.apache.felix.ipojo:architecture (VALID)
> > Handler
>  org.apache.felix.ipojo:callback (VALID)
> > Handler org.apache.felix.ipojo:controller (VALID)
> > Handler org.apache.felix.ipojo:provides (VALID)
> > Handler com.ce.flowbeans.channels:Channel (VALID)    <==
> >
> > But when a field in a component is annotated with the @Channel
> annotation, it gets not injected.
> > Neither do I see any call to the initializeComponentFactory(...) or
> configure(...) or start() methods of the handler.
> >
> > Do I need to specifically attach the handler to the component instance
> in some way?
> >
> > Thanks
> >
> >
> >
> > -----------------
> > http://www.codessentials.com - Your essential software, for free!
> > Follow us at http://twitter.com/#!/Codessentials
>

[iPOJO] using External Handler

Posted by Michiel Vermandel <mv...@yahoo.com>.
Hi,


I did not do that yet.
I just wanted to see the Handler getting invoked.
I have added a System.out in the constructor of the handler and in the start method but I do not see any of these comments in the console.

When exactly is/should the Handler be instantiated?

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


________________________________
 From: Clement Escoffier <cl...@gmail.com>
To: users@felix.apache.org; Michiel Vermandel <mv...@yahoo.com> 
Sent: Thursday, May 2, 2013 8:06 PM
Subject: Re: [iPOJO] using External Handler
 

Hi,

Did you implement the configure method and parsed the given metadata ? You must register a field interceptor for each field you need to inject.

Regards,

Clement

On 2 mai 2013, at 17:10, Michiel Vermandel <mv...@yahoo.com> wrote:

> Hi,
> 
> In my previous post I mentioned an issue with my custom annotations.
> Now I'm trying to write a iPOJO Handler to inject these dependencies.
> 
> I have created a class implementing PrimitiveHandler:
> 
> @Handler(name = "Channel", namespace = "com.ce.flowbeans.channels")
> public class EventChannelHandler extends PrimitiveHandler {
> 
> I have implemented the required methods, but have only put some system.out for the moment.
> 
> I also have my annotation @Channel in the package "com.ce.flowbeans.channels".
> 
> When I startup the framework I see the handler: 
> 
>> handlers
> Handler org.apache.felix.ipojo:properties (VALID)
> Handler org.apache.felix.ipojo:requires (VALID)
> Handler org.apache.felix.ipojo:architecture (VALID)
> Handler
 org.apache.felix.ipojo:callback (VALID)
> Handler org.apache.felix.ipojo:controller (VALID)
> Handler org.apache.felix.ipojo:provides (VALID)
> Handler com.ce.flowbeans.channels:Channel (VALID)    <==
> 
> But when a field in a component is annotated with the @Channel annotation, it gets not injected.
> Neither do I see any call to the initializeComponentFactory(...) or configure(...) or start() methods of the handler.
> 
> Do I need to specifically attach the handler to the component instance in some way?
> 
> Thanks
> 
>  
> 
> -----------------
> http://www.codessentials.com - Your essential software, for free!
> Follow us at http://twitter.com/#!/Codessentials

Re: [iPOJO] using External Handler

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

Did you implement the configure method and parsed the given metadata ? You must register a field interceptor for each field you need to inject.

Regards,

Clement

On 2 mai 2013, at 17:10, Michiel Vermandel <mv...@yahoo.com> wrote:

> Hi,
> 
> In my previous post I mentioned an issue with my custom annotations.
> Now I'm trying to write a iPOJO Handler to inject these dependencies.
> 
> I have created a class implementing PrimitiveHandler:
> 
> @Handler(name = "Channel", namespace = "com.ce.flowbeans.channels")
> public class EventChannelHandler extends PrimitiveHandler {
> 
> I have implemented the required methods, but have only put some system.out for the moment.
> 
> I also have my annotation @Channel in the package "com.ce.flowbeans.channels".
> 
> When I startup the framework I see the handler: 
> 
>> handlers
> Handler org.apache.felix.ipojo:properties (VALID)
> Handler org.apache.felix.ipojo:requires (VALID)
> Handler org.apache.felix.ipojo:architecture (VALID)
> Handler org.apache.felix.ipojo:callback (VALID)
> Handler org.apache.felix.ipojo:controller (VALID)
> Handler org.apache.felix.ipojo:provides (VALID)
> Handler com.ce.flowbeans.channels:Channel (VALID)    <==
> 
> But when a field in a component is annotated with the @Channel annotation, it gets not injected.
> Neither do I see any call to the initializeComponentFactory(...) or configure(...) or start() methods of the handler.
> 
> Do I need to specifically attach the handler to the component instance in some way?
> 
> 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