Class ServerSideSlowDownInterceptor
java.lang.Object
org.distributeme.core.interceptor.AbstractServerSideRequestInterceptor
org.distributeme.core.interceptor.availabilitytesting.ServerSideSlowDownInterceptor
- All Implemented Interfaces:
ServerSideRequestInterceptor
- Direct Known Subclasses:
ServerSideSlowDownByConfigurationInterceptor,ServerSideSlowDownByPropertyInterceptor
Base class for service side slow down interceptors.
- Version:
- $Id: $Id
- Author:
- lrosenberg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeforeServantCall(ServerSideCallContext context, InterceptionContext iContext) Called before any real processing happens on the server side.protected abstract longReturns the amount of time in milliseconds the call should be slowed down.protected abstract booleanslowDown(ServerSideCallContext context) Returns true if current call should be slowed down.Methods inherited from class org.distributeme.core.interceptor.AbstractServerSideRequestInterceptor
afterServantCall
-
Constructor Details
-
ServerSideSlowDownInterceptor
public ServerSideSlowDownInterceptor()
-
-
Method Details
-
beforeServantCall
public InterceptorResponse beforeServantCall(ServerSideCallContext context, InterceptionContext iContext) Called before any real processing happens on the server side.- Specified by:
beforeServantCallin interfaceServerSideRequestInterceptor- Overrides:
beforeServantCallin classAbstractServerSideRequestInterceptor- Parameters:
context- aServerSideCallContextobject.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- aServerSideCallContextobject.- Returns:
- a boolean.
-
getSlowDownTime
protected abstract long getSlowDownTime()Returns the amount of time in milliseconds the call should be slowed down.- Returns:
- a long.
-