Skip to content

Commit 3fbfe0c

Browse files
author
Alexandru Scvortov
committed
updated docs
1 parent b42f848 commit 3fbfe0c

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

src/com/rabbitmq/client/Connection.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
* <pre>
4242
* ConnectionFactory factory = new ConnectionFactory();
4343
* factory.setHostName(hostName);
44+
* factory.setPortNumber(portNumber);
4445
* factory.setVirtualHost(virtualHost);
4546
* factory.setUsername(username);
4647
* factory.setPassword(password);

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,20 @@
5757
* To connect to a broker,
5858
*
5959
* <pre>
60-
* AMQConnection conn = new AMQConnection(hostName, portNumber);
61-
* conn.open(username, portNumber, virtualHost);
60+
* ConnectionFactory factory = new {@link ConnectionFactory ConnectionFactory}();
61+
* factory.setHost(hostName);
62+
* factory.setPort(portNumber);
63+
* factory.setVirtualHost(virtualHost);
64+
* AMQConnection conn = new AMQConnection(factory, factory.{@link ConnectionFactory#createFrameHandler createFrameHandler}(new {@link Address Address}(hostName, portNumber));
65+
* conn.{@link AMQConnection#start start}(false);
6266
* </pre>
6367
*
6468
* <pre>
65-
* ChannelN ch1 = conn.createChannel(1);
66-
* ch1.open(&quot;&quot;);
69+
* {@link ChannelN ChannelN} ch1 = new {@link ChannelN ChannelN}(conn, 1);
70+
* ch1.open();
6771
* </pre>
72+
*
73+
* For a saner way of connecting to a broker, see {@link Connection}.
6874
*/
6975
public class AMQConnection extends ShutdownNotifierComponent implements Connection {
7076
/** Timeout used while waiting for AMQP handshaking to complete (milliseconds) */

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
* To open a channel,
6565
* <pre>
6666
* {@link Connection} conn = ...;
67-
* {@link ChannelN} ch1 = conn.{@link Connection#createChannel createChannel}(1);
68-
* ch1.{@link ChannelN#open open}("");
67+
* {@link ChannelN} ch1 = conn.{@link Connection#createChannel createChannel}();
68+
* ch1.{@link ChannelN#open open}();
6969
* </pre>
7070
*/
7171
public class ChannelN extends AMQChannel implements com.rabbitmq.client.Channel {

0 commit comments

Comments
 (0)