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 Details

    • WEIGHT_CALC_FILTER_ORDER

      public static final int WEIGHT_CALC_FILTER_ORDER
      Order 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:
      getOrder in interface org.springframework.core.Ordered
      Specified by:
      getOrder in interface org.springframework.context.event.SmartApplicationListener
    • setOrder

      public void setOrder(int order)
    • setRandomSupplier

      public void setRandomSupplier(Supplier<Double> randomSupplier)
    • setRandomFunction

      public void setRandomFunction(Function<org.springframework.web.server.ServerWebExchange, Double> randomFunction)
    • supportsEventType

      public boolean supportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType)
      Specified by:
      supportsEventType in interface org.springframework.context.event.SmartApplicationListener
    • supportsSourceType

      public boolean supportsSourceType(@Nullable Class<?> sourceType)
      Specified by:
      supportsSourceType in interface org.springframework.context.event.SmartApplicationListener
    • onApplicationEvent

      public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
    • handle

      public void handle(PredicateArgsEvent event)
    • filter

      public reactor.core.publisher.Mono<Void> filter(org.springframework.web.server.ServerWebExchange exchange, org.springframework.web.server.WebFilterChain chain)
      Specified by:
      filter in interface org.springframework.web.server.WebFilter