public class DefaultClusterTokenClient extends Object implements ClusterTokenClient
ClusterTokenClient.| Constructor and Description |
|---|
DefaultClusterTokenClient() |
| Modifier and Type | Method and Description |
|---|---|
TokenServerDescriptor |
currentServer() |
int |
getState() |
void |
releaseConcurrentToken(Long tokenId) |
TokenResult |
requestConcurrentToken(String clientAddress,
Long ruleId,
int acquireCount) |
TokenResult |
requestParamToken(Long flowId,
int acquireCount,
Collection<Object> params) |
TokenResult |
requestToken(Long flowId,
int acquireCount,
boolean prioritized) |
void |
start() |
void |
stop() |
public void start()
throws Exception
start in interface ClusterTokenClientExceptionpublic void stop()
throws Exception
stop in interface ClusterTokenClientExceptionpublic int getState()
getState in interface ClusterTokenClientpublic TokenServerDescriptor currentServer()
currentServer in interface ClusterTokenClientpublic TokenResult requestToken(Long flowId, int acquireCount, boolean prioritized)
requestToken in interface TokenServicepublic TokenResult requestParamToken(Long flowId, int acquireCount, Collection<Object> params)
requestParamToken in interface TokenServicepublic TokenResult requestConcurrentToken(String clientAddress, Long ruleId, int acquireCount)
requestConcurrentToken in interface TokenServicepublic void releaseConcurrentToken(Long tokenId)
releaseConcurrentToken in interface TokenServiceCopyright © 2021 Alibaba Group. All rights reserved.