felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clement Escoffier (JIRA)" <j...@apache.org>
Subject [jira] Updated: (FELIX-1906) Allows calling a method when service properties of an already injected service are modified
Date Sun, 29 Nov 2009 09:09:20 GMT

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

Clement Escoffier updated FELIX-1906:
-------------------------------------

    Description: 
iPOJO provides bind and unbind callback to notify the arrival and the departure of a service.
Currently, service modification was mapped as follows:
- if the service was not matching and now matches : call bind
- if the service was matching and now does no more match : call unbind
- if a service was matching and still matches : ignore

The issue modifies the third case to call a 'modify' callback.
Service dependencies will support a new 'type' : modify; such as in
 <component
    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
    name="ObjectModifyCheckServiceProvider" architecture="true">
    <requires field="fs">
      <callback type="bind" method="objectBind" />
      <callback type="unbind" method="objectUnbind" />
      <callback type="modified" method="objectModify" />
    </requires>
    <provides />
</component>

The equivalent annotation will be also provided:
    @Bind(id="mod")
    public void bindMod() {  }
    
    @Unbind(id="mod")
    public void unbindMod() {  }
    
    @Modified(id="mod")
    public void modifyMod() {  }

So, the new mapping will be:
- if the service was not matching and now matches : call bind
- if the service was matching and now does no more match : call unbind
- if a service was matching and still matches : modified method called

The callback supports regular arguments (no arg, service object, service reference, service
object + map, service object + dictionary ...)

  was:
iPOJO provides bind and unbind callback to notify the arrival and the departure of a service.
Currently, service modification was mapped as follows:
- if the service was not matching and now matches : call bind
- if the service was matching and now does no more match : call unbind
- if a service was matching and still matches : ignore

The issue modifies the third case to call a 'modify' callback.
Service dependencies will support a new 'type' : modify; such as in
 <component
    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
    name="ObjectModifyCheckServiceProvider" architecture="true">
    <requires field="fs">
      <callback type="bind" method="objectBind" />
      <callback type="unbind" method="objectUnbind" />
      <callback type="modified" method="objectModify" />
    </requires>
    <provides />
</component>

The equivalent annotation will be also provided:
    @Bind(id="mod")
    public void bindMod() {  }
    
    @Unbind(id="mod")
    public void unbindMod() {  }
    
    @Modified(id="mod")
    public void modifyMod() {  }

So, the new mapping will be:
- if the service was not matching and now matches : call bind
- if the service was matching and now does no more match : call unbind
- if a service was matching and still matches : modified method called

The callback support regular arguments (no arg, service object, service reference, service
object + map, service object + dictionary ...)


> Allows calling a method when service properties of an already injected service are modified
> -------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1906
>                 URL: https://issues.apache.org/jira/browse/FELIX-1906
>             Project: Felix
>          Issue Type: Improvement
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0
>            Reporter: Clement Escoffier
>            Assignee: Clement Escoffier
>             Fix For: iPOJO-1.6.0
>
>
> iPOJO provides bind and unbind callback to notify the arrival and the departure of a
service. Currently, service modification was mapped as follows:
> - if the service was not matching and now matches : call bind
> - if the service was matching and now does no more match : call unbind
> - if a service was matching and still matches : ignore
> The issue modifies the third case to call a 'modify' callback.
> Service dependencies will support a new 'type' : modify; such as in
>  <component
>     classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
>     name="ObjectModifyCheckServiceProvider" architecture="true">
>     <requires field="fs">
>       <callback type="bind" method="objectBind" />
>       <callback type="unbind" method="objectUnbind" />
>       <callback type="modified" method="objectModify" />
>     </requires>
>     <provides />
> </component>
> The equivalent annotation will be also provided:
>     @Bind(id="mod")
>     public void bindMod() {  }
>     
>     @Unbind(id="mod")
>     public void unbindMod() {  }
>     
>     @Modified(id="mod")
>     public void modifyMod() {  }
> So, the new mapping will be:
> - if the service was not matching and now matches : call bind
> - if the service was matching and now does no more match : call unbind
> - if a service was matching and still matches : modified method called
> The callback supports regular arguments (no arg, service object, service reference, service
object + map, service object + dictionary ...)

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


Mime
View raw message