Interface JPPFBundlerProvider<T extends LoadBalancingProfile>

Type Parameters:
T - the type of parameters profile used by the bundler.
All Known Implementing Classes:
AutoTunedBundlerProvider, FixedSizeBundlerProvider, NodeThreadsBundlerProvider, ProportionalBundlerProvider, RL2BundlerProvider

public interface JPPFBundlerProvider<T extends LoadBalancingProfile>

Interface for all load-balancing algorithm providers. An implementation of this interface shall be provided for each load-balancing algorithm, to enable its dynamic discovery by JPPF components.

To integrate a load-balancing algorithm provider, the following steps should be performed:

  • At one of the classpath roots, ensure that there is a folder named META-INF/services
  • In this folder, create or edit a file named org.jppf.load.balancer.spi.JPPFBundlerProvider
  • In this file, add a line containing the fully qualified name of the class implementing the JPPFBundlerProvider interface
Author:
Laurent Cohen
  • Method Summary

    Modifier and Type
    Method
    Description
    createBundler(T profile)
    Create a bundler instance using the specified parameters profile.
    Create a bundler profile containing the parameters of the algorithm.
    Get the name of the algorithm defined by this provider.
  • Method Details

    • getAlgorithmName

      String getAlgorithmName()
      Get the name of the algorithm defined by this provider. Each algorithm must have a name distinct from that of all other algorithms.
      Returns:
      the algorithm's name as a string.
    • createBundler

      Bundler<T> createBundler(T profile)
      Create a bundler instance using the specified parameters profile. The parameters profile is created by JPPF internally via a call to createProfile(TypedProperties).
      Parameters:
      profile - an Bundler instance.
      Returns:
      an instance of the bundler implementation defined by this provider.
    • createProfile

      T createProfile(TypedProperties configuration)

      Create a bundler profile containing the parameters of the algorithm.

      The configuration parameter contains a set of properties that define the parameters names and values.
      The parameter names are provided without any JPPF configuration-specific prefix.

      For example: if the JPPF configuration file specifies a profile named "myProfile" (through the property "jppf.load.balancing.profile = myProfile"), and the algorithm has a parameter named "myParameter", then in the configuration file it will be specified as "jppf.load.balancing.profile.myProfile.myParameter = some_value".
      When this method is called, only the parameter name is kept, and its definition becomes "myParameter = some_value".

      Parameters:
      configuration - a set of properties defining the algorithm's parameters.
      Returns:
      an LoadBalancingProfile instance.