org.apache.avro.ipc
Class Responder

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

public abstract class Responder
extends Object

Base class for the server side of a protocol interaction.


Constructor Summary
protected Responder(Protocol local)
           
 
Method Summary
 Protocol getLocal()
           
abstract  Object readRequest(Schema schema, Decoder in)
          Reads a request message.
abstract  Object respond(Protocol.Message message, Object request)
          Computes the response for a message.
 List<ByteBuffer> respond(Transceiver transceiver)
          Called by a server to deserialize a request, compute and serialize a response or error.
abstract  void writeError(Schema schema, AvroRemoteException error, Encoder out)
          Writes an error message.
abstract  void writeResponse(Schema schema, Object response, Encoder out)
          Writes a response message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Responder

protected Responder(Protocol local)
Method Detail

getLocal

public Protocol getLocal()

respond

public List<ByteBuffer> respond(Transceiver transceiver)
                         throws IOException
Called by a server to deserialize a request, compute and serialize a response or error.

Throws:
IOException

respond

public abstract Object respond(Protocol.Message message,
                               Object request)
                        throws AvroRemoteException
Computes the response for a message.

Throws:
AvroRemoteException

readRequest

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

Throws:
IOException

writeResponse

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

Throws:
IOException

writeError

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

Throws:
IOException


Copyright © 2009 The Apache Software Foundation