Package com.rabbitmq.client
Class StringRpcServer
- java.lang.Object
-
- com.rabbitmq.client.RpcServer
-
- com.rabbitmq.client.StringRpcServer
-
- Direct Known Subclasses:
JsonRpcServer
public class StringRpcServer extends RpcServer
Subclass of RpcServer which accepts UTF-8 string requests.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.rabbitmq.client.RpcServer
RpcServer.RpcConsumer
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
STRING_ENCODING
-
Constructor Summary
Constructors Constructor Description StringRpcServer(Channel channel)
StringRpcServer(Channel channel, java.lang.String queueName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
handleCall(byte[] requestBody, AMQP.BasicProperties replyProperties)
Overridden to do UTF-8 processing, and delegate to handleStringCall.void
handleCast(byte[] requestBody)
Overridden to do UTF-8 processing, and delegate to handleStringCast.java.lang.String
handleStringCall(java.lang.String request)
Default implementation - override in subclasses.java.lang.String
handleStringCall(java.lang.String request, AMQP.BasicProperties replyProperties)
Delegates to handleStringCall(String).void
handleStringCast(java.lang.String 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
-
-
-
-
Field Detail
-
STRING_ENCODING
public static final java.lang.String STRING_ENCODING
- See Also:
- Constant Field Values
-
-
Method Detail
-
handleCall
public byte[] handleCall(byte[] requestBody, AMQP.BasicProperties replyProperties)
Overridden to do UTF-8 processing, and delegate to handleStringCall. If UTF-8 is not understood by this JVM, falls back to the platform default.- Overrides:
handleCall
in classRpcServer
-
handleStringCall
public java.lang.String handleStringCall(java.lang.String request, AMQP.BasicProperties replyProperties)
Delegates to handleStringCall(String).
-
handleStringCall
public java.lang.String handleStringCall(java.lang.String request)
Default implementation - override in subclasses. Returns the empty string.
-
handleCast
public void handleCast(byte[] requestBody)
Overridden to do UTF-8 processing, and delegate to handleStringCast. If requestBody cannot be interpreted as UTF-8 tries the platform default.- Overrides:
handleCast
in classRpcServer
-
handleStringCast
public void handleStringCast(java.lang.String requestBody)
Default implementation - override in subclasses. Does nothing.
-
-