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
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
JPPFBundlerProviderinterface
- Author:
- Laurent Cohen
-
Method Summary
Modifier and TypeMethodDescriptioncreateBundler(T profile) Create a bundler instance using the specified parameters profile.createProfile(TypedProperties configuration) 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
Create a bundler instance using the specified parameters profile. The parameters profile is created by JPPF internally via a call tocreateProfile(TypedProperties).- Parameters:
profile- anBundlerinstance.- Returns:
- an instance of the bundler implementation defined by this provider.
-
createProfile
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
LoadBalancingProfileinstance.
-