Package com.foxinmy.weixin4j.token
Class TokenManager
- java.lang.Object
-
- com.foxinmy.weixin4j.cache.CacheManager<Token>
-
- com.foxinmy.weixin4j.token.TokenManager
-
public class TokenManager extends CacheManager<Token>
对token的缓存获取- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
- See Also:
TokenCreator
,CacheStorager
-
-
Field Summary
-
Fields inherited from class com.foxinmy.weixin4j.cache.CacheManager
cacheCreator, cacheStorager
-
-
Constructor Summary
Constructors Constructor Description TokenManager(TokenCreator tokenCreator, CacheStorager<Token> cacheStorager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAccessToken()
获取token字符串String
getWeixinId()
返回唯一标识ID-
Methods inherited from class com.foxinmy.weixin4j.cache.CacheManager
clearCache, evictCache, getCache, refreshCache
-
-
-
-
Constructor Detail
-
TokenManager
public TokenManager(TokenCreator tokenCreator, CacheStorager<Token> cacheStorager)
- Parameters:
tokenCreator
- 负责微信各种token的创建cacheStorager
- 负责token的存储
-
-
Method Detail
-
getAccessToken
public String getAccessToken() throws WeixinException
获取token字符串- Returns:
- token字符串
- Throws:
WeixinException
-
getWeixinId
public String getWeixinId()
返回唯一标识ID- Returns:
-
-