org.apache.thrift.async
Class TAsyncMethodCall<T extends TAsyncMethodCall>

java.lang.Object
  extended by org.apache.thrift.async.TAsyncMethodCall<T>
Type Parameters:
T -

public abstract class TAsyncMethodCall<T extends TAsyncMethodCall>
extends java.lang.Object

Encapsulates an async method call Need to generate: - private void write_args(TProtocol protocol) - public T getResult() throws , , ...


Nested Class Summary
static class TAsyncMethodCall.State
           
 
Field Summary
protected  TAsyncClient client
           
protected  TNonblockingTransport transport
           
 
Constructor Summary
protected TAsyncMethodCall(TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport, AsyncMethodCallback<T> callback, boolean isOneway)
           
 
Method Summary
protected  java.nio.ByteBuffer getFrameBuffer()
           
protected  TAsyncMethodCall.State getState()
           
protected  void onError(java.lang.Throwable e)
           
protected  void prepareMethodCall()
           
protected  void transition(java.nio.channels.SelectionKey key)
          Transition to next state, doing whatever work is required.
protected abstract  void write_args(TProtocol protocol)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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()

write_args

protected abstract void write_args(TProtocol protocol)
                            throws TException
Throws:
TException

prepareMethodCall

protected void prepareMethodCall()
                          throws TException
Throws:
TException

getFrameBuffer

protected java.nio.ByteBuffer getFrameBuffer()

transition

protected void transition(java.nio.channels.SelectionKey key)
Transition to next state, doing whatever work is required. Since this method is only called by the selector thread, we can make changes to our select interests without worrying about concurrency.

Parameters:
key -

onError

protected void onError(java.lang.Throwable e)