T - the concrete TServiceClient typeU - the service interface typepublic final class PooledThriftClientProxyFactory<T extends org.apache.thrift.TServiceClient,U> extends java.lang.Object implements ThriftClientProxyFactory<U>
| Constructor and Description |
|---|
PooledThriftClientProxyFactory(ThriftClientConnectionPool<U> connectionPool,
org.apache.thrift.TServiceClientFactory<T> clientFactory)
Initialize a new client proxy factory supporting connection pooling.
|
| Modifier and Type | Method and Description |
|---|---|
U |
newProxy(com.google.common.net.HostAndPort hostAndPort)
Create a new client proxy for a remote Thrift service endpoint.
|
U |
newProxy(com.google.common.net.HostAndPort hostAndPort,
java.time.Duration timeout)
Create a new client proxy for a remote Thrift service endpoint including a borrow timeout.
|
U |
newProxy(java.net.InetSocketAddress address)
Create a new client proxy for a remote Thrift service endpoint.
|
U |
newProxy(java.net.InetSocketAddress address,
java.time.Duration timeout)
Create a new client proxy for a remote Thrift service endpoint including a borrow timeout.
|
U |
newProxy(java.lang.String host,
int port)
Create a new client proxy for a remote Thrift service endpoint.
|
U |
newProxy(java.lang.String host,
int port,
java.time.Duration timeout)
Create a new client proxy for a remote Thrift service endpoint including a borrow timeout.
|
public PooledThriftClientProxyFactory(ThriftClientConnectionPool<U> connectionPool, org.apache.thrift.TServiceClientFactory<T> clientFactory)
connectionPool - the connection poolclientFactory - the client factorypublic U newProxy(java.lang.String host, int port) throws java.lang.Exception
host - the remote hostname or IPport - the port numberjava.lang.Exceptionpublic U newProxy(com.google.common.net.HostAndPort hostAndPort) throws java.lang.Exception
hostAndPort - the remote hostname or IP and portjava.lang.Exceptionpublic U newProxy(java.net.InetSocketAddress address) throws java.lang.Exception
newProxy in interface ThriftClientProxyFactory<U>address - the remote hostname or IP and portjava.lang.Exceptionpublic U newProxy(java.lang.String host, int port, java.time.Duration timeout) throws java.lang.Exception
host - the remote hostname or IPport - the port numberjava.lang.Exceptionpublic U newProxy(com.google.common.net.HostAndPort hostAndPort, java.time.Duration timeout) throws java.lang.Exception
hostAndPort - the remote hostname or IP and portjava.lang.Exceptionpublic U newProxy(java.net.InetSocketAddress address, java.time.Duration timeout) throws java.lang.Exception
newProxy in interface ThriftClientProxyFactory<U>address - the remote hostname or IP and porttimeout - the borrow timeoutjava.lang.Exception