Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] service discovery working even if port mis configured

Hi Scott,



What we want: simple client setup that just talks to the server supplied (which is only known at runtime of the client app - so xml service description cannot be used). The client is expected to get the server's IP adress from a local property file in the user home.

I'm not certain I understand what completely what you mean by 'xml service description cannot be used', but one possibility that occurs to me is that rather than one of the network discovery protocols (zookeeper, dnssd, slp, zeroconf), you could use an edef/xml description...with most of the information in it 'constant'...e.g. like in the timeservice examples here:

http://git.eclipse.org/c/ecf/org.eclipse.ecf.git/tree/examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery/timeserviceendpointdescription.xml

BUT...for the properties that you wish to change/set (e.g. the server's IP address from local property file)...you could dynamically/programmatically read an EDEF template file...set/change the necessary values...prior to using the newly constructed/manipulated EDEF to actually discover the service.

Before I go further with this...do you think this could satisfy your use case? It sounds to me from your description of what you want that it might...i.e. use a few local property files to read a few properties (i.e. server's IP address), change or create the associated EDEF, and then use that EDEF to trigger remote services discovery and remote service import. Does that seem right?
Yes, exactly. A dynamically generated EDEF would work for us.

ECF's RS impl does have some code that would/could assist with this...if it fits your desired use case. For example, we have classes for reading and writing EDEF...in EndpointDescriptionReader and EndpointDescriptionWriter classes...respectively...located here [1]. These could be used to read in a template, manipulate the EndpointDescription properties, and then write them out to a new EDEF file (presumably to a new bundle that would be subsequently started...thereby triggering RS discovery).

I've done this before myself (create/manipulate EDEF...dynamically create a new bundle...and start the new bundle to trigger RS discovery) on behalf of another user of OSGi Remote Services...so I'm quite sure it works properly.

Is there some example code for this dynamic EDEF approach you can point me to?

Thank you very much.

Regards,
Peter


Back to the top