SCR Modified annotation required, default method is not used.
-------------------------------------------------------------

                 Key: FELIX-3430
                 URL: https://issues.apache.org/jira/browse/FELIX-3430
             Project: Felix
          Issue Type: Bug
            Reporter: Johan Ström
            Priority: Minor


>From http://felix.apache.org/site/scr-annotations.html:

{quote}
Activate, Deactivate, and Modified
The Declarative Service version 1.1 allows to specify the name for the 
activate, deactivate and modified method (see the spec for more information). 
The Activate, Deactivate, and Modified annotation can be used to mark a method 
to be used for the specified purpose. However, as the DS specifies a method 
search algorithm, there are rare cases where the marked method is not used (if 
there is another method with the same name, but a different signature this 
might happen).
{quote}


This holds true for activate and deactivate. However, for modified, it doesn't 
seem to work without explicitly declaring it so in the scr:component manifest. 
Looking at impl/manager/ImmediateComponentManager.java, activate & deactivate 
is not handled the same way as modified:
{code}
    private boolean modify() {
...
        // 1. no live update if there is no declared method
        if ( getComponentMetadata().getModified() == null )
        {
            return false;
        }
{code}

Thus, if not defined at all, it is not used. And that seems to be against the 
spec.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to