Class PeerDriverDiscovery


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

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

Example:

 public class MyPeerDiscovery extends PeerDriverDiscovery {
   @Override
   public void discover() {
     newConnection(new DriverConnectionInfo("driver1", false, "localhost", 11111));
   }
 }
 

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

  • create a file named META-INF/services/org.jppf.discovery.PeerDriverDiscovery
  • in this file, for each discovery implementation add a line with the fully qualified name of the implementation class, for instance: org.jppf.example.MyPeerDiscovery
Author:
Laurent Cohen
  • Constructor Details

    • PeerDriverDiscovery

      public PeerDriverDiscovery()