Class ClientDriverDiscovery


public abstract class ClientDriverDiscovery extends DriverDiscovery<ClientConnectionPoolInfo>
Abstract superclass for custom driver discovery mechanisms in JPPF clients. The discovery is asynchhronus and the DriverDiscovery.discover() method of each instance runs in a separate thread.

To notify the client that a new driver is discovered, the newConnection(ClientConnectionPoolInfo) method must be called.

Example:

 public class MyDiscovery extends ClientDriverDiscovery {
   @Override
   public void discover() {
     newConnection(new ClientConnectionPoolInfo("driver1", false, "localhost", 11111, 0, 1, 1));
   }
 }
 

The name given to the connection pool information is used as a prefix for individual connection names, which are numbered starting from 1 and have the following format: "pool_name-n", where n is the connection number. In the example above, the individual connections will be named "driver1-1", "driver1-2", etc ...

Client driver discovery mechanisms are found in the classpath via the service provider interface (SPI):

  • create a file named META-INF/services/org.jppf.discovery.ClientDriverDiscovery
  • in this file, for each discovery implementation add a line with the fully qualified name of the implementation class, for instance: org.jppf.example.MyDiscovery
Since:
5.2.1
  • Constructor Details

    • ClientDriverDiscovery

      public ClientDriverDiscovery()