felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Sauthier <Guillaume.Sauth...@objectweb.org>
Subject Re: SID
Date Wed, 09 Feb 2011 15:14:48 GMT


Le 09/02/2011 15:59, Pierre Henry Perret a écrit :
> This is exactly what I want to know.
>
> I suppose it is the typed object I'm using :
>
> context.getServiceReference(Class string);
>    

Yes
http://www.osgi.org/javadoc/r4v42/org/osgi/framework/ServiceReference.html

> But am I sur the sid is valid not null ?
>    

The spec mandates each service to have an id (service.id), pid is optional
http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Constants.html#SERVICE_ID

> Do I not have to use the ServiceRegistration ?
>    

ServiceRegistration is the handle the frameworks returns to you when you 
register a service.
ServiceReference is a consumer-side object

--G

>
>
>
>
>
> 2011/2/9 Guillaume Sauthier<Guillaume.Sauthier@objectweb.org>
>
>    
>> There is a service.id (or service.pid) property in the ServiceReference
>> How do you retrieve your reference ?
>> --G
>>
>> Le 09/02/2011 15:20, Pierre Henry Perret a écrit :
>>
>>   How to get the OSGi Service ID of a component instance (a service) ?
>>      
>>> Thanks
>>>
>>> --
>>> Pierre
>>>
>>>
>>>
>>>        
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>      
>    


Mime
View raw message