Results 1 to 7 of 7

Thread: <reference> filter and "managed" properties

Hybrid View

  1. #1
    Join Date
    Mar 2010
    Posts
    12

    Default <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.

    Thanks,
    Michael.

  2. #2
    Join Date
    Jan 2010
    Posts
    12

    Default

    Hi Michael,

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

    fkh

  3. #3
    Join Date
    Mar 2010
    Posts
    12

    Default

    No, I have not found a solution to this.

  4. #4
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    You could use a PropertyPlaceholderConfigurer to do replacement or use SpEL in Spring 3.0 for dynamic evaluations.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  5. #5
    Join Date
    Mar 2010
    Posts
    12

    Default

    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. #6
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •