Package org.apache.synapse.commons.throttle.core.factory

# Class ThrottleContextFactory

java.lang.Object
org.apache.synapse.commons.throttle.core.factory.ThrottleContextFactory

public class ThrottleContextFactory extends Object
Factory for creating a ThrottleContext - holds all callers runtime data - the current state

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ThrottleContextFactory()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static ThrottleContext`
  `createThrottleContext(int throttletype, ThrottleConfiguration configuration)`
  To create a ThrottleContext for the given throttle type Needs to provide a throttle configuration
  `static ThrottleContextCleanupTask`
  `getThrottleContextCleanupTaskInstance()`
  Get throttle caller context cleanup task instance implementation
  `static ThrottleWindowReplicator`
  `getThrottleWindowReplicatorInstance()`
  Ger throttle window replicator instance to make sure that there will be one throttle replicator in the implementation
  `static UnifiedThrottleReplicator`
  `getUnifiedThrottleReplicatorInstance()`
  Get the unified throttle replicator instance to make sure there is one unified replicator in the implementation

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ThrottleContextFactory

    public ThrottleContextFactory()

- ## Method Details

  - ### createThrottleContext

    public static ThrottleContext createThrottleContext(int throttletype, ThrottleConfiguration configuration) throws ThrottleException
    To create a ThrottleContext for the given throttle type Needs to provide a throttle configuration
    Parameters:
      `throttletype` - - The type of the throttle
      `configuration` - - The throttle configuration
    Returns:
      ThrottleContext - The corresponding ThrottleContext for the given throttle type
    Throws:
      `ThrottleException` - - Throws for if the throttle type is unknown

  - ### getThrottleWindowReplicatorInstance

    public static ThrottleWindowReplicator getThrottleWindowReplicatorInstance()
    Ger throttle window replicator instance to make sure that there will be one throttle replicator in the implementation
    Returns:
      ThrottleWindowReplicator instance

  - ### getUnifiedThrottleReplicatorInstance

    public static UnifiedThrottleReplicator getUnifiedThrottleReplicatorInstance()
    Get the unified throttle replicator instance to make sure there is one unified replicator in the implementation
    Returns:
      UnifiedThrottleReplicator instance

  - ### getThrottleContextCleanupTaskInstance

    public static ThrottleContextCleanupTask getThrottleContextCleanupTaskInstance()
    Get throttle caller context cleanup task instance implementation
    Returns:
      ThrottleWindowReplicator instance