Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
iPOJO-1.4.0
-
None
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 ...)