You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Luke Winkenbach (JIRA)" <ji...@apache.org> on 2014/08/24 22:09:37 UTC

[jira] [Commented] (FELIX-4612) @PostRegistration is not being called

    [ https://issues.apache.org/jira/browse/FELIX-4612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14108528#comment-14108528 ] 

Luke Winkenbach commented on FELIX-4612:
----------------------------------------

Looking through the code, I believe I have found a potential problem.  In DefaultBindingModule, the PostUnregistration class is bound to the PostRegistrationVisitor object (see DefaultBindingModule.java:272).  

> @PostRegistration is not being called
> -------------------------------------
>
>                 Key: FELIX-4612
>                 URL: https://issues.apache.org/jira/browse/FELIX-4612
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>         Environment: Seen on felix and equinox
>            Reporter: Luke Winkenbach
>
> When a simple service starts up, I expect to see the following:
> # Constructor called
> # @Validate method called
> # @PostRegistration called
> Instead, what is seen is:
> # Constructor called
> # @Validate method called
> # @Post*Un*registration called
> Here is the service implementation:
> {code:title=TestServiceImpl.java|borderStyle=solid}
> @Component
> @Provides
> @Instantiate
> public class TestServiceImpl implements TestService
> {
>   @Requires 
>   LogService log;
>   
>   public TestServiceImpl()
>   {
>     log.log(LogService.LOG_ERROR, "TestServiceImpl Constructor");
>   }
>   
>   @Validate
>   public void validate()
>   {
>     log.log(LogService.LOG_ERROR, "Validate");
>   }
>   
>   @Invalidate
>   public void invalidate()
>   {
>     log.log(LogService.LOG_ERROR, "Invalidate");
>   }
>   
>   @PostRegistration
>   public void name(ServiceReference ref)
>   {
>     log.log(LogService.LOG_ERROR, "PostRegistration");
>   }
>   
>   @PostUnregistration
>   public void uname(ServiceReference ref)
>   {
>     log.log(LogService.LOG_ERROR, "PostUnregistration");
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)