mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-09-19 10:08:23 +08:00
#956 使用ConcurrentHashMap替换HashTable
This commit is contained in:
@@ -27,18 +27,18 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Hashtable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* @author <a href="https://github.com/007gzs">007</a>
|
||||
*/
|
||||
public class WxOpenComponentServiceImpl implements WxOpenComponentService {
|
||||
private static final JsonParser JSON_PARSER = new JsonParser();
|
||||
private static final Map<String, WxOpenMaService> WX_OPEN_MA_SERVICE_MAP = new Hashtable<>();
|
||||
private static final Map<String, WxMpService> WX_OPEN_MP_SERVICE_MAP = new Hashtable<>();
|
||||
private static final Map<String, WxOpenFastMaService> WX_OPEN_FAST_MA_SERVICE_MAP = new Hashtable<>();
|
||||
private static final Map<String, WxOpenMaService> WX_OPEN_MA_SERVICE_MAP = new ConcurrentHashMap<>();
|
||||
private static final Map<String, WxMpService> WX_OPEN_MP_SERVICE_MAP = new ConcurrentHashMap<>();
|
||||
private static final Map<String, WxOpenFastMaService> WX_OPEN_FAST_MA_SERVICE_MAP = new ConcurrentHashMap<>();
|
||||
|
||||
protected final Logger log = LoggerFactory.getLogger(this.getClass());
|
||||
private WxOpenService wxOpenService;
|
||||
|
@@ -2,8 +2,8 @@ package me.chanjar.weixin.open.api.impl;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
@@ -37,10 +37,10 @@ public class WxOpenInMemoryConfigStorage implements WxOpenConfigStorage {
|
||||
private String httpProxyPassword;
|
||||
private ApacheHttpClientBuilder apacheHttpClientBuilder;
|
||||
|
||||
private Map<String, Token> authorizerRefreshTokens = new Hashtable<>();
|
||||
private Map<String, Token> authorizerAccessTokens = new Hashtable<>();
|
||||
private Map<String, Token> jsapiTickets = new Hashtable<>();
|
||||
private Map<String, Token> cardApiTickets = new Hashtable<>();
|
||||
private Map<String, Token> authorizerRefreshTokens = new ConcurrentHashMap<>();
|
||||
private Map<String, Token> authorizerAccessTokens = new ConcurrentHashMap<>();
|
||||
private Map<String, Token> jsapiTickets = new ConcurrentHashMap<>();
|
||||
private Map<String, Token> cardApiTickets = new ConcurrentHashMap<>();
|
||||
|
||||
@Override
|
||||
public String getComponentAppId() {
|
||||
|
Reference in New Issue
Block a user