[ 
http://jira.amdatu.org/jira/browse/AMDATU-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10272#comment-10272
 ] 

Ivo Ladage - van Doorn commented on AMDATU-174:
-----------------------------------------------

I'm able to reproduce the issue right now! This time it appears in the 
FriendsGadgetServiceImpl, with this pseudo code:

    private String m_hostname;
    private String m_portnr;

    public void init() {
      // now m_hostname and m_portnr are null
    }

   public void updated(Dictionary dictionary) throws ConfigurationException {
        if (dictionary != null) {
            checkAvailability(dictionary, new String[] {HOSTNAME, PORTNR});
            m_hostname = (String) dictionary.get(HOSTNAME);
            m_portnr = (String) dictionary.get(PORTNR);
        }
    }

And in the Activator:

Component friendsgadgetService = createComponent()
                .setInterface(ResourceProvider.class.getName(), null)
                .setImplementation(FriendsGadgetServiceImpl.class)
                
.add(createServiceDependency().setService(LogService.class).setRequired(true))
                
.add(createServiceDependency().setService(GadgetManagement.class).setRequired(true))
                
.add(createServiceDependency().setService(HttpContextServiceFactory.class).setRequired(true))
                
.add(createServiceDependency().setService(HttpService.class).setRequired(true))
                
.add(createConfigurationDependency().setPid(FriendsGadgetServiceImpl.PID));

Added a breakpoint to updated() and init() methods. updated() is never invoked.
Now the Friends gadget is contained by bundle 1
I update however bundle 10, which holds the gadget management service on which 
the gadget has a dependency
When updating bundle 10, init() is invoked but updated() is not
However, when I update bundle 1 updated() is invoked!

So it seems that updated() of service A contained by bundle A is not invoked 
when bundle B is updated holding a service B on which service A depends.



> Investigate the ManagedService.updated() method call not always being invoked 
> for required configuration dependencies.
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMDATU-174
>                 URL: http://jira.amdatu.org/jira/browse/AMDATU-174
>             Project: Amdatu
>          Issue Type: Bug
>            Reporter: Marcel Offermans
>            Assignee: Marcel Offermans
>
> Several reports have indicated that sometimes the updated() method is not 
> invoked before a component with a required configuration dependency is 
> initialized. This does not yet seem reproducable, but is worth investigating 
> because it can lead to all kinds of problems. If it is indeed a bug, it needs 
> to be resolved in the Dependency Manager.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to