You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Marcel Hanser <ma...@nanohome.de> on 2011/05/24 18:58:27 UTC

ServicePermission changes on runtime and the ServiceTracker

Hi,

currently im playing around with OSGi security. I wrote two bundles a 
consumer and a producer of a specific service. The consumer bundles 
opens a ServiceTracker, with a Dummy-logging-ServiceTrackerCustomizer 
and the provider just registers the service.
The consumer does not have the "Get" ServicePermission to get the 
service which is provided by the producer bundle and as expected it is 
not informed about the service registration.
Now i changed the ServicePermission of the consumer-bundle on runtime  
to allow the consuming of the service, but the ServiceTracker is not 
informed about the permission change... only a refresh of the consumer 
bundle triggers the ServiceTrackerCustomer functions...
So: should a ServiceTracker not trigger my bundle for each new available 
Service?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: ServicePermission changes on runtime and the ServiceTracker

Posted by Marcel Hanser <ma...@nanohome.de>.
Hi Karl,
thank you for your response. And sry for my late answer, the example 
took more time as i thought...
See attached file for the demonstrator.
It includes a simple felix destribution including 3 demo bundles, see 
./demoSources folder for sources. For a correct working you might insert 
the logback-classic-0.9.28 and logback-core-0.9.28 jars into the 
"bundle/core" folder (they didnt fit into the email).
The producer is just installed on default, so tip "start 1" and it 
should start. The producer fills the ConditionalPermissionAdmin with 
described policies (see also security.perm in the rootfolder)  and 
registers the service....
after 5 seconds it permits the consumer bundle to get the service and 
nothing happens. Only a refresh of the consumer bundle triggers the 
ServiceTracker, that also implicit means that the permission is 
correctly assigned.


> sounds like it should. However, its hard to say from your description
> as there a lot of unknowns. Can you maybe make your example available?
>
> regards,
>
> Karl
>
> On Tue, May 24, 2011 at 6:58 PM, Marcel Hanser
> <ma...@nanohome.de> wrote:
>> Hi,
>>
>> currently im playing around with OSGi security. I wrote two bundles a
>> consumer and a producer of a specific service. The consumer bundles 
>> opens a
>> ServiceTracker, with a Dummy-logging-ServiceTrackerCustomizer and the
>> provider just registers the service.
>> The consumer does not have the "Get" ServicePermission to get the service
>> which is provided by the producer bundle and as expected it is not 
>> informed
>> about the service registration.
>> Now i changed the ServicePermission of the consumer-bundle on runtime  to
>> allow the consuming of the service, but the ServiceTracker is not 
>> informed
>> about the permission change... only a refresh of the consumer bundle
>> triggers the ServiceTrackerCustomer functions...
>> So: should a ServiceTracker not trigger my bundle for each new available
>> Service?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>
>
>


Re: ServicePermission changes on runtime and the ServiceTracker

Posted by Karl Pauls <ka...@gmail.com>.
sounds like it should. However, its hard to say from your description
as there a lot of unknowns. Can you maybe make your example available?

regards,

Karl

On Tue, May 24, 2011 at 6:58 PM, Marcel Hanser
<ma...@nanohome.de> wrote:
> Hi,
>
> currently im playing around with OSGi security. I wrote two bundles a
> consumer and a producer of a specific service. The consumer bundles opens a
> ServiceTracker, with a Dummy-logging-ServiceTrackerCustomizer and the
> provider just registers the service.
> The consumer does not have the "Get" ServicePermission to get the service
> which is provided by the producer bundle and as expected it is not informed
> about the service registration.
> Now i changed the ServicePermission of the consumer-bundle on runtime  to
> allow the consuming of the service, but the ServiceTracker is not informed
> about the permission change... only a refresh of the consumer bundle
> triggers the ServiceTrackerCustomer functions...
> So: should a ServiceTracker not trigger my bundle for each new available
> Service?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Karl Pauls
karlpauls@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org