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

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     

    Fields inherited from class org.apache.axis2.handlers.AbstractHandler

    handlerDesc
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract int
     
    org.apache.axis2.engine.Handler.InvocationResponse
    invoke(org.apache.axis2.context.MessageContext msgContext)
     
    loadThrottle(org.apache.axis2.context.MessageContext messageContext, int throttleType)
    Loads a throttle metadata for a particular throttle type
    void
    process(Throttle throttle, org.apache.axis2.context.MessageContext messageContext)
    processing through the throttle 1) concurrent throttling 2) access rate based throttling - domain or ip

    Methods inherited from class org.apache.axis2.handlers.AbstractHandler

    cleanup, flowComplete, getHandlerDesc, getName, getParameter, init, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • 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 messageContext
      throttleType - - 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 throttle
      messageContext - The MessageContext , that holds all data per message basis
      Throws:
      org.apache.axis2.AxisFault - Throws when access must deny for caller
      ThrottleException - 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