felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Artem Zhirkov ...@develdynamic.com>
Subject Re: A proper way to retrieve RepositoryAdmin service?
Date Sat, 25 Oct 2014 14:17:16 GMT
Ok, I tried to make a custom Activator for the main bundle and added a 
ServiceTracker for RepositoryAdmin service...still can't get this 
service, it's not available in ServiceTracker. Seems like I missing 
something...


On 25.10.2014 15:40, Artem Zhirkov wrote:
> Hello,
>
> I'm trying to retrieve a reference to RepositoryAdmin service like that:
>
>> public static RepositoryAdmin getRepositoryAdmin(BundleContext ctx){
>>         ServiceReference reference = 
>> ctx.getServiceReference(RepositoryAdmin.class.getName());
>>         if (reference != null){
>>             return (RepositoryAdmin)ctx.getService(reference);
>>         }
>>         System.out.println("Reference null");
>>         return null;
>>     }
>
> but it always prints Reference null. What I'm doing wrong? 
> BundleContext is received from Framework which is produced by 
> FrameworkFactory with no config parameters.
>
> Thanks
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>



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


Mime
View raw message