public class GrizzlyThriftClientManager extends Object implements ThriftClientManager
ThriftClientManager based on Grizzly
This thrift client manager has a key(String thrift client name)/value(GrizzlyThriftClient map for retrieving thrift clients.
If the specific GrizzlyTransport is not set at creation time, this will create a main GrizzlyTransport.
The GrizzlyTransport must contain ThriftFrameFilter and ThriftClientFilter.
| Modifier and Type | Class and Description |
|---|---|
static class |
GrizzlyThriftClientManager.Builder |
| Modifier and Type | Method and Description |
|---|---|
<T extends org.apache.thrift.TServiceClient> |
createThriftClientBuilder(String thriftClientName,
org.apache.thrift.TServiceClientFactory<T> thriftClientFactory)
Creates a new
ThriftClientBuilder for the named thrift client to be managed by this thrift client manager. |
<T extends org.apache.thrift.TServiceClient> |
getThriftClient(String thriftClientName)
Looks up a named thrift client.
|
boolean |
removeThriftClient(String thriftClientName)
Remove a thrift client from the ThriftClientManager.
|
void |
shutdown()
Shuts down the ThriftClientManager.
|
public <T extends org.apache.thrift.TServiceClient> GrizzlyThriftClient.Builder<T> createThriftClientBuilder(String thriftClientName, org.apache.thrift.TServiceClientFactory<T> thriftClientFactory)
ThriftClientBuilder for the named thrift client to be managed by this thrift client manager.
The returned ThriftClientBuilder is associated with this ThriftClientManager.
The ThriftClient will be created, added to this ThriftClientManager and started when
ThriftClientBuilder.build() is called.
createThriftClientBuilder in interface ThriftClientManagerthriftClientName - the name of the thrift client to build. A thrift client name must consist of at least one non-whitespace character.thriftClientFactory - thrift client factorypublic <T extends org.apache.thrift.TServiceClient> GrizzlyThriftClient<T> getThriftClient(String thriftClientName)
getThriftClient in interface ThriftClientManagerthriftClientName - the name of the thrift client to look forpublic boolean removeThriftClient(String thriftClientName)
removeThriftClient in interface ThriftClientManagerthriftClientName - the thrift client namepublic void shutdown()
shutdown in interface ThriftClientManagerCopyright © 2017-2019 Oracle Corporation. All Rights Reserved.