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 TAsyncClientprotected final TNonblockingTransport -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTAsyncMethodCall(TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport, AsyncMethodCallback<T> callback, boolean isOneway) -
Method Summary
Modifier and TypeMethodDescriptionprotected ByteBufferprotected abstract Tprotected longprotected longprotected TAsyncMethodCall.StategetState()longbooleanprotected booleanprotected voidprotected voidInitialize buffers.protected abstract voidwrite_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
-