You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Saminda Abeyruwan <sa...@gmail.com> on 2008/05/12 12:06:09 UTC
Service permission
Hi Devs,
Assume service "SA" has being registered in bundle A. There exist another
bundle B, which would attempt to unregister the service "SA". Bundle A
should be the only place where service "SA" being registered or
unregistered. Would it be possible to apply a policy in bundle A to say
that. Any help will be utmost appreciated.
Thank you!
Saminda
--
Saminda Abeyruwan
Senior Software Engineer
WSO2 Inc. - www.wso2.org
Re: Service permission
Posted by Marcel Offermans <ma...@luminis.nl>.
On May 12, 2008, at 12:06 , Saminda Abeyruwan wrote:
> Assume service "SA" has being registered in bundle A. There exist
> another
> bundle B, which would attempt to unregister the service "SA".
> Bundle A
> should be the only place where service "SA" being registered or
> unregistered. Would it be possible to apply a policy in bundle A to
> say
> that. Any help will be utmost appreciated.
To unregister a service, you need a reference to the service
registration you got back when registering it. So, unless you
explicitly pass that on from bundle A to B, you cannot do what you
describe.
When saying stuff like "bundle A should be the only place where..."
you're going into the security layer of OSGi. Yes, you can typically
do things like that when you run with OSGi security enabled. Look at
the ConditionalPermissionAdmin service for ideas on how to do that.
Greetings, Marcel