public interface ThriftClientCallback<T extends org.apache.thrift.TServiceClient,U>
Integer result = calculatorThriftClient.execute(new ThriftClientCallback<Calculator.Client, Integer>() {
public Integer call(Calculator.Client client) throws TException {
return client.add(1, 2);
}
});
"calculatorThriftClient" is an instance of GrizzlyThriftClient(For more information, please see GrizzlyThriftClient's javadoc).
"Calculator.Client" is custom thrift client which has been generated by thrift.
"Integer" is custom result type.| Modifier and Type | Method and Description |
|---|---|
U |
call(T client) |
Copyright © 2017-2019 Oracle Corporation. All Rights Reserved.