[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster] Configuring remote clients



Doug,

> I'm probably missing something obvious. But I've got lost somewhere.
>
> What I want to do is allow an xmlBlaster plugin to another piece of software
> -- a remote sensor monitoring application. Since I don't even want to assume
> that the xmlBlasterClient.jar present, I'd like to isolate the xmlBlaster
> interface into a class. When an instance of the class is created, I want to
> be able to initialise it with the hostname, protocol etc. of the xmlBlaster
> server. I'd like these to be properties that the class knows about and
> passes in when I do a connect(), or properties specified in the distributed
> xmlBlasterClient.jar. I don't want to capture command line options into a
> Global, since that would mean that my main() has to be written with the
> presence of xmlBlaster assumed.
>
> What's the best way of specifying connection properties on an on-the-fly
> basis?
>

On-the-Fly would mean properties. Take a look at the package:
org.jutils.init  at 
http://www.jutils.org
It's in use in xmlBlaster anyway.

Or use the -D in the commandline.

Or use something like following for the hardcoded way:
[...]
Global glob = null;
Properties prop System.getProperties();

prop.setProperty("client.protocol", "SOCKET");
prop.setProperty("socket.port", "7607");
prop.setProperty("socket.hostname", "localhost");

glob = new Global(prop);
[...]


HTH,
regards

Heinrich