Class RouteExecutionStrategyUtils
- java.lang.Object
-
- io.servicetalk.router.utils.internal.RouteExecutionStrategyUtils
-
public final class RouteExecutionStrategyUtils extends java.lang.Object
Utilities to handleRouteExecutionStrategy
annotation.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends ExecutionStrategy>
TgetAndValidateRouteExecutionStrategyAnnotationIfPresent(java.lang.reflect.Method method, java.lang.Class<?> clazz, RouteExecutionStrategyFactory<T> strategyFactory, java.util.Set<java.lang.String> errors, T noOffloadsExecutionStrategy)
ReturnsExecutionStrategy
for the specifiedMethod
and validates that configuration ofRouteExecutionStrategy
annotation is correct if present.static java.lang.annotation.Annotation
getRouteExecutionStrategyAnnotation(java.lang.reflect.Method method, java.lang.Class<?> clazz)
static java.lang.annotation.Annotation
validateRouteExecutionStrategyAnnotationIfPresent(java.lang.reflect.Method method, java.lang.Class<?> clazz, RouteExecutionStrategyFactory<? extends ExecutionStrategy> strategyFactory, java.util.Set<java.lang.String> errors)
Validates configuration ofRouteExecutionStrategy
annotation is correct if present.
-
-
-
Method Detail
-
validateRouteExecutionStrategyAnnotationIfPresent
@Nullable public static java.lang.annotation.Annotation validateRouteExecutionStrategyAnnotationIfPresent(java.lang.reflect.Method method, java.lang.Class<?> clazz, RouteExecutionStrategyFactory<? extends ExecutionStrategy> strategyFactory, java.util.Set<java.lang.String> errors)
Validates configuration ofRouteExecutionStrategy
annotation is correct if present.- Parameters:
method
-Method
to validateclazz
-Class
to validatestrategyFactory
- aRouteExecutionStrategyFactory
that creates a specificExecutionStrategy
errors
- collection to track all errors related to misconfiguration- Returns:
- an instance of
RouteExecutionStrategy
annotation if present
-
getAndValidateRouteExecutionStrategyAnnotationIfPresent
@Nullable public static <T extends ExecutionStrategy> T getAndValidateRouteExecutionStrategyAnnotationIfPresent(java.lang.reflect.Method method, java.lang.Class<?> clazz, RouteExecutionStrategyFactory<T> strategyFactory, java.util.Set<java.lang.String> errors, T noOffloadsExecutionStrategy)
ReturnsExecutionStrategy
for the specifiedMethod
and validates that configuration ofRouteExecutionStrategy
annotation is correct if present.- Type Parameters:
T
- specific implementation type ofExecutionStrategy
- Parameters:
method
-Method
to validateclazz
-Class
to validatestrategyFactory
- aRouteExecutionStrategyFactory
that creates a specificExecutionStrategy
errors
- collection to track all errors related to misconfigurationnoOffloadsExecutionStrategy
- anExecutionStrategy
forNoOffloadsRouteExecutionStrategy
- Returns:
- a defined
ExecutionStrategy
ornull
if not defined
-
getRouteExecutionStrategyAnnotation
@Nullable public static java.lang.annotation.Annotation getRouteExecutionStrategyAnnotation(java.lang.reflect.Method method, java.lang.Class<?> clazz)
- Parameters:
method
- an endpoint methodclazz
- an endpoint class- Returns:
RouteExecutionStrategy
annotation if exists onMethod
orClass
-
-