0 Replies Latest reply on May 14, 2012 2:19 PM by rssole

    Inject osgi service reference into "non bundle" context - possible?

    rssole

      Hi,
      I am using JBoss 7.1.0 and... currently I'm injecting osgi bundle context into web app (servlet) or into ejb
      as jboss supports injection via @Resource... that is quite OK.

       

      Now, I have some blueprint-enabled bundle with beans and services created quite ok.

       

      So, I am simply curious if there is a way to inject service reference into some how to say - non osgi entity (ejb, servlet) instead of, like I'm doing now,
      obtaining it via BundleContext? Furthermore, I am aware of blueprint annotations but those are supported for inter-bundle injection and not to something
      outside of osgi context.

       

      I am aware of good practice of always accessing osgi service via service reference due to nature of osgi services to come and go dynamically,
      but I'm simply curious is something like this supported within JBoss currently?

       

      Perhaps the best way for this would be to turn web app into bundle?

       

      Best regards,
      RS