Results 1 to 3 of 3

Thread: Spring properties for <osgi:reference> backed by factory bean

  1. #1

    Question Spring properties for <osgi:reference> backed by factory bean

    I'm attempting to create a service factory which provides a new instance of a service to each client bundle, where the instanced service uses the service providers classloader. I'd also like the client bundles to be able to configure these individual services during creation (ideally by passing a parameter(s) to a factory-method like setup). As I understand section 3.3.2 of Spring OSGi Specification (v0.7), <osgi:reference> should support bean properties? Was this feature taken out? Or, even better, is there a better way of doing this?

    Thank you.

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    ServiceFactory is an interface defined by OSGi specification to allow for customizations around OSGi Service creation
    http://www.osgi.org/javadoc/r4v41/or...ceFactory.html
    Here is the small example of its usage: http://www.knopflerfish.org/osgi_ser...what_isfactory
    As for <osgi:reference> element and properties. . . You might want to read up on OSGi Services in general. In the nutshell OSGi Service could be registered not only with an interface(s), but with arbitrary properties allowing you to filter based on such properties when performing service lookup. So Spring does supports property elements nested inside of an <osgi:reference>.
    You can get more information from the Spring-DM documentation as well:
    http://static.springframework.org/os...-registry:refs
    Last edited by oleg.zhurakousky; Mar 2nd, 2009 at 01:15 PM.

  3. #3

    Default

    Thank you for the quick reply. Using filters does appear to be a much better way of doing this. I'll look more into it.

Tags for this Thread

Posting Permissions

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