Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ecf-dev] Validating RemoteServices Setup

Hello ECF-Dev,

I had followed the tutorial at
https://wiki.eclipse.org/index.php?title=EIG:Getting_Started_with_OSGi_Remote_Services&redirect=no

to make modifications to carry over an existing local OSGi setup to a Remote OSGi setup. But it doesn't look like the remote services changes are having an effect and I was wondering how I could validate the changes:

1) Based on the steps in the HelloHostApplication example:

// add ECF service property specifying container factory args
props.put(IDistributionConstants.SERVICE_EXPORTED_CONTAINER_FACTORY_ARGUMENTS,
              containerId);

I set containerId to "r-osgi://localhost:9280". But when I start this up, I don't see any service listening on port 9280 (using netstat). Is this expected or should I have to use port 9278?

When I try this directly in the examples code, I get an error on the consumer side as it seems to expect port 9278.

2) Also, why should localhost be specified in the containerId? After all, won't the Host Application always run on its "localhost" and would specifying a different host make sense?

3) On the Consumer side, the tutorial says:

getContainerFactory().createContainer(containerType);
helloServiceTracker = new ServiceTracker(bundleContext,createRemoteFilter(), this);
helloServiceTracker.open();

Note that the remote service can be accessed in a variety of ways...e.g. by using a ServiceTracker (as above), by using the BundleContext.getServiceReference methods, or injection via declarative services.

So instead of ServiceTracker, could I just do getServiceReference after the createContainer call? I tried it with the HelloHostApplication and Consumer examples using the (zeroconf, r-osgi) and (zookeeper, r-osgi) configurations (for both Host and Consumer) but it doesn't seem to work.

4) Is the createContainer call also necessary? I commented it out in the examples and didn't see any errors. I guess the example launch configurations are already creating a container and we still need it for more general cases.

Thanks for your help.

Regards,
Ramachandran


--
Ramachandran K. Narayanan
Software Engineer
RNET Technologies Inc.
240 W.Elmwood Drive, Suite 2010
Dayton, OH 45459-4248

Back to the top