Announcement Announcement Module

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
<reference> filter and "managed" properties Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • <reference> filter and "managed" properties

    Is there a way to have a service "reference" be re-looked up in cases where the filter expression references a property in configurationadmin that has changed? I'm doing something along the lines of:

    <reference... filter="${filter}"/>

    and would like to be able to dynamically modify the value of ${filter} and have the service reference be re-resolved.


  • #2
    Hi Michael,

    have you already found a solution for your problem? In case you did, could you please tell me how you achieved this?



    • #3
      No, I have not found a solution to this.


      • #4
        You could use a PropertyPlaceholderConfigurer to do replacement or use SpEL in Spring 3.0 for dynamic evaluations.


        • #5
          That's not the problem. I've done that. However, in the OSGi environment, I can get my other beans to respond to changes in a properties file at runtime using managed properties. But the filter expression for a service reference does not get notified when the properties change like other beans do.


          • #6
            Right - the filter is static and that's on purpose since the idea is to track services that follow a "static" criteria. If the criteria is dynamic, then the problem gets complicated since the filter can have class/service constraints that are incompatible with the service tracking proxy.


            • #7
              I guess I was hoping for a way to update that proxy based on a concrete event. Since the container already triggers managed property events for beans when a tracked properties file changes, I was hoping the service tracker could likewise respond to the same events. I don't need it to be "adaptive" in the sense that it is constantly recalculating its filter. I guess I'll play with listeners and service collections and see if I can achieve what I'm trying to do that way. A "managed filter" would have been a nice shortcut, though.