From 8ec76bda592593e5c6e05564a0188cf35fe8c4d5 Mon Sep 17 00:00:00 2001 From: Daniel Qian Date: Fri, 23 Jan 2015 10:13:02 +0800 Subject: [PATCH] =?UTF-8?q?issue=20#84=20Wx*ConfigStorage=E5=9C=A8?= =?UTF-8?q?=E5=A4=9A=E7=BA=BF=E7=A8=8B=E7=8E=AF=E5=A2=83=E4=B8=8B=E6=9C=89?= =?UTF-8?q?visibility=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cp/api/WxCpInMemoryConfigStorage.java | 24 ++++++------- .../mp/api/WxMpInMemoryConfigStorage.java | 34 +++++++++---------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpInMemoryConfigStorage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpInMemoryConfigStorage.java index 0a35fcd9..b7f662cd 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpInMemoryConfigStorage.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpInMemoryConfigStorage.java @@ -9,21 +9,21 @@ import me.chanjar.weixin.common.bean.WxAccessToken; */ public class WxCpInMemoryConfigStorage implements WxCpConfigStorage { - protected String corpId; - protected String corpSecret; + protected volatile String corpId; + protected volatile String corpSecret; - protected String token; - protected String accessToken; - protected String aesKey; - protected String agentId; - protected long expiresTime; + protected volatile String token; + protected volatile String accessToken; + protected volatile String aesKey; + protected volatile String agentId; + protected volatile long expiresTime; - protected String oauth2redirectUri; + protected volatile String oauth2redirectUri; - protected String http_proxy_host; - protected int http_proxy_port; - protected String http_proxy_username; - protected String http_proxy_password; + protected volatile String http_proxy_host; + protected volatile int http_proxy_port; + protected volatile String http_proxy_username; + protected volatile String http_proxy_password; public String getAccessToken() { return this.accessToken; diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpInMemoryConfigStorage.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpInMemoryConfigStorage.java index ff272f77..f1fb8fe6 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpInMemoryConfigStorage.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpInMemoryConfigStorage.java @@ -9,24 +9,22 @@ import me.chanjar.weixin.common.bean.WxAccessToken; */ public class WxMpInMemoryConfigStorage implements WxMpConfigStorage { - private static final long l = 7000 * 1000l; - - protected String appId; - protected String secret; - protected String token; - protected String accessToken; - protected String aesKey; - protected long expiresTime; - - protected String oauth2redirectUri; - - protected String http_proxy_host; - protected int http_proxy_port; - protected String http_proxy_username; - protected String http_proxy_password; - - protected String jsapiTicket; - protected long jsapiTicketExpiresTime; + protected volatile String appId; + protected volatile String secret; + protected volatile String token; + protected volatile String accessToken; + protected volatile String aesKey; + protected volatile long expiresTime; + + protected volatile String oauth2redirectUri; + + protected volatile String http_proxy_host; + protected volatile int http_proxy_port; + protected volatile String http_proxy_username; + protected volatile String http_proxy_password; + + protected volatile String jsapiTicket; + protected volatile long jsapiTicketExpiresTime; public String getAccessToken() { return this.accessToken;