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 TypeMethodDescription<P extends AlgorithmProvider, R>
RexecuteWithFallback(Class<P> providerClass, Function<P, R> operation) Executes an operation with automatic fallback through the provider chain.<P extends AlgorithmProvider>
PgetProvider(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.booleanisFiltered(String name) Checks if a provider with the given name is filtered out by global configuration.voidrefresh()Refreshes the provider cache.voidshutdown()Shuts down the service and all managed providers.
-
Method Details
-
getProvider
Gets the best available provider for the given class. -
getProviders
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
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.
-