Interface AlgorithmService

All Known Implementing Classes:
StandardAlgorithmService, TestingAlgorithmService

public interface AlgorithmService
Service interface for algorithm provider discovery and execution.

This interface abstracts the logic previously held in AlgorithmManager to allow for better test isolation and dynamic backend steering.

Since:
1.2
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Summary

    Modifier and Type
    Method
    Description
    <P extends AlgorithmProvider, R>
    R
    executeWithFallback(Class<P> providerClass, Function<P,R> operation)
    Executes an operation with automatic fallback through the provider chain.
    <P extends AlgorithmProvider>
    P
    getProvider(Class<P> providerClass)
    Gets the best available provider for the given class.
    <P extends AlgorithmProvider>
    List<P>
    getProviders(Class<P> providerClass)
    Gets all available providers for the given class, sorted by priority.
    boolean
    Checks if a provider with the given name is filtered out by global configuration.
    void
    Refreshes the provider cache.
    void
    Shuts down the service and all managed providers.
  • Method Details

    • getProvider

      <P extends AlgorithmProvider> P getProvider(Class<P> providerClass)
      Gets the best available provider for the given class.
    • getProviders

      <P extends AlgorithmProvider> List<P> getProviders(Class<P> providerClass)
      Gets all available providers for the given class, sorted by priority.
    • executeWithFallback

      <P extends AlgorithmProvider, R> R executeWithFallback(Class<P> providerClass, Function<P,R> operation)
      Executes an operation with automatic fallback through the provider chain.
    • isFiltered

      boolean isFiltered(String name)
      Checks if a provider with the given name is filtered out by global configuration.
      Parameters:
      name - the provider name
      Returns:
      true if filtered out
    • refresh

      void refresh()
      Refreshes the provider cache.
    • shutdown

      void shutdown()
      Shuts down the service and all managed providers.