[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] Is ECF Discovery Service necessary when using RemoteServices

> On Behalf Of Markus Alexander Kuppe
> Sent: Friday, January 14, 2011 2:05 PM
> 
> On 01/14/2011 01:32 PM, Bartosz CzerwiÅski wrote:
> 
> > Let's say that the location of the service (protocol, IP address and port) is
> fixed. I registered service on the host side and tried to access it on the
> consumer side using ServiceTracker. Unfortunately it does not work. I'm not
> sure what I did wrong.
> 
> What does your ServiceTracker look like?
Host side:
Properties props = new Properties();
		props.put(IDistributionConstants.SERVICE_EXPORTED_INTERFACES,
				IDistributionConstants.SERVICE_EXPORTED_INTERFACES_WILDCARD);
		props.put(IDistributionConstants.SERVICE_EXPORTED_CONFIGS,
				CONTAINER_TYPE);
		props.put(
				IDistributionConstants.SERVICE_EXPORTED_CONTAINER_FACTORY_ARGUMENTS,
				CONTAINER_ID);
		serviceRegistration = bundleContext.registerService(
				IStockService.class.getName(), new GpwStockService(), props);

Consumer side:
stockServiceTracker = new ServiceTracker(bundleContext,
				bundleContext.createFilter("(&("
						+ org.osgi.framework.Constants.OBJECTCLASS + "="
						+ IStockService.class.getName() + ")("
						+ IDistributionConstants.SERVICE_IMPORTED + "=*))"),
				this);
		stockServiceTracker.open();

> 
> > Could sb provide an example of accessing remote service without
> discovery?
> 
> [0] gives a short introduction of the file based ECF discovery provider that fits
> your use case. [1] and [2] are a more comprehensive example (though slides
> are partly in German).
> 
> Markus
> 
> [0] http://wiki.eclipse.org/File-based_Discovery
> [1]
> https://github.com/lemmy/org.eclipse.ecf.winterschool/raw/master/org.ecl
> ipse.ecf.winterschool/EclipseCommunicationFramework.odp
> p.23 ff.
> [2]
> https://github.com/lemmy/de.c1wps.winterschool/tree/master/de.c1wps.
> winterschool.endpointdscr
> _______________________________________________
> ecf-dev mailing list
> ecf-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ecf-dev

Attachment: smime.p7s
Description: S/MIME cryptographic signature