Class WeightCalculatorFilter

java.lang.Object
org.springframework.cloud.gateway.server.mvc.filter.WeightCalculatorFilter
All Implemented Interfaces:
jakarta.servlet.Filter, EventListener, org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>, org.springframework.context.event.SmartApplicationListener, org.springframework.core.Ordered

public class WeightCalculatorFilter extends Object implements jakarta.servlet.Filter, org.springframework.core.Ordered, org.springframework.context.event.SmartApplicationListener
Author:
Spencer Gibb, Alexey Nakidkin
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Order of Weight Calculator Web filter.

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain)
     
    int
     
    void
    onApplicationEvent(org.springframework.context.ApplicationEvent event)
     
    void
    setOrder(int order)
     
    void
     
    boolean
    supportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType)
     
    boolean
    supportsSourceType(@Nullable Class<?> sourceType)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.context.ApplicationListener

    supportsAsyncExecution

    Methods inherited from interface jakarta.servlet.Filter

    destroy, init

    Methods inherited from interface org.springframework.context.event.SmartApplicationListener

    getListenerId
  • Field Details

    • WEIGHT_CALC_FILTER_ORDER

      public static final int WEIGHT_CALC_FILTER_ORDER
      Order of Weight Calculator Web filter.
      See Also:
  • Constructor Details

    • WeightCalculatorFilter

      public WeightCalculatorFilter()
  • 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)
    • 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>
    • doFilter

      public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException
      Specified by:
      doFilter in interface jakarta.servlet.Filter
      Throws:
      IOException
      jakarta.servlet.ServletException