org.apache.avro.reflect
Class ReflectResponder

java.lang.Object
  extended by org.apache.avro.ipc.Responder
      extended by org.apache.avro.reflect.ReflectResponder
Direct Known Subclasses:
SpecificResponder

public class ReflectResponder
extends Responder

Responder for existing interfaces via Java reflection.


Field Summary
 
Fields inherited from class org.apache.avro.ipc.Responder
rpcMetaPlugins
 
Constructor Summary
ReflectResponder(Class iface, Object impl)
           
ReflectResponder(Class iface, Object impl, ReflectData reflectData)
           
 
Method Summary
protected  DatumReader<Object> getDatumReader(Schema schema)
           
protected  DatumWriter<Object> getDatumWriter(Schema schema)
           
 Object readRequest(Schema schema, Decoder in)
          Reads a request message.
 Object respond(Protocol.Message message, Object request)
          Computes the response for a message.
 void writeError(Schema schema, AvroRemoteException error, Encoder out)
          Writes an error message.
 void writeResponse(Schema schema, Object response, Encoder out)
          Writes a response message.
 
Methods inherited from class org.apache.avro.ipc.Responder
addRPCPlugin, getLocal, respond
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectResponder

public ReflectResponder(Class iface,
                        Object impl)

ReflectResponder

public ReflectResponder(Class iface,
                        Object impl,
                        ReflectData reflectData)
Method Detail

getDatumWriter

protected DatumWriter<Object> getDatumWriter(Schema schema)

getDatumReader

protected DatumReader<Object> getDatumReader(Schema schema)

readRequest

public Object readRequest(Schema schema,
                          Decoder in)
                   throws IOException
Reads a request message.

Specified by:
readRequest in class Responder
Throws:
IOException

writeResponse

public void writeResponse(Schema schema,
                          Object response,
                          Encoder out)
                   throws IOException
Writes a response message.

Specified by:
writeResponse in class Responder
Throws:
IOException

writeError

public void writeError(Schema schema,
                       AvroRemoteException error,
                       Encoder out)
                throws IOException
Writes an error message.

Specified by:
writeError in class Responder
Throws:
IOException

respond

public Object respond(Protocol.Message message,
                      Object request)
               throws AvroRemoteException
Description copied from class: Responder
Computes the response for a message.

Specified by:
respond in class Responder
Throws:
AvroRemoteException


Copyright © 2009 The Apache Software Foundation