Skip to content

Commit 48a4ce4

Browse files
author
Steve Powell
committed
Add Javadoc
1 parent 87f2a4e commit 48a4ce4

File tree

4 files changed

+27
-8
lines changed

4 files changed

+27
-8
lines changed

src/com/rabbitmq/client/impl/AMQConnection.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public Map<String, Object> getServerProperties() {
175175
* @param password for <code><b>username</b></code>
176176
* @param frameHandler for sending and receiving frames on this connection
177177
* @param executor thread pool service for consumer threads for channels on this connection
178-
* @param virtualHost
178+
* @param virtualHost virtual host of this connection
179179
* @param clientProperties client info used in negotiating with the server
180180
* @param requestedFrameMax max size of frame offered
181181
* @param requestedChannelMax max number of channels offered
@@ -211,7 +211,7 @@ public AMQConnection(String username,
211211
* @param password for <code><b>username</b></code>
212212
* @param frameHandler for sending and receiving frames on this connection
213213
* @param executor thread pool service for consumer threads for channels on this connection
214-
* @param virtualHost
214+
* @param virtualHost virtual host of this connection
215215
* @param clientProperties client info used in negotiating with the server
216216
* @param requestedFrameMax max size of frame offered
217217
* @param requestedChannelMax max number of channels offered
@@ -623,10 +623,14 @@ public SocketCloseWait(ShutdownSignalException sse) {
623623
}
624624

625625
/**
626-
* Protected API - causes all attached channels to terminate with
627-
* a ShutdownSignal built from the argument, and stops this
628-
* connection from accepting further work from the application.
629-
*
626+
* Protected API - causes all attached channels to terminate (shutdown) with a ShutdownSignal
627+
* built from the argument, and stops this connection from accepting further work from the
628+
* application. {@link com.rabbitmq.client.ShutdownListener ShutdownListener}s for the
629+
* connection are notified when the main loop terminates.
630+
* @param reason object being shutdown
631+
* @param initiatedByApplication true if caused by a client command
632+
* @param cause trigger exception which caused shutdown
633+
* @param notifyRpc true if outstanding rpc should be informed of shutdown
630634
* @return a shutdown signal built using the given arguments
631635
*/
632636
public ShutdownSignalException shutdown(Object reason,
@@ -722,6 +726,7 @@ public void close(int closeCode,
722726
close(closeCode, closeMessage, initiatedByApplication, cause, -1, false);
723727
}
724728

729+
// TODO: Make this private
725730
/**
726731
* Protected API - Close this connection with the given code, message, source
727732
* and timeout value for all the close operations to complete.

src/com/rabbitmq/client/impl/ChannelManager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
/**
3131
* Manages a set of channels, indexed by channel number (<code><b>1.._channelMax</b></code>).
3232
*/
33-
3433
public final class ChannelManager {
3534
private static final int SHUTDOWN_TIMEOUT_SECONDS = 10;
3635

@@ -77,6 +76,10 @@ public ChannelN getChannel(int channelNumber) {
7776
}
7877
}
7978

79+
/**
80+
* Handle shutdown. All the managed {@link com.rabbitmq.client.Channel Channel}s are shutdown.
81+
* @param signal reason for shutdown
82+
*/
8083
public void handleSignal(ShutdownSignalException signal) {
8184
Set<ChannelN> channels;
8285
synchronized(this.monitor) {

src/com/rabbitmq/client/impl/ShutdownNotifierComponent.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
import com.rabbitmq.client.ShutdownNotifier;
2525
import com.rabbitmq.client.ShutdownSignalException;
2626

27+
/**
28+
* A class that manages {@link ShutdownListener}s and remembers the reason for a shutdown. Both
29+
* {@link com.rabbitmq.client.Channel Channel}s and {@link com.rabbitmq.client.Connection
30+
* Connection}s have shutdown listeners.
31+
*/
2732
public class ShutdownNotifierComponent implements ShutdownNotifier {
2833

2934
/** Monitor for shutdown listeners and shutdownCause */
@@ -87,6 +92,11 @@ public boolean isOpen() {
8792
}
8893
}
8994

95+
/**
96+
* Internal: this is the means of registering shutdown.
97+
* @param sse the reason for the shutdown
98+
* @return <code>true</code> if the component is open; <code>false</code> otherwise.
99+
*/
90100
public boolean setShutdownCauseIfOpen(ShutdownSignalException sse) {
91101
synchronized (this.monitor) {
92102
if (isOpen()) {

test/src/com/rabbitmq/client/test/CloseInMainLoop.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class CloseInMainLoop extends BrokerTestCase{
3232

3333
class SpecialConnection extends AMQConnection{
3434
private AtomicBoolean validShutdown = new AtomicBoolean(false);
35-
35+
3636
public boolean hadValidShutdown(){
3737
if(isOpen()) throw new IllegalStateException("hadValidShutdown called while connection is still open");
3838
return validShutdown.get();
@@ -61,6 +61,7 @@ public void handleConsumerException(Channel channel,
6161
String consumerTag,
6262
String methodName) {
6363
try {
64+
// TODO: change this to call 4-parameter close and make 6-parm one private
6465
((AMQConnection) channel.getConnection())
6566
.close(AMQP.INTERNAL_ERROR,
6667
"Internal error in Consumer " + consumerTag,

0 commit comments

Comments
 (0)