Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tcf-dev] registering an IServiceProvider

Hi,

If the daytime example is registering a custom TCF service, than we need to update the example to use the extension point. 

Best regards, Uwe :)



> -----Original Message-----
> From: tcf-dev-bounces@xxxxxxxxxxx [mailto:tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Tepavich,
> Scott
> Sent: Samstag, 28. Juli 2012 06:03
> To: TCF Development
> Subject: Re: [tcf-dev] registering an IServiceProvider
> 
> Hi Pawel -
> 
> I had a discussion with Uwe about this just a couple of weeks ago.  His suggestion was the following:
> 
> Snippet:
> ----------
> 
>     static {
>         Protocol.addChannelOpenListener(new Protocol.ChannelOpenListener() {
>             public void onChannelOpen(IChannel channel) {
>                 if (channel.getRemoteService(CustomService.NAME) == null) return;
>                 channel.setServiceProxy(ICustomService.class, new CustomServiceProxy(channel));
>             }
>         });
>     }
> 
> As this might work, the intended and more Eclipse-like way to register a custom TCF service is by
> contributing to the dedicated extension point:
> 
>    <extension point="org.eclipse.tcf.serviceProviders">
>       <serviceProvider
>             class="provider.services.systems.internal.ServiceProvider">
>       </serviceProvider>
>    </extension>
> 
> And implementing the service provider:
> 
> public class ServiceProvider implements IServiceProvider {
> 
> 	@Override
>     	public IService[] getLocalService(IChannel channel) {
> 		return null;
> 	}
> 
> 	@Override
>    	 public IService getServiceProxy(IChannel channel, String service_name) {
> 		if (ISystems.NAME.equals(service_name)) {
> 			return new SystemsProxy(channel);
> 		}
> 		return null;
> 	}
> }
> 
> I hope this helps.
> 
> BR -
> Scott
> 
> -----Original Message-----
> From: tcf-dev-bounces@xxxxxxxxxxx [mailto:tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Pawel Piech
> Sent: Friday, July 27, 2012 3:46 PM
> To: TCF Development
> Subject: [tcf-dev] registering an IServiceProvider
> 
> Hi,
> Is there a way to register my own service proxy with the org.eclipse.tcf.internal.core.ServiceManager?
> Or is
> IChannel.getRemoteService() intended to be used only for service proxies that are implemented in
> the org.eclipse.tcf.core plugin?
> 
> Thanks,
> Pawel
> _______________________________________________
> tcf-dev mailing list
> tcf-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/tcf-dev
> _______________________________________________
> tcf-dev mailing list
> tcf-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/tcf-dev


Back to the top