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.
public abstract class TAsyncMethodCall<T> extends java.lang.Object
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 Modifier and Type Class Description static class
TAsyncMethodCall.State
-
Field Summary
Fields Modifier and Type Field Description protected TAsyncClient
client
protected TNonblockingTransport
transport
-
Constructor Summary
Constructors Modifier Constructor Description protected
TAsyncMethodCall(TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport, AsyncMethodCallback<T> callback, boolean isOneway)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TAsyncClient
getClient()
protected java.nio.ByteBuffer
getFrameBuffer()
protected abstract T
getResult()
protected long
getSequenceId()
protected long
getStartTime()
protected TAsyncMethodCall.State
getState()
long
getTimeoutTimestamp()
boolean
hasTimeout()
protected boolean
isFinished()
protected void
onError(java.lang.Exception e)
protected void
prepareMethodCall()
Initialize buffers.protected abstract void
write_args(TProtocol protocol)
-
-
-
Field Detail
-
transport
protected final TNonblockingTransport transport
-
client
protected final TAsyncClient client
-
-
Constructor Detail
-
TAsyncMethodCall
protected TAsyncMethodCall(TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport, AsyncMethodCallback<T> callback, boolean isOneway)
-
-
Method Detail
-
getState
protected TAsyncMethodCall.State getState()
-
isFinished
protected boolean isFinished()
-
getStartTime
protected long getStartTime()
-
getSequenceId
protected long getSequenceId()
-
getClient
public TAsyncClient getClient()
-
hasTimeout
public boolean hasTimeout()
-
getTimeoutTimestamp
public long getTimeoutTimestamp()
-
write_args
protected abstract void write_args(TProtocol protocol) throws TException
- Throws:
TException
-
getResult
protected abstract T getResult() throws java.lang.Exception
- Throws:
java.lang.Exception
-
prepareMethodCall
protected void prepareMethodCall() throws TException
Initialize buffers.- Throws:
TException
- if buffer initialization fails
-
getFrameBuffer
protected java.nio.ByteBuffer getFrameBuffer()
-
onError
protected void onError(java.lang.Exception e)
-
-