Interface LoadBalancerLifecycle<RC,RES,T>
public interface LoadBalancerLifecycle<RC,RES,T>
Allows to define actions that should be carried out before and after load-balancing.
- Author:
- Olga Maciaszek-Sharma
-
Method Summary
Modifier and TypeMethodDescriptionvoidonComplete(CompletionContext<RES, T, RC> completionContext) A callback method executed after load-balancing.voidA callback method executed before load-balancing.voidonStartRequest(Request<RC> request, Response<T> lbResponse) A callback method executed after a service instance has been selected, before executing the actual load-balanced request.default booleanAllows to assess whether the lifecycle bean's callbacks should be executed.
-
Method Details
-
supports
Allows to assess whether the lifecycle bean's callbacks should be executed. Some examples of possible implementations could comprise of verifying whether the classes passed in parameters are exactly or extend the classes that this lifecycle bean should process.- Parameters:
requestContextClass- The class of theRequestcontextresponseClass- The class of theCompletionContextclientResponseserverTypeClass- The type of Server that the LoadBalancer retrieves- Returns:
trueif the lifecycle should be used to process given classes
-
onStart
-
onStartRequest
A callback method executed after a service instance has been selected, before executing the actual load-balanced request. -
onComplete
A callback method executed after load-balancing.- Parameters:
completionContext- theCompletionContextcontaining data relevant to the load-balancing and the response returned from the selected service instance
-