Hello,
In fact there are 2 small issues in what you have done:
1) In the .bat file, you should specify
-Djppf.config.plugin=JPPFServerCon. The value must be the fully qualified name of the class that implements ConfigurationSource, in the Java notation
mypackage.MyClass. This also means that your class, and any supporting class, must be added to the driver's classpath. So in startDriver.bat, you should have
-cp C:/Users/spacitron/Projects/workspace/JPPFTest/bin;config;lib/* instead of just
-cp config;lib/*Here it is likely that your implementation is not taken into account because JPPF is unable to load the class, and the server uses default values for the configuration properties.
2) This one is mostly our fault. JPPFConfiguration is a essentially utility class with only static members. It's not supposed to be instantiable from another class. Furthermore the method getConfigurationStream() is an internal one and we (in fact I) should have made it private. I registered a bug report for this:
JPPF-165 JPPFConfiguration constructor and getConfigurationStream() method should be private. Thanks a lot for finding this out!
So a proper way to handle the configuration source would be as follows:
public class MyConfigurationSource implements JPPFConfiguration.ConfigurationSource {
public TestConfigurationSource() {
}
@Override
public InputStream getPropertyStream() throws IOException {
StringBuilder sb = new StringBuilder();
sb.append("jppf.server.port = 11111\n");
// disable discovery since UDP multicast doesn't work on EC2
sb.append("jppf.discovery.enabled = false\n");
// ... add other properties ...
return new ByteArrayInputStream(sb.toString().getBytes());
}
}
I hope this clarifies,
-Laurent