Package org.apache.thrift.async
Class TAsyncMethodCall<T>
java.lang.Object
org.apache.thrift.async.TAsyncMethodCall<T>
- Type Parameters:
T
- The return type of the encapsulated method call.
Encapsulates an async method call.
Need to generate:
- protected abstract void write_args(TProtocol protocol)
- protected abstract T getResult() throws <Exception_1>, <Exception_2>, ...
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TAsyncClient
protected final TNonblockingTransport
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TAsyncMethodCall
(TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport, AsyncMethodCallback<T> callback, boolean isOneway) -
Method Summary
Modifier and TypeMethodDescriptionprotected ByteBuffer
protected abstract T
protected long
protected long
protected TAsyncMethodCall.State
getState()
long
boolean
protected boolean
protected void
protected void
Initialize buffers.protected abstract void
write_args
(TProtocol protocol)
-
Field Details
-
transport
-
client
-
-
Constructor Details
-
TAsyncMethodCall
protected TAsyncMethodCall(TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport, AsyncMethodCallback<T> callback, boolean isOneway)
-
-
Method Details
-
getState
-
isFinished
protected boolean isFinished() -
getStartTime
protected long getStartTime() -
getSequenceId
protected long getSequenceId() -
getClient
-
hasTimeout
public boolean hasTimeout() -
getTimeoutTimestamp
public long getTimeoutTimestamp() -
write_args
- Throws:
TException
-
getResult
- Throws:
Exception
-
prepareMethodCall
Initialize buffers.- Throws:
TException
- if buffer initialization fails
-
getFrameBuffer
-
onError
-