public interface ThriftClient<T extends org.apache.thrift.TServiceClient> extends ThriftClientLifecycle
By addServer(java.net.SocketAddress) and removeServer(java.net.SocketAddress), servers can be added and removed dynamically in this thrift client.
In other words, the managed server list can be changed in runtime by APIs.
By execute(org.glassfish.grizzly.thrift.client.ThriftClientCallback<T, U>), user can execute custom service(For more information, please see ThriftClientCallback's javadoc).
| Modifier and Type | Method and Description |
|---|---|
boolean |
addServer(SocketAddress serverAddress)
Add a specific server in this thrift client
|
<U> U |
execute(ThriftClientCallback<T,U> callback) |
String |
getName()
Return the name of the thrift client.
|
boolean |
isInServerList(SocketAddress serverAddress)
Check if this thrift client contains the given server
|
void |
removeServer(SocketAddress serverAddress)
Remove the given server in this thrift client
|
start, stop<U> U execute(ThriftClientCallback<T,U> callback) throws Exception
ExceptionString getName()
boolean addServer(SocketAddress serverAddress)
serverAddress - a specific server's SocketAddress to be addedserverAddress is added successfullyvoid removeServer(SocketAddress serverAddress)
serverAddress - the specific server's SocketAddress to be removed in this thrift clientboolean isInServerList(SocketAddress serverAddress)
serverAddress - the specific server's SocketAddress to be checkedserverAddressCopyright © 2017-2019 Oracle Corporation. All Rights Reserved.