Search in sources :

Example 1 with WebExchangeApiMatcher

use of com.alibaba.csp.sentinel.adapter.gateway.sc.api.matcher.WebExchangeApiMatcher in project Sentinel by alibaba.

the class GatewayApiMatcherManager method loadApiDefinitions.

static synchronized void loadApiDefinitions(/*@Valid*/
Set<ApiDefinition> definitions) {
    Map<String, WebExchangeApiMatcher> apiMatcherMap = new HashMap<>();
    for (ApiDefinition definition : definitions) {
        apiMatcherMap.put(definition.getApiName(), new WebExchangeApiMatcher(definition));
    }
    API_MATCHER_MAP = apiMatcherMap;
}
Also used : WebExchangeApiMatcher(com.alibaba.csp.sentinel.adapter.gateway.sc.api.matcher.WebExchangeApiMatcher) HashMap(java.util.HashMap) ApiDefinition(com.alibaba.csp.sentinel.adapter.gateway.common.api.ApiDefinition)

Aggregations

ApiDefinition (com.alibaba.csp.sentinel.adapter.gateway.common.api.ApiDefinition)1 WebExchangeApiMatcher (com.alibaba.csp.sentinel.adapter.gateway.sc.api.matcher.WebExchangeApiMatcher)1 HashMap (java.util.HashMap)1