|
22 | 22 |
|
23 | 23 | import com.rabbitmq.client.AlreadyClosedException; |
24 | 24 | import com.rabbitmq.client.Command; |
| 25 | +import com.rabbitmq.client.Method; |
25 | 26 | import com.rabbitmq.client.Connection; |
26 | 27 | import com.rabbitmq.client.ShutdownSignalException; |
27 | 28 | import com.rabbitmq.utility.BlockingValueOrException; |
28 | 29 |
|
29 | 30 | /** |
30 | | - * Base class modelling an AMQ channel. Subclasses implement close() |
31 | | - * and processAsync(), and may choose to override |
32 | | - * processShutdownSignal(). |
| 31 | + * Base class modelling an AMQ channel. Subclasses implement |
| 32 | + * {@link com.rabbitmq.client.Channel#close} and |
| 33 | + * {@link #processAsync processAsync()}, and may choose to override |
| 34 | + * {@link #processShutdownSignal processShutdownSignal()} and |
| 35 | + * {@link #rpc rpc()}. |
33 | 36 | * |
34 | 37 | * @see ChannelN |
35 | 38 | * @see Connection |
@@ -122,7 +125,7 @@ public AMQCommand exnWrappingRpc(Method m) |
122 | 125 | throws IOException |
123 | 126 | { |
124 | 127 | try { |
125 | | - return rpc(m); |
| 128 | + return privateRpc(m); |
126 | 129 | } catch (AlreadyClosedException ace) { |
127 | 130 | // Do not wrap it since it means that connection/channel |
128 | 131 | // was closed in some action in the past |
@@ -183,12 +186,18 @@ public void ensureIsOpen() |
183 | 186 | } |
184 | 187 |
|
185 | 188 | /** |
186 | | - * Protected API - sends a Command to the broker and waits for the |
187 | | - * next inbound Command from the broker: only for use from |
| 189 | + * Protected API - sends a {@link Method} to the broker and waits for the |
| 190 | + * next in-bound Command from the broker: only for use from |
188 | 191 | * non-connection-MainLoop threads! |
189 | 192 | */ |
190 | 193 | public AMQCommand rpc(Method m) |
191 | 194 | throws IOException, ShutdownSignalException |
| 195 | + { |
| 196 | + return privateRpc(m); |
| 197 | + } |
| 198 | + |
| 199 | + private AMQCommand privateRpc(Method m) |
| 200 | + throws IOException, ShutdownSignalException |
192 | 201 | { |
193 | 202 | SimpleBlockingRpcContinuation k = new SimpleBlockingRpcContinuation(); |
194 | 203 | rpc(m, k); |
@@ -246,7 +255,7 @@ public void processShutdownSignal(ShutdownSignalException signal, |
246 | 255 | try { |
247 | 256 | synchronized (_channelMutex) { |
248 | 257 | if (!setShutdownCauseIfOpen(signal)) { |
249 | | - if (!ignoreClosed) |
| 258 | + if (!ignoreClosed) |
250 | 259 | throw new AlreadyClosedException("Attempt to use closed channel", this); |
251 | 260 | } |
252 | 261 |
|
|
0 commit comments