org.apache.avro.reflect
Class ReflectRequestor
java.lang.Object
org.apache.avro.ipc.Requestor
org.apache.avro.reflect.ReflectRequestor
- All Implemented Interfaces:
- InvocationHandler
- Direct Known Subclasses:
- SpecificRequestor
public class ReflectRequestor
- extends Requestor
- implements InvocationHandler
A Requestor
for existing interfaces via Java reflection.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
packageName
protected String packageName
ReflectRequestor
protected ReflectRequestor(Protocol protocol,
Transceiver transceiver)
throws IOException
- Throws:
IOException
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 AvroRemoteException 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
Copyright © 2009 The Apache Software Foundation