org.apache.avro.ipc
Class Requestor

java.lang.Object
  extended by org.apache.avro.ipc.Requestor
Direct Known Subclasses:
GenericRequestor, SpecificRequestor

public abstract class Requestor
extends Object

Base class for the client side of a protocol interaction.


Field Summary
protected  List<RPCPlugin> rpcMetaPlugins
           
 
Constructor Summary
protected Requestor(Protocol local, Transceiver transceiver)
           
 
Method Summary
 void addRPCPlugin(RPCPlugin plugin)
          Adds a new plugin to manipulate RPC metadata.
 Protocol getLocal()
           
 Protocol getRemote()
          Return the remote protocol.
 Transceiver getTransceiver()
           
abstract  Exception readError(Schema schema, Decoder in)
          Reads an error message.
abstract  Object readResponse(Schema schema, Decoder in)
          Reads a response message.
 Object request(String messageName, Object request)
          Writes a request message and reads a response or error message.
abstract  void writeRequest(Schema schema, Object request, Encoder out)
          Writes a request message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rpcMetaPlugins

protected List<RPCPlugin> rpcMetaPlugins
Constructor Detail

Requestor

protected Requestor(Protocol local,
                    Transceiver transceiver)
             throws IOException
Throws:
IOException
Method Detail

getLocal

public Protocol getLocal()

getTransceiver

public Transceiver getTransceiver()

addRPCPlugin

public void addRPCPlugin(RPCPlugin plugin)
Adds a new plugin to manipulate RPC metadata. Plugins are executed in the order that they are added.

Parameters:
plugin - a plugin that will manipulate RPC metadata

request

public Object request(String messageName,
                      Object request)
               throws Exception
Writes a request message and reads a response or error message.

Throws:
Exception

getRemote

public Protocol getRemote()
                   throws IOException
Return the remote protocol. Force a handshake if required.

Throws:
IOException

writeRequest

public abstract void writeRequest(Schema schema,
                                  Object request,
                                  Encoder out)
                           throws IOException
Writes a request message.

Throws:
IOException

readResponse

public abstract Object readResponse(Schema schema,
                                    Decoder in)
                             throws IOException
Reads a response message.

Throws:
IOException

readError

public abstract Exception readError(Schema schema,
                                    Decoder in)
                             throws IOException
Reads an error message.

Throws:
IOException


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