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
FieldsModifier and TypeFieldDescriptionstatic final intOrder of Weight Calculator Web filter.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) intgetOrder()voidonApplicationEvent(org.springframework.context.ApplicationEvent event) voidsetOrder(int order) voidsetRandomSupplier(Supplier<Double> randomSupplier) booleansupportsEventType(Class<? extends org.springframework.context.ApplicationEvent> eventType) booleansupportsSourceType(@Nullable Class<?> sourceType) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecutionMethods inherited from interface jakarta.servlet.Filter
destroy, initMethods 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
-
WeightCalculatorFilter
public WeightCalculatorFilter()
-
-
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
-
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>
-
doFilter
public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException - Specified by:
doFilterin interfacejakarta.servlet.Filter- Throws:
IOExceptionjakarta.servlet.ServletException
-