public abstract class Responder extends Object
| Modifier and Type | Field and Description |
|---|---|
protected List<RPCPlugin> |
rpcMetaPlugins |
| Modifier | Constructor and Description |
|---|---|
protected |
Responder(Protocol local) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected Responder(Protocol local)
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
IOExceptionpublic List<ByteBuffer> respond(List<ByteBuffer> buffers, Transceiver connection) throws IOException
IOExceptionpublic abstract Object respond(Protocol.Message message, Object request) throws Exception
Exceptionpublic abstract Object readRequest(Schema actual, Schema expected, Decoder in) throws IOException
IOExceptionpublic abstract void writeResponse(Schema schema, Object response, Encoder out) throws IOException
IOExceptionpublic abstract void writeError(Schema schema, Object error, Encoder out) throws IOException
IOExceptionCopyright © 2009–2023 The Apache Software Foundation. All rights reserved.