public void addThrottle ( AdHocThrottleEndpoint endpoint , AdHocThrottle throttle ) { checkNotNull ( throttle , "throttle" ) ; String key = endpoint . toString ( ) ; try { // If the throttle is unlimited make sure it is not set, since the absence of a value indicates unlimited if ( throttle . isUnlimited ( ) ) { _throttleMap . remove ( key ) ; } _throttleMap . set ( key , throttle ) ; } catch ( Exception e ) { throw Throwables . propagate ( e ) ; } }
Adds a throttle for an HTTP method and path .