Class WeightCalculatorWebFilter
java.lang.Object
org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter
- All Implemented Interfaces:
EventListener, org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>, org.springframework.context.event.SmartApplicationListener, org.springframework.core.Ordered, org.springframework.web.server.WebFilter
public class WeightCalculatorWebFilter
extends Object
implements org.springframework.web.server.WebFilter, org.springframework.core.Ordered, org.springframework.context.event.SmartApplicationListener
- Author:
- Spencer Gibb, Alexey Nakidkin
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intOrder of Weight Calculator Web filter.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionWeightCalculatorWebFilter(org.springframework.beans.factory.ObjectProvider<RouteLocator> routeLocator, ConfigurationService configurationService) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void> filter(org.springframework.web.server.ServerWebExchange exchange, org.springframework.web.server.WebFilterChain chain) intgetOrder()voidhandle(PredicateArgsEvent event) voidonApplicationEvent(org.springframework.context.ApplicationEvent event) voidsetOrder(int order) voidsetRandomFunction(Function<org.springframework.web.server.ServerWebExchange, Double> randomFunction) voidsetRandomSupplier(Supplier<Double> randomSupplier) booleansupportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType) booleansupportsSourceType(@Nullable Class<?> sourceType) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecutionMethods inherited from interface org.springframework.context.event.SmartApplicationListener
getListenerId
-
Field Details
-
WEIGHT_CALC_FILTER_ORDER
public static final int WEIGHT_CALC_FILTER_ORDEROrder of Weight Calculator Web filter.- See Also:
-
-
Constructor Details
-
WeightCalculatorWebFilter
public WeightCalculatorWebFilter(org.springframework.beans.factory.ObjectProvider<RouteLocator> routeLocator, ConfigurationService configurationService)
-
-
Method Details
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered- Specified by:
getOrderin interfaceorg.springframework.context.event.SmartApplicationListener
-
setOrder
public void setOrder(int order) -
setRandomSupplier
-
setRandomFunction
-
supportsEventType
public boolean supportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType) - Specified by:
supportsEventTypein interfaceorg.springframework.context.event.SmartApplicationListener
-
supportsSourceType
- Specified by:
supportsSourceTypein interfaceorg.springframework.context.event.SmartApplicationListener
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.ApplicationEvent event) - Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
-
handle
-
filter
public reactor.core.publisher.Mono<Void> filter(org.springframework.web.server.ServerWebExchange exchange, org.springframework.web.server.WebFilterChain chain) - Specified by:
filterin interfaceorg.springframework.web.server.WebFilter
-