org.apache.hadoop.hbase.ipc
Class BlockingRpcCallback<R>

java.lang.Object
  extended by org.apache.hadoop.hbase.ipc.BlockingRpcCallback<R>
All Implemented Interfaces:
com.google.protobuf.RpcCallback<R>

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class BlockingRpcCallback<R>
extends Object
implements com.google.protobuf.RpcCallback<R>

Simple RpcCallback implementation providing a Future-like get() method, which will block util the instance's run(Object) method has been called. R is the RPC response type that will be passed to the run(Object) method.


Constructor Summary
BlockingRpcCallback()
           
 
Method Summary
 R get()
          Returns the parameter passed to run(Object) or null if a null value was passed.
 void run(R parameter)
          Called on completion of the RPC call with the response object, or null in the case of an error.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockingRpcCallback

public BlockingRpcCallback()
Method Detail

run

public void run(R parameter)
Called on completion of the RPC call with the response object, or null in the case of an error.

Specified by:
run in interface com.google.protobuf.RpcCallback<R>
Parameters:
parameter - the response object or null if an error occurred

get

public R get()
      throws IOException
Returns the parameter passed to run(Object) or null if a null value was passed. When used asynchronously, this method will block until the run(Object) method has been called.

Returns:
the response object or null if no response was passed
Throws:
IOException


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.