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.
-
-
Field Summary
Fields Modifier and Type Field Description static String
STRING_ENCODING
-
Constructor Summary
Constructors Constructor Description StringRpcServer(Channel channel)
StringRpcServer(Channel channel, 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.String
handleStringCall(String request)
Default implementation - override in subclasses.String
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 Detail
-
STRING_ENCODING
public static final String STRING_ENCODING
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StringRpcServer
public StringRpcServer(Channel channel) throws IOException
- Throws:
IOException
-
StringRpcServer
public StringRpcServer(Channel channel, String queueName) throws IOException
- Throws:
IOException
-
-
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 String handleStringCall(String request, AMQP.BasicProperties replyProperties)
Delegates to handleStringCall(String).
-
handleStringCall
public String handleStringCall(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(String requestBody)
Default implementation - override in subclasses. Does nothing.
-
-