|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.rabbitmq.client.RpcServer
public class RpcServer
Class which manages a request queue for a simple RPC-style service. The class is agnostic about the format of RPC arguments / return values.
Constructor Summary | |
---|---|
RpcServer(Channel channel)
Creates an RpcServer listening on a temporary exclusive autodelete queue. |
|
RpcServer(Channel channel,
java.lang.String queueName)
If the passed-in queue name is null, creates a server-named temporary exclusive autodelete queue to use; otherwise expects the queue to have already been declared. |
Method Summary | |
---|---|
void |
close()
Public API - cancels the consumer, thus deleting the queue, if it was a temporary queue, and marks the RpcServer as closed. |
Channel |
getChannel()
Retrieve the channel. |
java.lang.String |
getQueueName()
Retrieve the queue name. |
byte[] |
handleCall(AMQP.BasicProperties requestProperties,
byte[] requestBody,
AMQP.BasicProperties replyProperties)
Mid-level response method. |
byte[] |
handleCall(byte[] requestBody,
AMQP.BasicProperties replyProperties)
High-level response method. |
byte[] |
handleCall(QueueingConsumer.Delivery request,
AMQP.BasicProperties replyProperties)
Lowest-level response method. |
void |
handleCast(AMQP.BasicProperties requestProperties,
byte[] requestBody)
Mid-level handler method. |
void |
handleCast(byte[] requestBody)
High-level handler method. |
void |
handleCast(QueueingConsumer.Delivery request)
Lowest-level handler method. |
ShutdownSignalException |
mainloop()
Public API - main server loop. |
void |
processRequest(QueueingConsumer.Delivery request)
Private API - Process a single request. |
protected QueueingConsumer |
setupConsumer()
Registers a consumer on the reply queue. |
void |
terminateMainloop()
Call this method to terminate the mainloop. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RpcServer(Channel channel) throws java.io.IOException
java.io.IOException
public RpcServer(Channel channel, java.lang.String queueName) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void close() throws java.io.IOException
java.io.IOException
- if an error is encounteredprotected QueueingConsumer setupConsumer() throws java.io.IOException
java.io.IOException
- if an error is encounteredpublic ShutdownSignalException mainloop() throws java.io.IOException
java.io.IOException
public void terminateMainloop()
public void processRequest(QueueingConsumer.Delivery request) throws java.io.IOException
java.io.IOException
public byte[] handleCall(QueueingConsumer.Delivery request, AMQP.BasicProperties replyProperties)
public byte[] handleCall(AMQP.BasicProperties requestProperties, byte[] requestBody, AMQP.BasicProperties replyProperties)
public byte[] handleCall(byte[] requestBody, AMQP.BasicProperties replyProperties)
public void handleCast(QueueingConsumer.Delivery request)
public void handleCast(AMQP.BasicProperties requestProperties, byte[] requestBody)
public void handleCast(byte[] requestBody)
public Channel getChannel()
public java.lang.String getQueueName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |