[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [ecf-dev] in ECF service client, how to get the ID of a service being added?
|
- From: David Donohue <dd@xxxxxxxxxxxxxxxx>
- Date: Tue, 27 Oct 2009 11:40:59 -0400
- Delivered-to: ecf-dev@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:reply-to:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; bh=bySAh9KRFLvKBbt9MfuRJVcWdDAG8XitE3hDwlxoVc8=; b=JRgm2VHuOuVtaiOkty0w8MPyX1LuEf8YoN6BAYLWs6pq1Y83eesnbl23XA90RCmXvi R6lwjbPnaFZpkXZEElS0yoP5EotBjOb7oqRcJR/ysJZJGPexTrYLSrgXKHesk8SyKFin 3D0dRwosEIsKXJpSMV6ERrrgfLGBlShwShSyA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=j5IPm5BxrbNy4ZwutB6XczscSzVMT4E0Jiv1GPPf9bALAKuzHGQrJy7i+09tJ4biQR vp3zzjmVeVgikhXSecjeDLnIrT3BnMtTS56z7jvdgzS2LZYHPZenR0UAf2/H1DNz71M7 /JrgCa3uFbRKqv0QxCHG4lNt7ZQwaN9Y5gxG0=
Scott,
Thanks for your replies! This worked quite well for me
On the server:
Properties props = new Properties();
props.put("myHostContainerName",containerID.getName());
context.registerService(svcInterfaces,svcImpl,props);
On the client:
public Object addingService(ServiceReference reference) {
String hostUri = (String)reference.getProperty("myHostContainerName");
Best,
David Donohue
On Tue, Oct 27, 2009 at 11:27 AM, Scott Lewis <slewis@xxxxxxxxxxxxx> wrote:
> Hi David,
>
> Also...for your and everyone else's info, in order to access this
> information more easily for all proxies, I added a method on
> IRemoteServiceProxy to get the remote service reference for a proxy. This
> allows access to the IRemoteServiceID, and the associated containerID, along
> with other metadata (like service properties). This will be in future
> versions of ECF (of course).
>
> Scott
>
> David Donohue wrote:
>>
>> Hello,
>> My ECF client is using ServiceTracker to be notified of services from
>> remote servers. Using generic service. My method
>> addingService(ServiceReference reference)
>> gets called whenever a new service starts up. In that method, how can
>> I identify what is the ID/URI of a server that hosts the service?
>> Thanks,
>> David Donohue
>> _______________________________________________
>> ecf-dev mailing list
>> ecf-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/ecf-dev
>>
>
>