Skip to content

Commit 2b3f3a9

Browse files
author
Alexandru Scvortov
committed
updated docs
ConnectionFactory.newConnection() is about 40 lines. Ultimately, that's the amount of work necessary to create an AMQConnection, so I've removed the example from AMQConnection since it will always be less than ideal.
1 parent 1308d21 commit 2b3f3a9

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

src/com/rabbitmq/client/ConnectionFactory.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ public int getPort() {
134134
return portOrDefault(port);
135135
}
136136

137+
/**
138+
* Set the target port.
139+
* @param port the default port to use for connections
140+
*/
137141
public void setPort(int port) {
138142
this.port = port;
139143
}

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

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,8 @@
5454
/**
5555
* Concrete class representing and managing an AMQP connection to a broker.
5656
* <p>
57-
* To connect to a broker,
58-
*
59-
* <pre>
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);
66-
* </pre>
67-
*
68-
* <pre>
69-
* {@link ChannelN ChannelN} ch1 = new {@link ChannelN ChannelN}(conn, 1);
70-
* ch1.open();
71-
* </pre>
72-
*
73-
* For a better way of connecting to a broker, see {@link Connection}.
57+
* To create a broker connection, use {@link ConnectionFactory}. See {@link Connection}
58+
* for an example.
7459
*/
7560
public class AMQConnection extends ShutdownNotifierComponent implements Connection {
7661
/** Timeout used while waiting for AMQP handshaking to complete (milliseconds) */

0 commit comments

Comments
 (0)