EVOLUTION-MANAGER
Edit File: RpcServer.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_91) on Thu Jan 14 10:04:50 GMT 2016 --> <title>RpcServer</title> <meta name="date" content="2016-01-14"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="RpcServer"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../com/rabbitmq/client/RpcClient.html" title="class in com.rabbitmq.client"><span class="strong">Prev Class</span></a></li> <li><a href="../../../com/rabbitmq/client/SaslConfig.html" title="interface in com.rabbitmq.client"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?com/rabbitmq/client/RpcServer.html" target="_top">Frames</a></li> <li><a href="RpcServer.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li>Field | </li> <li><a href="#constructor_summary">Constr</a> | </li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor_detail">Constr</a> | </li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">com.rabbitmq.client</div> <h2 title="Class RpcServer" class="title">Class RpcServer</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>com.rabbitmq.client.RpcServer</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Direct Known Subclasses:</dt> <dd><a href="../../../com/rabbitmq/client/MapRpcServer.html" title="class in com.rabbitmq.client">MapRpcServer</a>, <a href="../../../com/rabbitmq/client/StringRpcServer.html" title="class in com.rabbitmq.client">StringRpcServer</a></dd> </dl> <hr> <br> <pre>public class <span class="strong">RpcServer</span> extends java.lang.Object</pre> <div class="block">Class which manages a request queue for a simple RPC-style service. The class is agnostic about the format of RPC arguments / return values.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd"> </span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../com/rabbitmq/client/RpcServer.html#RpcServer(com.rabbitmq.client.Channel)">RpcServer</a></strong>(<a href="../../../com/rabbitmq/client/Channel.html" title="interface in com.rabbitmq.client">Channel</a> channel)</code> <div class="block">Creates an RpcServer listening on a temporary exclusive autodelete queue.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><code><strong><a href="../../../com/rabbitmq/client/RpcServer.html#RpcServer(com.rabbitmq.client.Channel,%20java.lang.String)">RpcServer</a></strong>(<a href="../../../com/rabbitmq/client/Channel.html" title="interface in com.rabbitmq.client">Channel</a> channel, java.lang.String queueName)</code> <div class="block">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.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../com/rabbitmq/client/RpcServer.html#close()">close</a></strong>()</code> <div class="block">Public API - cancels the consumer, thus deleting the queue, if it was a temporary queue, and marks the RpcServer as closed.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../com/rabbitmq/client/Channel.html" title="interface in com.rabbitmq.client">Channel</a></code></td> <td class="colLast"><code><strong><a href="../../../com/rabbitmq/client/RpcServer.html#getChannel()">getChannel</a></strong>()</code> <div class="block">Retrieve the channel.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../com/rabbitmq/client/RpcServer.html#getQueueName()">getQueueName</a></strong>()</code> <div class="block">Retrieve the queue name.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>byte[]</code></td> <td class="colLast"><code><strong><a href="../../../com/rabbitmq/client/RpcServer.html#handleCall(com.rabbitmq.client.AMQP.BasicProperties,%20byte[],%20com.rabbitmq.client.AMQP.BasicProperties)">handleCall</a></strong>(<a href="../../../com/rabbitmq/client/AMQP.BasicProperties.html" title="class in com.rabbitmq.client">AMQP.BasicProperties</a> requestProperties, byte[] requestBody, <a href="../../../com/rabbitmq/client/AMQP.BasicProperties.html" title="class in com.rabbitmq.client">AMQP.BasicProperties</a> replyProperties)</code> <div class="block">Mid-level response method.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>byte[]</code></td> <td class="colLast"><code><strong><a href="../../../com/rabbitmq/client/RpcServer.html#handleCall(byte[],%20com.rabbitmq.client.AMQP.BasicProperties)">handleCall</a></strong>(byte[] requestBody, <a href="../../../com/rabbitmq/client/AMQP.BasicProperties.html" title="class in com.rabbitmq.client">AMQP.BasicProperties</a> replyProperties)</code> <div class="block">High-level response method.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>byte[]</code></td> <td class="colLast"><code><strong><a href="../../../com/rabbitmq/client/RpcServer.html#handleCall(com.rabbitmq.client.QueueingConsumer.Delivery,%20com.rabbitmq.client.AMQP.BasicProperties)">handleCall</a></strong>(<a href="../../../com/rabbitmq/client/QueueingConsumer.Delivery.html" title="class in com.rabbitmq.client">QueueingConsumer.Delivery</a> request, <a href="../../../com/rabbitmq/client/AMQP.BasicProperties.html" title="class in com.rabbitmq.client">AMQP.BasicProperties</a> replyProperties)</code> <div class="block">Lowest-level response method.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../com/rabbitmq/client/RpcServer.html#handleCast(com.rabbitmq.client.AMQP.BasicProperties,%20byte[])">handleCast</a></strong>(<a href="../../../com/rabbitmq/client/AMQP.BasicProperties.html" title="class in com.rabbitmq.client">AMQP.BasicProperties</a> requestProperties, byte[] requestBody)</code> <div class="block">Mid-level handler method.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../com/rabbitmq/client/RpcServer.html#handleCast(byte[])">handleCast</a></strong>(byte[] requestBody)</code> <div class="block">High-level handler method.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../com/rabbitmq/client/RpcServer.html#handleCast(com.rabbitmq.client.QueueingConsumer.Delivery)">handleCast</a></strong>(<a href="../../../com/rabbitmq/client/QueueingConsumer.Delivery.html" title="class in com.rabbitmq.client">QueueingConsumer.Delivery</a> request)</code> <div class="block">Lowest-level handler method.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../com/rabbitmq/client/ShutdownSignalException.html" title="class in com.rabbitmq.client">ShutdownSignalException</a></code></td> <td class="colLast"><code><strong><a href="../../../com/rabbitmq/client/RpcServer.html#mainloop()">mainloop</a></strong>()</code> <div class="block">Public API - main server loop.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../com/rabbitmq/client/RpcServer.html#processRequest(com.rabbitmq.client.QueueingConsumer.Delivery)">processRequest</a></strong>(<a href="../../../com/rabbitmq/client/QueueingConsumer.Delivery.html" title="class in com.rabbitmq.client">QueueingConsumer.Delivery</a> request)</code> <div class="block">Private API - Process a single request.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected <a href="../../../com/rabbitmq/client/QueueingConsumer.html" title="class in com.rabbitmq.client">QueueingConsumer</a></code></td> <td class="colLast"><code><strong><a href="../../../com/rabbitmq/client/RpcServer.html#setupConsumer()">setupConsumer</a></strong>()</code> <div class="block">Registers a consumer on the reply queue.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../com/rabbitmq/client/RpcServer.html#terminateMainloop()">terminateMainloop</a></strong>()</code> <div class="block">Call this method to terminate the mainloop.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="RpcServer(com.rabbitmq.client.Channel)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>RpcServer</h4> <pre>public RpcServer(<a href="../../../com/rabbitmq/client/Channel.html" title="interface in com.rabbitmq.client">Channel</a> channel) throws java.io.IOException</pre> <div class="block">Creates an RpcServer listening on a temporary exclusive autodelete queue.</div> <dl><dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code></dd></dl> </li> </ul> <a name="RpcServer(com.rabbitmq.client.Channel, java.lang.String)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>RpcServer</h4> <pre>public RpcServer(<a href="../../../com/rabbitmq/client/Channel.html" title="interface in com.rabbitmq.client">Channel</a> channel, java.lang.String queueName) throws java.io.IOException</pre> <div class="block">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.</div> <dl><dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code></dd></dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="close()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>close</h4> <pre>public void close() throws java.io.IOException</pre> <div class="block">Public API - cancels the consumer, thus deleting the queue, if it was a temporary queue, and marks the RpcServer as closed.</div> <dl><dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code> - if an error is encountered</dd></dl> </li> </ul> <a name="setupConsumer()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setupConsumer</h4> <pre>protected <a href="../../../com/rabbitmq/client/QueueingConsumer.html" title="class in com.rabbitmq.client">QueueingConsumer</a> setupConsumer() throws java.io.IOException</pre> <div class="block">Registers a consumer on the reply queue.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>the newly created and registered consumer</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code> - if an error is encountered</dd></dl> </li> </ul> <a name="mainloop()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>mainloop</h4> <pre>public <a href="../../../com/rabbitmq/client/ShutdownSignalException.html" title="class in com.rabbitmq.client">ShutdownSignalException</a> mainloop() throws java.io.IOException</pre> <div class="block">Public API - main server loop. Call this to begin processing requests. Request processing will continue until the Channel (or its underlying Connection) is shut down, or until terminateMainloop() is called. Note that if the mainloop is blocked waiting for a request, the termination flag is not checked until a request is received, so a good time to call terminateMainloop() is during a request handler.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>the exception that signalled the Channel shutdown, or null for orderly shutdown</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code></dd></dl> </li> </ul> <a name="terminateMainloop()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>terminateMainloop</h4> <pre>public void terminateMainloop()</pre> <div class="block">Call this method to terminate the mainloop. Note that if the mainloop is blocked waiting for a request, the termination flag is not checked until a request is received, so a good time to call terminateMainloop() is during a request handler.</div> </li> </ul> <a name="processRequest(com.rabbitmq.client.QueueingConsumer.Delivery)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>processRequest</h4> <pre>public void processRequest(<a href="../../../com/rabbitmq/client/QueueingConsumer.Delivery.html" title="class in com.rabbitmq.client">QueueingConsumer.Delivery</a> request) throws java.io.IOException</pre> <div class="block">Private API - Process a single request. Called from mainloop().</div> <dl><dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code></dd></dl> </li> </ul> <a name="handleCall(com.rabbitmq.client.QueueingConsumer.Delivery, com.rabbitmq.client.AMQP.BasicProperties)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>handleCall</h4> <pre>public byte[] handleCall(<a href="../../../com/rabbitmq/client/QueueingConsumer.Delivery.html" title="class in com.rabbitmq.client">QueueingConsumer.Delivery</a> request, <a href="../../../com/rabbitmq/client/AMQP.BasicProperties.html" title="class in com.rabbitmq.client">AMQP.BasicProperties</a> replyProperties)</pre> <div class="block">Lowest-level response method. Calls handleCall(AMQP.BasicProperties,byte[],AMQP.BasicProperties).</div> </li> </ul> <a name="handleCall(com.rabbitmq.client.AMQP.BasicProperties, byte[], com.rabbitmq.client.AMQP.BasicProperties)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>handleCall</h4> <pre>public byte[] handleCall(<a href="../../../com/rabbitmq/client/AMQP.BasicProperties.html" title="class in com.rabbitmq.client">AMQP.BasicProperties</a> requestProperties, byte[] requestBody, <a href="../../../com/rabbitmq/client/AMQP.BasicProperties.html" title="class in com.rabbitmq.client">AMQP.BasicProperties</a> replyProperties)</pre> <div class="block">Mid-level response method. Calls handleCall(byte[],AMQP.BasicProperties).</div> </li> </ul> <a name="handleCall(byte[], com.rabbitmq.client.AMQP.BasicProperties)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>handleCall</h4> <pre>public byte[] handleCall(byte[] requestBody, <a href="../../../com/rabbitmq/client/AMQP.BasicProperties.html" title="class in com.rabbitmq.client">AMQP.BasicProperties</a> replyProperties)</pre> <div class="block">High-level response method. Returns an empty response by default - override this (or other handleCall and handleCast methods) in subclasses.</div> </li> </ul> <a name="handleCast(com.rabbitmq.client.QueueingConsumer.Delivery)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>handleCast</h4> <pre>public void handleCast(<a href="../../../com/rabbitmq/client/QueueingConsumer.Delivery.html" title="class in com.rabbitmq.client">QueueingConsumer.Delivery</a> request)</pre> <div class="block">Lowest-level handler method. Calls handleCast(AMQP.BasicProperties,byte[]).</div> </li> </ul> <a name="handleCast(com.rabbitmq.client.AMQP.BasicProperties, byte[])"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>handleCast</h4> <pre>public void handleCast(<a href="../../../com/rabbitmq/client/AMQP.BasicProperties.html" title="class in com.rabbitmq.client">AMQP.BasicProperties</a> requestProperties, byte[] requestBody)</pre> <div class="block">Mid-level handler method. Calls handleCast(byte[]).</div> </li> </ul> <a name="handleCast(byte[])"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>handleCast</h4> <pre>public void handleCast(byte[] requestBody)</pre> <div class="block">High-level handler method. Does nothing by default - override this (or other handleCast and handleCast methods) in subclasses.</div> </li> </ul> <a name="getChannel()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getChannel</h4> <pre>public <a href="../../../com/rabbitmq/client/Channel.html" title="interface in com.rabbitmq.client">Channel</a> getChannel()</pre> <div class="block">Retrieve the channel.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>the channel to which this server is connected</dd></dl> </li> </ul> <a name="getQueueName()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getQueueName</h4> <pre>public java.lang.String getQueueName()</pre> <div class="block">Retrieve the queue name.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>the queue which this server is consuming from</dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../com/rabbitmq/client/RpcClient.html" title="class in com.rabbitmq.client"><span class="strong">Prev Class</span></a></li> <li><a href="../../../com/rabbitmq/client/SaslConfig.html" title="interface in com.rabbitmq.client"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?com/rabbitmq/client/RpcServer.html" target="_top">Frames</a></li> <li><a href="RpcServer.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li>Field | </li> <li><a href="#constructor_summary">Constr</a> | </li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor_detail">Constr</a> | </li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>