@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; } }); }
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; }
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; }