Optimize ThreadContext.java
This commit is contained in:
@@ -135,7 +135,7 @@ public class CallbackFilter extends FizzWebFilter {
|
||||
}
|
||||
|
||||
private HashMap<String, ServiceInstance> getService2instMap(ApiConfig ac) {
|
||||
HashMap<String, ServiceInstance> service2instMap = ThreadContext.getHashMap(s2im, String.class, ServiceInstance.class);
|
||||
HashMap<String, ServiceInstance> service2instMap = ThreadContext.getHashMap(s2im);
|
||||
List<Receiver> receivers = ac.callbackConfig.receivers;
|
||||
for (Receiver r : receivers) {
|
||||
if (r.type == ApiConfig.Type.SERVICE_DISCOVERY) {
|
||||
|
||||
@@ -249,7 +249,7 @@ public class ApiConfigService {
|
||||
if (sc != null) {
|
||||
List<ApiConfig> apiConfigs = sc.getApiConfigs(method, path, gatewayGroup);
|
||||
if (!apiConfigs.isEmpty()) {
|
||||
List<String> matchPathPatterns = ThreadContext.getArrayList(mpps, String.class);
|
||||
List<String> matchPathPatterns = ThreadContext.getArrayList(mpps);
|
||||
for (int i = 0; i < apiConfigs.size(); i++) {
|
||||
ApiConfig ac = apiConfigs.get(i);
|
||||
if (ac.checkApp) {
|
||||
|
||||
@@ -117,7 +117,7 @@ public class ServiceConfig {
|
||||
@JsonIgnore
|
||||
public List<ApiConfig> getApiConfigs(HttpMethod method, String path, String gatewayGroup) {
|
||||
|
||||
List<GatewayGroup2apiConfig> matchGatewayGroup2apiConfigs = ThreadContext.getArrayList(gg2acs, GatewayGroup2apiConfig.class);
|
||||
List<GatewayGroup2apiConfig> matchGatewayGroup2apiConfigs = ThreadContext.getArrayList(gg2acs);
|
||||
|
||||
Set<Map.Entry<String, Map<Object, GatewayGroup2apiConfig>>> es = path2methodToApiConfigMapMap.entrySet();
|
||||
for (Map.Entry<String, Map<Object, GatewayGroup2apiConfig>> e : es) {
|
||||
@@ -142,7 +142,7 @@ public class ServiceConfig {
|
||||
ThreadContext.set(ApiConfigService.AUTH_MSG, id + " no route match " + method + ' ' + path);
|
||||
return Collections.emptyList();
|
||||
} else {
|
||||
List<ApiConfig> lst = ThreadContext.getArrayList(acs, ApiConfig.class);
|
||||
List<ApiConfig> lst = ThreadContext.getArrayList(acs);
|
||||
for (int i = 0; i < matchGatewayGroup2apiConfigs.size(); i++) {
|
||||
GatewayGroup2apiConfig gatewayGroup2apiConfig = matchGatewayGroup2apiConfigs.get(i);
|
||||
Set<ApiConfig> apiConfigs = gatewayGroup2apiConfig.get(gatewayGroup);
|
||||
|
||||
Reference in New Issue
Block a user