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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.axis2.engine.Handler
org.apache.axis2.engine.Handler.InvocationResponse -
Field Summary
FieldsFields inherited from class org.apache.axis2.handlers.AbstractHandler
handlerDesc -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract intorg.apache.axis2.engine.Handler.InvocationResponseinvoke(org.apache.axis2.context.MessageContext msgContext) loadThrottle(org.apache.axis2.context.MessageContext messageContext, int throttleType) Loads a throttle metadata for a particular throttle typevoidprocessing through the throttle 1) concurrent throttling 2) access rate based throttling - domain or ipMethods inherited from class org.apache.axis2.handlers.AbstractHandler
cleanup, flowComplete, getHandlerDesc, getName, getParameter, init, toString
-
Field Details
-
THROTTLING_CACHE_MANAGER
- See Also:
-
THROTTLING_CACHE
- See Also:
-
-
Constructor Details
-
ThrottleHandler
public ThrottleHandler()
-
-
Method Details
-
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
-