Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-1906

Allow calling a method when service properties of an already injected service are modified

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: iPOJO-1.4.0
    • Fix Version/s: iPOJO-1.6.0
    • Component/s: iPOJO
    • Labels:
      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 ...)

        Attachments

          Activity

            People

            • Assignee:
              clement.escoffier Clement Escoffier
              Reporter:
              clement.escoffier Clement Escoffier
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: