@@ -121,44 +121,103 @@ public interface Connection extends ShutdownNotifier { // rename to AMQPConnecti
121121 Channel createChannel (int channelNumber ) throws IOException ;
122122
123123 /**
124- * Close this connection and all its channels.
124+ * Close this connection and all its channels
125+ * with the {@link com.rabbitmq.client.AMQP#REPLY_SUCCESS} close code
126+ * and message 'OK'.
125127 *
126- * This method will wait infinitely for all the close operations to
127- * complete.
128+ * Waits for all the close operations to complete.
128129 *
129130 * @throws IOException if an I/O problem is encountered
130131 */
131132 void close () throws IOException ;
133+
134+ /**
135+ * Close this connection and all its channels.
136+ *
137+ * Waits for all the close operations to complete.
138+ *
139+ * @param closeCode the close code (See under "Reply Codes" in the AMQP specification)
140+ * @param closeMessage a message indicating the reason for closing the connection
141+ * @throws IOException if an I/O problem is encountered
142+ */
143+ void close (int closeCode , String closeMessage ) throws IOException ;
132144
133145 /**
134146 * Close this connection and all its channels
135- *
136- * This method will wait with the given timeout for all the close
137- * operations to complete. If timeout is reached then socket is forced
138- * to close
139- * @param timeout timeout (in milioseconds) for completing all the close-related
147+ * with the {@link com.rabbitmq.client.AMQP#REPLY_SUCCESS} close code
148+ * and message 'OK'.
149+ *
150+ * This method behaves in a similar way as {@link #close()}, with the only difference
151+ * that it waits with a provided timeout for all the close operations to
152+ * complete. When timeout is reached the socket is forced to close.
153+ *
154+ * @param timeout timeout (in milliseconds) for completing all the close-related
140155 * operations, use -1 for infinity
141156 * @throws IOException if an I/O problem is encountered
142157 */
143158 void close (int timeout ) throws IOException ;
159+
160+ /**
161+ * Close this connection and all its channels.
162+ *
163+ * Waits with the given timeout for all the close operations to complete.
164+ * When timeout is reached the socket is forced to close.
165+ *
166+ * @param closeCode the close code (See under "Reply Codes" in the AMQP specification)
167+ * @param closeMessage a message indicating the reason for closing the connection
168+ * @param timeout timeout (in milliseconds) for completing all the close-related
169+ * operations, use -1 for infinity
170+ * @throws IOException if an I/O problem is encountered
171+ */
172+ void close (int closeCode , String closeMessage , int timeout ) throws IOException ;
144173
145174 /**
146- * Abort this connection and all its channels.
175+ * Abort this connection and all its channels
176+ * with the {@link com.rabbitmq.client.AMQP#REPLY_SUCCESS} close code
177+ * and message 'OK'.
147178 *
148- * This method will force the connection to close. It will silently discard
149- * any exceptions enountered in close operations
179+ * Forces the connection to close.
180+ * Any encountered exceptions in the close operations are silently discarded.
150181 */
151182 void abort ();
152-
183+
153184 /**
154185 * Abort this connection and all its channels.
155186 *
156- * This method behaves in a similar way as abort(), with the only difference
157- * that it will wait with a provided timeout for all the close operations to
158- * complete. If timeout is reached socket is forced to close.
187+ * Forces the connection to close and waits for all the close operations to complete.
188+ * Any encountered exceptions in the close operations are silently discarded.
189+ *
190+ * @param closeCode the close code (See under "Reply Codes" in the AMQP specification)
191+ * @param closeMessage a message indicating the reason for closing the connection
192+ */
193+ void abort (int closeCode , String closeMessage );
194+
195+ /**
196+ * Abort this connection and all its channels
197+ * with the {@link com.rabbitmq.client.AMQP#REPLY_SUCCESS} close code
198+ * and message 'OK'.
199+ *
200+ * This method behaves in a similar way as {@link #abort()}, with the only difference
201+ * that it waits with a provided timeout for all the close operations to
202+ * complete. When timeout is reached the socket is forced to close.
159203 *
160- * @param timeout timeout (in miliseconds ) for completing all the close-related
204+ * @param timeout timeout (in milliseconds ) for completing all the close-related
161205 * operations, use -1 for infinity
162206 */
163207 void abort (int timeout );
208+
209+ /**
210+ * Abort this connection and all its channels.
211+ *
212+ * Forces the connection to close and waits with the given timeout
213+ * for all the close operations to complete. When timeout is reached
214+ * the socket is forced to close.
215+ * Any encountered exceptions in the close operations are silently discarded.
216+ *
217+ * @param closeCode the close code (See under "Reply Codes" in the AMQP specification)
218+ * @param closeMessage a message indicating the reason for closing the connection
219+ * @param timeout timeout (in milliseconds) for completing all the close-related
220+ * operations, use -1 for infinity
221+ */
222+ void abort (int closeCode , String closeMessage , int timeout );
164223}
0 commit comments