|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avro.ipc.Responder
public abstract class Responder
Base class for the server side of a protocol interaction.
Field Summary | |
---|---|
protected List<RPCPlugin> |
rpcMetaPlugins
|
Constructor Summary | |
---|---|
protected |
Responder(Protocol local)
|
Method Summary | |
---|---|
void |
addRPCPlugin(RPCPlugin plugin)
Adds a new plugin to manipulate per-call metadata. |
Protocol |
getLocal()
Return the local protocol. |
static Protocol |
getRemote()
Return the remote protocol. |
abstract Object |
readRequest(Schema actual,
Schema expected,
Decoder in)
Reads a request message. |
List<ByteBuffer> |
respond(List<ByteBuffer> buffers)
Called by a server to deserialize a request, compute and serialize a response or error. |
List<ByteBuffer> |
respond(List<ByteBuffer> buffers,
Transceiver connection)
Called by a server to deserialize a request, compute and serialize a response or error. |
abstract Object |
respond(Protocol.Message message,
Object request)
Computes the response for a message. |
abstract void |
writeError(Schema schema,
Object 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 |
Field Detail |
---|
protected final List<RPCPlugin> rpcMetaPlugins
Constructor Detail |
---|
protected Responder(Protocol local)
Method Detail |
---|
public static Protocol getRemote()
ThreadLocal
that's set
around calls to respond(Protocol.Message, Object)
.
public Protocol getLocal()
public void addRPCPlugin(RPCPlugin plugin)
plugin
- a plugin that will manipulate RPC metadatapublic List<ByteBuffer> respond(List<ByteBuffer> buffers) throws IOException
IOException
public List<ByteBuffer> respond(List<ByteBuffer> buffers, Transceiver connection) throws IOException
IOException
public abstract Object respond(Protocol.Message message, Object request) throws Exception
Exception
public abstract Object readRequest(Schema actual, Schema expected, Decoder in) throws IOException
IOException
public abstract void writeResponse(Schema schema, Object response, Encoder out) throws IOException
IOException
public abstract void writeError(Schema schema, Object error, Encoder out) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |