Notes for Java Developers
Here are some notes for Java developers.
Stop Java Client by using a property
Unlike C++ and .NET clients, a Java client does not stop automatically. It remains pending after submitting Services and collecting results. Instead of calling
System.exit() to stop the client, you can set a property to change this behavior. Add this line to your code:
DriverManager.setProperty(DriverManager.IS_DAEMON, Boolean.TRUE.toString());
You can also enable this by setting
DSIsDaemon=true in the driver.properties file.
When this property is set to true, all client threads are daemon threads, meaning that they allow the process to shut down when all threads have shut down.
HTTP Connection Parameters
The following parameters are specific for Java Drivers:
| Parameter | Default value | Description |
|---|---|---|
DSHttpMaxConnectionTotal |
500 | It controls how many maximum concurrent connections the Driver application can have at any given time. To change the default value, you can specify -DDSHttpMaxConnectionTotal=800 as JAVA OPTION (as one of the System properties) or specify the following parameter: DSHttpMaxConnectionTotal= |
DSHttpMaxPerRoute |
80 | It controls how many maximum concurrent connections per Route the Driver application can have at any given time. To change the default value, you can specify -DDSHttpMaxPerRoute=100 as JAVA OPTION or specify the following parameter: DSHttpMaxPerRoute= |
DSHttpDDTKeepalive |
True |
It controls whether to keep the HTTP connection alive for DDT requests. To change the default value, you can specify -DDSHttpDDTKeepalive=false as JAVA OPTION or specify the following parameter: DSHttpDDTKeepalive= |
DSHttpSubmissionKeepalive |
True |
It controls whether to keep the HTTP connection alive for tasks submission requests. To change the default value, you can specify -DDSHttpSubmissionKeepalive=false as JAVA OPTION or specify the following parameter: DSHttpSubmissionKeepalive= |
DSHttpImplementation |
com.livecluster.util.http.ApacheHttpClientSupportFactory |
It controls which HTTP communication implementation is applied. The default is Apache HttpClient. To change the default value to JRE HTTP Connection implementation, you can specify -Dds.DSHttpImplementation=com.livecluster.util.http.JavaHttpSupportFactory as JAVA OPTION (System property) or specify the following parameter: DSHttpImplementation= |