org.apache.avro.specific
Class SpecificRequestor

java.lang.Object
  extended by org.apache.avro.ipc.Requestor
      extended by org.apache.avro.specific.SpecificRequestor
All Implemented Interfaces:
InvocationHandler
Direct Known Subclasses:
ReflectRequestor

public class SpecificRequestor
extends Requestor
implements InvocationHandler

Requestor for generated interfaces.


Field Summary
 
Fields inherited from class org.apache.avro.ipc.Requestor
rpcMetaPlugins
 
Constructor Summary
  SpecificRequestor(Class<?> iface, Transceiver transceiver)
           
protected SpecificRequestor(Protocol protocol, Transceiver transceiver)
           
 
Method Summary
static Object getClient(Class<?> iface, SpecificRequestor requestor)
          Create a proxy instance whose methods invoke RPCs.
static Object getClient(Class<?> iface, Transceiver transciever)
          Create a proxy instance whose methods invoke RPCs.
static Object getClient(Class<?> iface, Transceiver transciever, SpecificData specificData)
          Create a proxy instance whose methods invoke RPCs.
protected  DatumReader<Object> getDatumReader(Schema schema)
           
protected  DatumWriter<Object> getDatumWriter(Schema schema)
           
 Object invoke(Object proxy, Method method, Object[] args)
           
 Exception readError(Schema schema, Decoder in)
          Reads an error message.
 Object readResponse(Schema schema, Decoder in)
          Reads a response message.
 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, request
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpecificRequestor

public SpecificRequestor(Class<?> iface,
                         Transceiver transceiver)
                  throws IOException
Throws:
IOException

SpecificRequestor

protected SpecificRequestor(Protocol protocol,
                            Transceiver transceiver)
                     throws IOException
Throws:
IOException
Method Detail

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Specified by:
invoke in interface InvocationHandler
Throws:
Throwable

getDatumWriter

protected DatumWriter<Object> getDatumWriter(Schema schema)

getDatumReader

protected DatumReader<Object> getDatumReader(Schema schema)

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 schema,
                           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 schema,
                           Decoder in)
                    throws IOException
Description copied from class: Requestor
Reads an error message.

Specified by:
readError in class Requestor
Throws:
IOException

getClient

public static Object getClient(Class<?> iface,
                               Transceiver transciever)
                        throws IOException
Create a proxy instance whose methods invoke RPCs.

Throws:
IOException

getClient

public static Object getClient(Class<?> iface,
                               Transceiver transciever,
                               SpecificData specificData)
                        throws IOException
Create a proxy instance whose methods invoke RPCs.

Throws:
IOException

getClient

public static Object getClient(Class<?> iface,
                               SpecificRequestor requestor)
                        throws IOException
Create a proxy instance whose methods invoke RPCs.

Throws:
IOException


Copyright © 2010 The Apache Software Foundation