Hey Marcel — thanks for the quick response. I’d definitely appreciate your take 
on solving this with the dependency manager.

From: Marcel Offermans 
<[email protected]<mailto:[email protected]>>
Reply-To: OSGi Developer Mail List 
<[email protected]<mailto:[email protected]>>
Date: Saturday, February 8, 2014 at 1:36 AM
To: OSGi Developer Mail List 
<[email protected]<mailto:[email protected]>>
Subject: Re: [osgi-dev] Question: Running a service from bundle A in the 
context of bundle B

On 08 Feb 2014, at 4:46 am, Derek Abdine 
<[email protected]<mailto:[email protected]>> wrote:

Hello! I’m building an extension platform using OSGi that will enable an 
individual to write a ruby script and stick it in a predefined location (say, 
/META-INF/foo/script.rb). I’d like to create a workflow that essentially:

  1.  Has a factory that watches for new bundles with a script in that location.
  2.  Creates a new managed service via the config admin that initializes a 
jruby runtime for that script and sticks it into the OSGi service registry.

That actually all works to this point, though I have one issue: I’d like the 
service that is created by the factory on behalf of the script bundle to act as 
if it were part of the script bundle, not the factory bundle as it currently 
stands. This is because I’d like to eventually take advantage of some of the 
Java security features of OSGi to prevent calls to System.exit, etc.

That service then has to be created using the BundleContext of the bundle that 
has the script.

If it helps, I’m using ipojo 1.11.1 as my DI framework and Felix 4.2.1 as my 
platform.

I'm going to have to let one of the iPOJO experts explain you how to do this.

Any pointers would be much appreciated! Thanks in advance!

If you're interested, I could show you an example of how to do this using the 
Dependency Manager.

Greetings, Marcel
This electronic message contains information which may be confidential or 
privileged. The information is intended for the use of the individual or entity 
named above. If you are not the intended recipient, be aware that any 
disclosure, copying, distribution or use of the contents of this information is 
prohibited. If you have received this electronic transmission in error, please 
notify us by e-mail at ([email protected]) immediately.
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to