Class JPPFCsvPropertyConnectionStrategy

java.lang.Object
org.jppf.node.connection.AbstractCsvConnectionStrategy
org.jppf.node.connection.JPPFCsvPropertyConnectionStrategy
All Implemented Interfaces:
DriverConnectionStrategy

public class JPPFCsvPropertyConnectionStrategy extends AbstractCsvConnectionStrategy
This implementation of DriverConnectionStrategy reads a list of drivers from a configuration property with the following format:

jppf.server.connection.strategy.definitions = secure1, host1, port1, recovery_enabled1 | ... | secureN, hostN, portN, recovery_enabledN

where:

  • each connection definition is represented as a group of comma-separated values
  • csv groups are separated with the '|' (pipe) character
  • in each csv group:
    • securei is a boolean value (either 'true' or 'false', case-insenssitive) indicating whether a SSL/TLS connection should be established. any value that is not 'true' will be interpreted as 'false'.
    • hosti is the host name or ip address of the driver to connect to
    • porti is the port to connect to on the driver host
    • recovery_enabledi is a boolean value (either 'true' or 'false', case-insenssitive) indicating whether the recovery (or heartbeat) mechanism is enabled for the node

Additionally, any group of comma-separated values starting with a '#' (after trimming) will be considered a comment and ignored. This allows writing the value of the property on multiple lines, with comments, as follows:

jppf.server.connection.strategy.definitions = \
   # definition for server 1 |\
   false, my.host1.org, 11111, -1 |\
   # definition for server 2 |\
   true, my.host2.org, 11443, 2222
 

The listed drivers will be used as if they were arrayed in a "circle", with the driver selection mechanism rotating one tick each time nextConnectionInfo() is invoked.

Since:
6.0
Author:
Laurent Cohen
  • Constructor Details

    • JPPFCsvPropertyConnectionStrategy

      public JPPFCsvPropertyConnectionStrategy()
      Find and read the connection information.
    • JPPFCsvPropertyConnectionStrategy

      public JPPFCsvPropertyConnectionStrategy(org.jppf.utils.TypedProperties config)
      Find and read the connection information.
      Parameters:
      config - the node configuration.