com.rabbitmq.client
Class StringRpcServer

java.lang.Object
  extended by com.rabbitmq.client.RpcServer
      extended by com.rabbitmq.client.StringRpcServer
Direct Known Subclasses:
JsonRpcServer

public class StringRpcServer
extends RpcServer

Subclass of RpcServer which accepts UTF-8 string requests.


Field Summary
static java.lang.String STRING_ENCODING
           
 
Constructor Summary
StringRpcServer(Channel channel)
           
StringRpcServer(Channel channel, java.lang.String queueName)
           
 
Method Summary
 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, processRequest, setupConsumer, terminateMainloop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRING_ENCODING

public static java.lang.String STRING_ENCODING
Constructor Detail

StringRpcServer

public StringRpcServer(Channel channel)
                throws java.io.IOException
Throws:
java.io.IOException

StringRpcServer

public StringRpcServer(Channel channel,
                       java.lang.String queueName)
                throws java.io.IOException
Throws:
java.io.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 class RpcServer

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 class RpcServer

handleStringCast

public void handleStringCast(java.lang.String requestBody)
Default implementation - override in subclasses. Does nothing.