Package com.rabbitmq.client
Class MapRpcServer
- java.lang.Object
-
- com.rabbitmq.client.RpcServer
-
- com.rabbitmq.client.MapRpcServer
-
public class MapRpcServer extends RpcServer
Subclass of RpcServer which uses AMQP wire-format encoded tables as requests and replies.
-
-
Constructor Summary
Constructors Constructor Description MapRpcServer(Channel channel)
MapRpcServer(Channel channel, String queueName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Map<String,Object>
decode(byte[] requestBody)
static byte[]
encode(Map<String,Object> reply)
byte[]
handleCall(byte[] requestBody, AMQP.BasicProperties replyProperties)
Overridden to delegate to handleMapCall.void
handleCast(byte[] requestBody)
Overridden to delegate to handleMapCast.Map<String,Object>
handleMapCall(Map<String,Object> request)
Default implementation override in subclasses.Map<String,Object>
handleMapCall(Map<String,Object> request, AMQP.BasicProperties replyProperties)
Delegates tohandleMapCall(Map)
.void
handleMapCast(Map<String,Object> requestBody)
Default implementation override in subclasses.-
Methods inherited from class com.rabbitmq.client.RpcServer
close, getChannel, getQueueName, handleCall, handleCall, handleCast, handleCast, mainloop, postprocessReplyProperties, preprocessReplyProperties, processRequest, setupConsumer, terminateMainloop
-
-
-
-
Constructor Detail
-
MapRpcServer
public MapRpcServer(Channel channel) throws IOException
- Throws:
IOException
-
MapRpcServer
public MapRpcServer(Channel channel, String queueName) throws IOException
- Throws:
IOException
-
-
Method Detail
-
handleCall
public byte[] handleCall(byte[] requestBody, AMQP.BasicProperties replyProperties)
Overridden to delegate to handleMapCall.- Overrides:
handleCall
in classRpcServer
-
decode
public static Map<String,Object> decode(byte[] requestBody) throws IOException
- Throws:
IOException
-
encode
public static byte[] encode(Map<String,Object> reply) throws IOException
- Throws:
IOException
-
handleMapCall
public Map<String,Object> handleMapCall(Map<String,Object> request, AMQP.BasicProperties replyProperties)
Delegates tohandleMapCall(Map)
.
-
handleMapCall
public Map<String,Object> handleMapCall(Map<String,Object> request)
Default implementation override in subclasses. Returns the empty string.
-
handleCast
public void handleCast(byte[] requestBody)
Overridden to delegate to handleMapCast.- Overrides:
handleCast
in classRpcServer
-
-