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 TypeMethodDescriptionvoid
onComplete
(CompletionContext<RES, T, RC> completionContext) A callback method executed after load-balancing.void
A callback method executed before load-balancing.void
onStartRequest
(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 boolean
Allows 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 theRequest
context
responseClass
- The class of theCompletionContext
clientResponse
serverTypeClass
- The type of Server that the LoadBalancer retrieves- Returns:
true
if the lifecycle should be used to process given classes
-
onStart
A callback method executed before load-balancing.- Parameters:
request
- theRequest
that will be used by the LoadBalancer to select a service instance
-
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
- theCompletionContext
containing data relevant to the load-balancing and the response returned from the selected service instance
-