Hmm...Then why do I get a Proxy class for my field annotated with my custom 
Annotation?
Thanks

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


________________________________
 From: Guillaume Sauthier (OW2/GMail) <[email protected]>
To: [email protected] 
Sent: Friday, May 3, 2013 10:14 AM
Subject: Re: [iPOJO] My own runtime annotations get lost (proxied)
 

The manipulator do not create proxy on his own.
this is the job of the handler to perform that task.
With @Requires and @Bind, this is the iPOJO 'requires' handler

With your own annotation, this is the job of your own handler


2013/5/3 Michiel Vermandel <[email protected]>

> Hi,
>
>
> I do not use @Requires on that field. I use my own @Channel.
> The @Channel is how ever declared in a bundle which goes through the
> manipulator.
> Will the manipulator create a proxy for this annotation?
> (I cannot user proxy=false since the annotation is custom, not @Requires)
>
> Thanks
>
> -----------------
> http://www.codessentials.com - Your essential software, for free!
> Follow us at http://twitter.com/#!/Codessentials
>
>
> ________________________________
>  From: Clement Escoffier <[email protected]>
> To: [email protected]; Michiel Vermandel <[email protected]>
> Sent: Thursday, May 2, 2013 8:07 PM
> Subject: Re: [iPOJO] My own runtime annotations get lost (proxied)
>
>
> Hi,
>
> If you try to grab the object from a @Requires injected field, you are
> getting a proxy. Disable the proxy to get a direct reference on the object.
>
> Regards,
>
> Clement
>
> On 2 mai 2013, at 13:46, Michiel Vermandel <[email protected]> wrote:
>
> > Hi,
> >
> > I have some custom annotations with retention ==
>  runtime.
> > Now, when I use these annotations on an object that is also annotated as
> iPOJO component, I cannot access my annotations anymore on a created
> instance of the component.
> > If I list the annotations on such annotated field, I get something like
> $Proxy17 as class instead of my custom annotation class.
> >
> > This how I try to get to the annotations:
> >
> > (simplified example:)
> >
> > my iPOJO with custom annotation:
> >
> > @Component
> > @Provides
> > public class DeviceService{
> >
> >     @Channel(payload = DeviceBean.class, type= VOLUME_STATE_CHANGED) //
> <= custom annotation
> >     EventLogger volumeStateChanged;
> >
> > ...
> >
> > When I get hold of the component instance, I get to the
> original(manipulated) object like this:
> > Object instancePojo = ((InstanceManager) instance).getPojoObject();
> > Then
>  I get the field volumeStateChanged and try to get the @Channel annotation.
> > Which fails => field.getAnnotation(Channel.class) == null
> >
> >
> > Is there a way to keep/get the original annotation on my field?
> > (The code should work outside iPOJO as well, So I need my custom - non
> iPOJO - annotations)
> >
> > Thanks!
> >
> >
> > -----------------
> > http://www.codessentials.com - Your essential software, for free!
> > Follow us at http://twitter.com/#!/Codessentials
>

Reply via email to