Class StandardAlgorithmService
java.lang.Object
org.episteme.core.technical.algorithm.StandardAlgorithmService
- All Implemented Interfaces:
AlgorithmService
Standard implementation of
AlgorithmService.
delegates to the traditional SPI and Backend discovery mechanisms.- Since:
- 1.2
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
StandardAlgorithmService
public StandardAlgorithmService()
-
-
Method Details
-
getProvider
Description copied from interface:AlgorithmServiceGets the best available provider for the given class.- Specified by:
getProviderin interfaceAlgorithmService
-
getProviders
Description copied from interface:AlgorithmServiceGets all available providers for the given class, sorted by priority.- Specified by:
getProvidersin interfaceAlgorithmService
-
isFiltered
Description copied from interface:AlgorithmServiceChecks if a provider with the given name is filtered out by global configuration.- Specified by:
isFilteredin interfaceAlgorithmService- Parameters:
name- the provider name- Returns:
- true if filtered out
-
executeWithFallback
public <P extends AlgorithmProvider, R> R executeWithFallback(Class<P> providerClass, Function<P, R> operation) Description copied from interface:AlgorithmServiceExecutes an operation with automatic fallback through the provider chain.- Specified by:
executeWithFallbackin interfaceAlgorithmService
-
refresh
public void refresh()Description copied from interface:AlgorithmServiceRefreshes the provider cache.- Specified by:
refreshin interfaceAlgorithmService
-
shutdown
public void shutdown()Description copied from interface:AlgorithmServiceShuts down the service and all managed providers.- Specified by:
shutdownin interfaceAlgorithmService
-