Class ThrottleHandler
- java.lang.Object
-
- org.apache.axis2.handlers.AbstractHandler
-
- org.apache.synapse.commons.throttle.module.handler.ThrottleHandler
-
- All Implemented Interfaces:
org.apache.axis2.engine.Handler
- Direct Known Subclasses:
GlobalThrottleHandler
,OperationLevelThrottleHandler
,ServiceLevelThrottleHandler
public abstract class ThrottleHandler extends org.apache.axis2.handlers.AbstractHandler
-
-
Field Summary
Fields Modifier and Type Field Description static String
THROTTLING_CACHE
static String
THROTTLING_CACHE_MANAGER
-
Constructor Summary
Constructors Constructor Description ThrottleHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract int
getThrottleType()
org.apache.axis2.engine.Handler.InvocationResponse
invoke(org.apache.axis2.context.MessageContext msgContext)
Throttle
loadThrottle(org.apache.axis2.context.MessageContext messageContext, int throttleType)
Loads a throttle metadata for a particular throttle typevoid
process(Throttle throttle, org.apache.axis2.context.MessageContext messageContext)
processing through the throttle 1) concurrent throttling 2) access rate based throttling - domain or ip
-
-
-
Field Detail
-
THROTTLING_CACHE_MANAGER
public static final String THROTTLING_CACHE_MANAGER
- See Also:
- Constant Field Values
-
THROTTLING_CACHE
public static final String THROTTLING_CACHE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getThrottleType
protected abstract int getThrottleType()
- Returns:
- int - indicates the type of the throttle according to the scope
-
loadThrottle
public Throttle loadThrottle(org.apache.axis2.context.MessageContext messageContext, int throttleType) throws ThrottleException
Loads a throttle metadata for a particular throttle type- Parameters:
messageContext
- - The messageContextthrottleType
- - The type of throttle- Returns:
- IPBaseThrottleConfiguration - The IPBaseThrottleConfiguration - load from AxisConfiguration
- Throws:
ThrottleException
- Throws if the throttle type is unsupported
-
process
public void process(Throttle throttle, org.apache.axis2.context.MessageContext messageContext) throws ThrottleException, org.apache.axis2.AxisFault
processing through the throttle 1) concurrent throttling 2) access rate based throttling - domain or ip- Parameters:
throttle
- The Throttle object - holds all configuration and state data of the throttlemessageContext
- The MessageContext , that holds all data per message basis- Throws:
org.apache.axis2.AxisFault
- Throws when access must deny for callerThrottleException
- ThrottleException
-
invoke
public org.apache.axis2.engine.Handler.InvocationResponse invoke(org.apache.axis2.context.MessageContext msgContext) throws org.apache.axis2.AxisFault
- Throws:
org.apache.axis2.AxisFault
-
-