Class ClientSideSlowDownInterceptor
java.lang.Object
org.distributeme.core.interceptor.AbstractClientSideRequestInterceptor
org.distributeme.core.interceptor.availabilitytesting.ClientSideSlowDownInterceptor
- All Implemented Interfaces:
ClientSideRequestInterceptor
- Direct Known Subclasses:
ClientSideSlowDownByConfigurationInterceptor,ClientSideSlowDownByPropertyInterceptor
Base class for client side slow down interceptors.
- Version:
- $Id: $Id
- Author:
- lrosenberg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeforeServiceCall(ClientSideCallContext context, InterceptionContext iContext) Called after client side processing but before the actual call is performed.protected abstract longReturns the amount of time in milliseconds the call should be slowed down.protected abstract booleanslowDown(ClientSideCallContext context) Returns true if current call should be slowed down.Methods inherited from class org.distributeme.core.interceptor.AbstractClientSideRequestInterceptor
afterServiceCall
-
Constructor Details
-
ClientSideSlowDownInterceptor
public ClientSideSlowDownInterceptor()
-
-
Method Details
-
beforeServiceCall
public InterceptorResponse beforeServiceCall(ClientSideCallContext context, InterceptionContext iContext) Called after client side processing but before the actual call is performed.- Specified by:
beforeServiceCallin interfaceClientSideRequestInterceptor- Overrides:
beforeServiceCallin classAbstractClientSideRequestInterceptor- Parameters:
context- aClientSideCallContextobject.iContext- aInterceptionContextobject.- Returns:
- a
InterceptorResponseobject.
-
slowDown
Returns true if current call should be slowed down. This decision is mostly based on service id.- Parameters:
context- aClientSideCallContextobject.- Returns:
- a boolean.
-
getSlowDownTime
protected abstract long getSlowDownTime()Returns the amount of time in milliseconds the call should be slowed down.- Returns:
- a long.
-