org.apache.avro.ipc.generic
Class GenericRequestor

java.lang.Object
  extended by org.apache.avro.ipc.Requestor
      extended by org.apache.avro.ipc.generic.GenericRequestor

public class GenericRequestor
extends Requestor

Requestor implementation for generic Java data.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.avro.ipc.Requestor
Requestor.TransceiverCallback<T>
 
Field Summary
 
Fields inherited from class org.apache.avro.ipc.Requestor
rpcMetaPlugins
 
Constructor Summary
GenericRequestor(Protocol protocol, Transceiver transceiver)
           
 
Method Summary
 Exception readError(Schema writer, Schema reader, Decoder in)
          Reads an error message.
 Object readResponse(Schema writer, Schema reader, Decoder in)
          Reads a response message.
 Object request(String messageName, Object request)
          Writes a request message and reads a response or error message.
<T> void
request(String messageName, Object request, Callback<T> callback)
          Writes a request message and returns the result through a Callback.
 void writeRequest(Schema schema, Object request, Encoder out)
          Writes a request message.
 
Methods inherited from class org.apache.avro.ipc.Requestor
addRPCPlugin, getLocal, getRemote, getTransceiver, readError, readResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericRequestor

public GenericRequestor(Protocol protocol,
                        Transceiver transceiver)
                 throws IOException
Throws:
IOException
Method Detail

request

public Object request(String messageName,
                      Object request)
               throws IOException
Description copied from class: Requestor
Writes a request message and reads a response or error message.

Overrides:
request in class Requestor
Throws:
IOException

request

public <T> void request(String messageName,
                        Object request,
                        Callback<T> callback)
             throws IOException
Description copied from class: Requestor
Writes a request message and returns the result through a Callback. Clients can also use a Future interface by creating a new CallFuture, passing it in as the Callback parameter, and then waiting on that Future.

Overrides:
request in class Requestor
Type Parameters:
T - the return type of the message.
Parameters:
messageName - the name of the message to invoke.
request - the request data to send.
callback - the callback which will be invoked when the response is returned or an error occurs.
Throws:
IOException

writeRequest

public void writeRequest(Schema schema,
                         Object request,
                         Encoder out)
                  throws IOException
Description copied from class: Requestor
Writes a request message.

Specified by:
writeRequest in class Requestor
Throws:
IOException

readResponse

public Object readResponse(Schema writer,
                           Schema reader,
                           Decoder in)
                    throws IOException
Description copied from class: Requestor
Reads a response message.

Specified by:
readResponse in class Requestor
Throws:
IOException

readError

public Exception readError(Schema writer,
                           Schema reader,
                           Decoder in)
                    throws IOException
Description copied from class: Requestor
Reads an error message.

Specified by:
readError in class Requestor
Throws:
IOException


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