You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Agemo Cui (JIRA)" <ji...@apache.org> on 2009/06/01 06:12:07 UTC

[jira] Updated: (FELIX-1185) If a static/mandatory reference to a service is unregistered, the component should be deactivated synchronously instead of asynchronously

     [ https://issues.apache.org/jira/browse/FELIX-1185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Agemo Cui updated FELIX-1185:
-----------------------------

    Attachment: ComponentFactoryImpl.java
                AbstractComponentManager.java

I investigated the state transition case further and found the State Unsatisfied is not a duplicate one to State Enabled. So it cannot be removed. The State Enabled aforementioned is actually the State Unsatisfied. So State Enabled is renamed to Unsatisfied and a "new" State Enabled is added. It will be useful when we make changes for R4.2. For now, the behavior is only a little different from before. That is: when method enable is called, the component will transit into State Enabled immediately but the activating work will be run asynchronously, which is just like the R4 spec says.

I fixed the code accordingly.  The changed files are attached.

New transition cases are listed below.

Disabled -(enable)-> Enabled
Disabled -(dispose)-> Destoryed
Enabled -(activate, SUCCESS)-> Satisfied(Registered, Factory or Active)
Enabled -(activate, FAIL)-> Unsatisfied
Enabled -(disable)-> Disabled
Enabled -(dispose)-> Destroyed
Unsatisfied -(activate, SUCCESS)-> Satisfied(Registered, Factory or Active)
Unsatisfied -(activate, FAIL)-> Unsatisfied
Unsatisfied -(disable)-> Disabled
Unsatisfied -(dispose)-> Destroyed
Registered -(getService, SUCCESS)-> Active
Registered -(getService, FAIL)-> Unsatisfied
Satisfied -(deactivate)-> Unsatisfied


> If a static/mandatory reference to a service is unregistered, the component should be deactivated synchronously instead of asynchronously
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1185
>                 URL: https://issues.apache.org/jira/browse/FELIX-1185
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.0.8
>            Reporter: Agemo Cui
>             Fix For: scr-1.0.10
>
>         Attachments: AbstractComponentManager.java, ComponentFactoryImpl.java, scr-changes on revision 778604.zip
>
>
> In the specification cmpn 112.3.3 Reference Policy, it says "Component configurations are deactivated before any bound service for a reference having a static policy becomes unavailable."
> My understanding is the deactivate method of the component must be called before any unbind method for a static/mandatory reference is called. And it's reasonable for a static/mandatory reference to be still available in the deactivate method.
> If the component is deactivated asynchronously when a static/mandatory reference to a service is unregistered, then it's possible that the unbind method is called before the deactivate method is called, which makes the service unavailable in the deactivate method.
> This bug may relate to FELIX-1178.
> The fix for this bug should also fix FELIX-1178. No need to add a new flag.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.