You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by lukewink <lu...@gmail.com> on 2014/08/23 04:47:33 UTC

[iPOJO] @PostRegistration not being called

I am using iPOJO 1.11.2, and I am not seeing the @PostRegistration callback
being made.  

What I see is the following happening:
1. TestService Constructor
2. TestService @Validate
3. TestService @PostUnregistration

TestService looks like the following:



Why is @PostUnregistration being called instead of @PostRegistration?

Thanks!



--
View this message in context: http://apache-felix.18485.x6.nabble.com/iPOJO-PostRegistration-not-being-called-tp5009596.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

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


Re: [iPOJO] @PostRegistration not being called

Posted by lukewink <lu...@gmail.com>.
I found the issue in the ipojo manipulator that is causing the behavior I'm
seeing.  
When the @PostUnregistration annotation is found, it is wrongly bound to the
PostRegistrationVisitor object.  In my case, this meant that the
PostRegistration callback was being overwritten by the PostUnregistration
callback.
The attached patch should fix the bug (I will also attach the patch to the
JIRA issue):

Index:
manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/module/DefaultBindingModule.java
===================================================================
---
manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/module/DefaultBindingModule.java  
(revision 1620185)
+++
manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/module/DefaultBindingModule.java  
(working copy)
@@ -252,7 +252,7 @@
                 .to(new AnnotationVisitorFactory() {
                     public AnnotationVisitor
newAnnotationVisitor(BindingContext context) {
                         MethodNode node = context.getMethodNode();
-                        return new
PostRegistrationVisitor(context.getWorkbench(), node.name);
+                        return new
PostUnregistrationVisitor(context.getWorkbench(), node.name);
                     }
                 });





--
View this message in context: http://apache-felix.18485.x6.nabble.com/iPOJO-PostRegistration-not-being-called-tp5009596p5009612.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

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


Re: [iPOJO] @PostRegistration not being called

Posted by lukewink <lu...@gmail.com>.
Thanks Clement.  I have opened an issue at:
https://issues.apache.org/jira/browse/FELIX-4612

Thanks,
-Luke



--
View this message in context: http://apache-felix.18485.x6.nabble.com/iPOJO-PostRegistration-not-being-called-tp5009596p5009610.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

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


Re: [iPOJO] @PostRegistration not being called

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

Didn’t get the code. Anyway, looks like a bug. Could you open an issue?

Thanks and regards,

Clement

On 23 août 2014 at 15:34:03, lukewink (lukewink@gmail.com) wrote:

I am using iPOJO 1.11.2, and I am not seeing the @PostRegistration callback  
being made.  

What I see is the following happening:  
1. TestService Constructor  
2. TestService @Validate  
3. TestService @PostUnregistration  

TestService looks like the following:  



Why is @PostUnregistration being called instead of @PostRegistration?  

Thanks!  



--  
View this message in context: http://apache-felix.18485.x6.nabble.com/iPOJO-PostRegistration-not-being-called-tp5009596.html  
Sent from the Apache Felix - Users mailing list archive at Nabble.com.  

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