@ThreadSafe public class ThriftClientManager extends Object implements Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
ThriftClientManager.ThriftClientMetadata |
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_NAME |
| Constructor and Description |
|---|
ThriftClientManager() |
ThriftClientManager(ClassLoader parent) |
ThriftClientManager(ThriftCodecManager codecManager) |
ThriftClientManager(ThriftCodecManager codecManager,
com.facebook.nifty.client.NiftyClient niftyClient,
Set<ThriftClientEventHandler> globalEventHandlers) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
<C extends com.facebook.nifty.client.NiftyClientChannel> |
createChannel(com.facebook.nifty.client.NiftyClientConnector<C> connector) |
<C extends com.facebook.nifty.client.NiftyClientChannel> |
createChannel(com.facebook.nifty.client.NiftyClientConnector<C> connector,
io.airlift.units.Duration connectTimeout,
io.airlift.units.Duration receiveTimeout,
io.airlift.units.Duration readTimeout,
io.airlift.units.Duration writeTimeout,
int maxFrameSize,
com.google.common.net.HostAndPort socksProxy) |
<T> T |
createClient(com.facebook.nifty.client.NiftyClientChannel channel,
Class<T> type) |
<T> T |
createClient(com.facebook.nifty.client.NiftyClientChannel channel,
Class<T> type,
List<? extends ThriftClientEventHandler> eventHandlers) |
<T,C extends com.facebook.nifty.client.NiftyClientChannel> |
createClient(com.facebook.nifty.client.NiftyClientConnector<C> connector,
Class<T> type) |
<T,C extends com.facebook.nifty.client.NiftyClientChannel> |
createClient(com.facebook.nifty.client.NiftyClientConnector<C> connector,
Class<T> type,
io.airlift.units.Duration connectTimeout,
io.airlift.units.Duration receiveTimeout,
io.airlift.units.Duration readTimeout,
io.airlift.units.Duration writeTimeout,
int maxFrameSize,
String clientName,
List<? extends ThriftClientEventHandler> eventHandlers,
com.google.common.net.HostAndPort socksProxy) |
<T,C extends com.facebook.nifty.client.NiftyClientChannel> |
createClient(com.facebook.nifty.client.NiftyClientConnector<C> connector,
Class<T> type,
io.airlift.units.Duration connectTimeout,
io.airlift.units.Duration readTimeout,
io.airlift.units.Duration writeTimeout,
int maxFrameSize,
String clientName,
List<? extends ThriftClientEventHandler> eventHandlers,
com.google.common.net.HostAndPort socksProxy)
|
<T> T |
createClient(com.facebook.nifty.client.RequestChannel channel,
Class<T> type,
String name,
List<? extends ThriftClientEventHandler> eventHandlers) |
ThriftClientManager.ThriftClientMetadata |
getClientMetadata(Class<?> type,
String name) |
com.google.common.net.HostAndPort |
getDefaultSocksProxy() |
org.apache.thrift.protocol.TProtocol |
getInputProtocol(Object client) |
com.facebook.nifty.client.NiftyClientChannel |
getNiftyChannel(Object client)
Deprecated.
Use
getRequestChannel(java.lang.Object) instead, and cast the result to a NiftyClientChannel if necessary |
org.apache.thrift.protocol.TProtocol |
getOutputProtocol(Object client) |
com.google.common.net.HostAndPort |
getRemoteAddress(Object client)
Returns the remote address that a Swift client is connected to
|
com.facebook.nifty.client.RequestChannel |
getRequestChannel(Object client)
Returns the
RequestChannel backing a Swift client |
public static final String DEFAULT_NAME
public ThriftClientManager()
public ThriftClientManager(ClassLoader parent)
public ThriftClientManager(ThriftCodecManager codecManager)
@Inject public ThriftClientManager(ThriftCodecManager codecManager, com.facebook.nifty.client.NiftyClient niftyClient, Set<ThriftClientEventHandler> globalEventHandlers)
public <C extends com.facebook.nifty.client.NiftyClientChannel> com.google.common.util.concurrent.ListenableFuture<C> createChannel(com.facebook.nifty.client.NiftyClientConnector<C> connector)
public <C extends com.facebook.nifty.client.NiftyClientChannel> com.google.common.util.concurrent.ListenableFuture<C> createChannel(com.facebook.nifty.client.NiftyClientConnector<C> connector,
@Nullable
io.airlift.units.Duration connectTimeout,
@Nullable
io.airlift.units.Duration receiveTimeout,
@Nullable
io.airlift.units.Duration readTimeout,
@Nullable
io.airlift.units.Duration writeTimeout,
int maxFrameSize,
@Nullable
com.google.common.net.HostAndPort socksProxy)
public <T,C extends com.facebook.nifty.client.NiftyClientChannel> com.google.common.util.concurrent.ListenableFuture<T> createClient(com.facebook.nifty.client.NiftyClientConnector<C> connector,
Class<T> type)
@Deprecated public <T,C extends com.facebook.nifty.client.NiftyClientChannel> com.google.common.util.concurrent.ListenableFuture<T> createClient(com.facebook.nifty.client.NiftyClientConnector<C> connector, Class<T> type, @Nullable io.airlift.units.Duration connectTimeout, @Nullable io.airlift.units.Duration readTimeout, @Nullable io.airlift.units.Duration writeTimeout, int maxFrameSize, @Nullable String clientName, List<? extends ThriftClientEventHandler> eventHandlers, @Nullable com.google.common.net.HostAndPort socksProxy)
public <T,C extends com.facebook.nifty.client.NiftyClientChannel> com.google.common.util.concurrent.ListenableFuture<T> createClient(com.facebook.nifty.client.NiftyClientConnector<C> connector,
Class<T> type,
@Nullable
io.airlift.units.Duration connectTimeout,
@Nullable
io.airlift.units.Duration receiveTimeout,
@Nullable
io.airlift.units.Duration readTimeout,
@Nullable
io.airlift.units.Duration writeTimeout,
int maxFrameSize,
@Nullable
String clientName,
List<? extends ThriftClientEventHandler> eventHandlers,
@Nullable
com.google.common.net.HostAndPort socksProxy)
public <T> T createClient(com.facebook.nifty.client.NiftyClientChannel channel,
Class<T> type)
public <T> T createClient(com.facebook.nifty.client.NiftyClientChannel channel,
Class<T> type,
List<? extends ThriftClientEventHandler> eventHandlers)
public <T> T createClient(com.facebook.nifty.client.RequestChannel channel,
Class<T> type,
String name,
List<? extends ThriftClientEventHandler> eventHandlers)
public ThriftClientManager.ThriftClientMetadata getClientMetadata(Class<?> type, String name)
@PreDestroy public void close()
close in interface Closeableclose in interface AutoCloseablepublic com.google.common.net.HostAndPort getDefaultSocksProxy()
public com.facebook.nifty.client.RequestChannel getRequestChannel(Object client)
RequestChannel backing a Swift clientIllegalArgumentException - if the client is not a Swift clientpublic com.facebook.nifty.client.NiftyClientChannel getNiftyChannel(Object client)
getRequestChannel(java.lang.Object) instead, and cast the result to a NiftyClientChannel if necessaryNiftyClientChannel backing a Swift clientIllegalArgumentException - if the client is not using a NiftyClientChannelpublic com.google.common.net.HostAndPort getRemoteAddress(Object client)
IllegalArgumentException - if the client is not a Swift client or is not connected
through an internet socketpublic org.apache.thrift.protocol.TProtocol getOutputProtocol(Object client)
public org.apache.thrift.protocol.TProtocol getInputProtocol(Object client)
Copyright © 2012-2016 Facebook, Inc.. All Rights Reserved.