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

Re: [xmlblaster] Newbie Question



Blake Dournaee wrote:

Hello -

I am having a hard time figuring out how to change the IP address of the
XMLblaster server from my java program.



Assuming the SOCKET protocol: From command line it would be

java org.xmlBlaster.Main -plugin/socket/hostname 10.180.1.1


For example, when I make a new Global object instance like this:

final Global glob = new Global();

I believe the IP address of the server is read from a properties file
embedded in the jar file. By default it is set to localhost.

I would prefer to not have to mess with this file.

Is there a way I can change the IP address programmatically??




If you use the embedded xmlBlaster server try this:

import org.xmlBlaster.util.EmbeddedXmlBlaster;
...
  String[] args = { "-plugin/socket/hostname", "10.180.1.1"};
  globServer1.init(args);
  // or (if you have a master global this.glob_):
  // Global globServer1 = this.glob_.getClone(args);

EmbeddedXmlBlaster serverThread = EmbeddedXmlBlaster.startXmlBlaster(globServer1);


many examples you find in our test suite:
xmlBlaster/testsuite/src/java/org/xmlBlaster/test/cluster
have a look for example into SubscribeTest.java which uses ServerHelper.java to change configurations.
String[] args = { "-propertyFile", findPropertyFile("heron.properties"), "-info[heron]", "true" };
heronGlob = this.glob_.getClone(args);


regards,
Marcel