Java 类org.apache.thrift.async.TAsyncClient 实例源码

项目:trpc    文件:AsyncTrpcClient.java   
@Override
@SuppressWarnings("unchecked")
public <X extends TAsyncClient> X getClient(final Class<X> clazz) {
    return (X) super.clients.computeIfAbsent(ClassNameUtils.getOuterClassName(clazz), (className) -> {
        TProtocolFactory protocolFactory = (TProtocolFactory) tTransport -> {
            TProtocol protocol = new TBinaryProtocol(tTransport);
            return new TMultiplexedProtocol(protocol, className);
        };
        try {
            return clazz.getConstructor(TProtocolFactory.class, TAsyncClientManager.class, TNonblockingTransport.class)
                    .newInstance(protocolFactory, this.clientManager, this.transport);
        } catch (Throwable e) {
            if (e instanceof UnresolvedAddressException) {
                this.isOpen = false;
            }
            return null;
        }
    });
}
项目:ikasoa    文件:CallBack.java   
public CallBack(String arg, AsyncMethodCallback<String> resultHandler, TAsyncClient client,
        TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException {
    super(client, protocolFactory, transport, resultHandler, Boolean.FALSE);
    this.arg = arg;
}
项目:NeverwinterDP-Commons    文件:scribe.java   
public Log_call(List<LogEntry> messages, org.apache.thrift.async.AsyncMethodCallback<Log_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
  super(client, protocolFactory, transport, resultHandler, false);
  this.messages = messages;
}