@@ -121,44 +121,101 @@ 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 default close code and message.
125126 *
126127 * This method will wait infinitely for all the close operations to
127128 * 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+ * This method will wait infinitely for all the close operations to
138+ * complete.
139+ *
140+ * @param closeCode the close code (See under "Reply Codes" in the AMQP specification)
141+ * @param closeMessage a message indicating the reason for closing the connection
142+ * @throws IOException if an I/O problem is encountered
143+ */
144+ void close (int closeCode , String closeMessage ) throws IOException ;
132145
133146 /**
134147 * Close this connection and all its channels
148+ * with the default close code and message.
135149 *
136150 * This method will wait with the given timeout for all the close
137151 * 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
152+ * 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+ * This method will wait with the given timeout for all the close
164+ * operations to complete. If timeout is reached then socket is forced
165+ * to close.
166+ *
167+ * @param closeCode the close code (See under "Reply Codes" in the AMQP specification)
168+ * @param closeMessage a message indicating the reason for closing the connection
169+ * @param timeout timeout (in milliseconds) for completing all the close-related
170+ * operations, use -1 for infinity
171+ * @throws IOException if an I/O problem is encountered
172+ */
173+ void close (int closeCode , String closeMessage , int timeout ) throws IOException ;
144174
145175 /**
146- * Abort this connection and all its channels.
176+ * Abort this connection and all its channels
177+ * with the default code and message.
147178 *
148179 * This method will force the connection to close. It will silently discard
149- * any exceptions enountered in close operations
180+ * any exceptions encountered in close operations.
150181 */
151182 void abort ();
152-
183+
153184 /**
154185 * Abort this connection and all its channels.
155186 *
187+ * This method will force the connection to close. It will silently discard
188+ * any exceptions encountered in close operations.
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 default close code and message.
198+ *
156199 * This method behaves in a similar way as abort(), with the only difference
157200 * that it will wait with a provided timeout for all the close operations to
158201 * complete. If timeout is reached socket is forced to close.
159202 *
160- * @param timeout timeout (in miliseconds ) for completing all the close-related
203+ * @param timeout timeout (in milliseconds ) for completing all the close-related
161204 * operations, use -1 for infinity
162205 */
163206 void abort (int timeout );
207+
208+ /**
209+ * Abort this connection and all its channels.
210+ *
211+ * This method behaves in a similar way as abort(), with the only difference
212+ * that it will wait with a provided timeout for all the close operations to
213+ * complete. If timeout is reached socket is forced to close.
214+ *
215+ * @param closeCode the close code (See under "Reply Codes" in the AMQP specification)
216+ * @param closeMessage a message indicating the reason for closing the connection
217+ * @param timeout timeout (in milliseconds) for completing all the close-related
218+ * operations, use -1 for infinity
219+ */
220+ void abort (int closeCode , String closeMessage , int timeout );
164221}
0 commit comments