Package com.rabbitmq.client
Class StringRpcServer
java.lang.Object
com.rabbitmq.client.RpcServer
com.rabbitmq.client.StringRpcServer
- Direct Known Subclasses:
JsonRpcServer
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
-
Constructor Summary
ConstructorDescriptionStringRpcServer
(Channel channel) StringRpcServer
(Channel channel, String queueName) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
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.handleStringCall
(String request) Default implementation - override in subclasses.handleStringCall
(String request, AMQP.BasicProperties replyProperties) Delegates to handleStringCall(String).void
handleStringCast
(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 Details
-
STRING_ENCODING
- See Also:
-
-
Constructor Details
-
StringRpcServer
- Throws:
IOException
-
StringRpcServer
- Throws:
IOException
-
-
Method Details
-
handleCall
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
Delegates to handleStringCall(String). -
handleStringCall
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
Default implementation - override in subclasses. Does nothing.
-