From b4eb8ad182f8ba5e853a420c3b435cd3a564f69f Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 15 Apr 2014 11:22:46 +0200 Subject: [PATCH] Javadoc fixes - Add hint to reconnection configuration - s/connection.getChatManager/ChatManager.getInstanceFor(connection) - typos --- .../smack/ConnectionConfiguration.java | 14 +++++---- .../smack/ReconnectionManager.java | 4 +-- .../jivesoftware/smack/XMPPConnection.java | 30 +++++++++---------- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java b/core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java index 95858858f..e380902e5 100644 --- a/core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java +++ b/core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java @@ -353,22 +353,24 @@ public class ConnectionConfiguration implements Cloneable { /** * Sets if the reconnection mechanism is allowed to be used. By default * reconnection is allowed. - * - * @param isAllowed if the reconnection mechanism is allowed to use. + * + * @param isAllowed if the reconnection mechanism should be enabled for this connection. */ public void setReconnectionAllowed(boolean isAllowed) { this.reconnectionAllowed = isAllowed; } + /** - * Returns if the reconnection mechanism is allowed to be used. By default - * reconnection is allowed. + * Returns if the reconnection mechanism is allowed to be used. By default reconnection is + * allowed. You can disable the reconnection mechanism with {@link + * #setReconnectionAllowed(boolean)}. * - * @return if the reconnection mechanism is allowed to be used. + * @return true, if the reconnection mechanism is enabled. */ public boolean isReconnectionAllowed() { return this.reconnectionAllowed; } - + /** * Sets the socket factory used to create new xmppConnection sockets. * This is useful when connecting through SOCKS5 proxies. diff --git a/core/src/main/java/org/jivesoftware/smack/ReconnectionManager.java b/core/src/main/java/org/jivesoftware/smack/ReconnectionManager.java index b90fc4054..683b86d0c 100644 --- a/core/src/main/java/org/jivesoftware/smack/ReconnectionManager.java +++ b/core/src/main/java/org/jivesoftware/smack/ReconnectionManager.java @@ -23,7 +23,7 @@ import java.util.Random; import java.util.logging.Logger; /** * Handles the automatic reconnection process. Every time a connection is dropped without - * the application explictly closing it, the manager automatically tries to reconnect to + * the application explicitly closing it, the manager automatically tries to reconnect to * the server.

* * The reconnection mechanism will try to reconnect periodically: @@ -115,7 +115,7 @@ public class ReconnectionManager extends AbstractConnectionListener { /** * The process will try the reconnection until the connection succeed or the user - * cancell it + * cancel it */ public void run() { // The process will try to reconnect until the connection is established or diff --git a/core/src/main/java/org/jivesoftware/smack/XMPPConnection.java b/core/src/main/java/org/jivesoftware/smack/XMPPConnection.java index a6783d932..9eebe1e32 100644 --- a/core/src/main/java/org/jivesoftware/smack/XMPPConnection.java +++ b/core/src/main/java/org/jivesoftware/smack/XMPPConnection.java @@ -53,12 +53,12 @@ import org.jivesoftware.smack.packet.Packet; import org.jivesoftware.smack.packet.Presence; /** - * The abstract XMPPConnection class provides an interface for connections to a - * XMPP server and implements shared methods which are used by the - * different types of connections (e.g. XMPPTCPConnection or XMPPBOSHConnection). + * The abstract XMPPConnection class provides an interface for connections to a XMPP server and + * implements shared methods which are used by the different types of connections (e.g. + * {@link XMPPTCPConnection} or {@link XMPPBOSHConnection}). To create a connection to a XMPP server + * a simple usage of this API might look like the following: + *

* - * To create a connection to a XMPP server a simple usage of this API might - * look like the following: *

  * // Create a connection to the igniterealtime.org XMPP server.
  * XMPPConnection con = new XMPPTCPConnection("igniterealtime.org");
@@ -67,8 +67,7 @@ import org.jivesoftware.smack.packet.Presence;
  * // Most servers require you to login before performing other tasks.
  * con.login("jsmith", "mypass");
  * // Start a new conversation with John Doe and send him a message.
- * Chat chat = connection.getChatManager().createChat("jdoe@igniterealtime.org", new MessageListener() {
- * 

+ * Chat chat = ChatManager.getInstanceFor(con).createChat("jdoe@igniterealtime.org", new MessageListener() { * public void processMessage(Chat chat, Message message) { * // Print out any messages we get back to standard out. * System.out.println("Received message: " + message); @@ -78,14 +77,15 @@ import org.jivesoftware.smack.packet.Presence; * // Disconnect from the server * con.disconnect(); *

- *

- * Connections can be reused between connections. This means that an Connection - * may be connected, disconnected and then connected again. Listeners of the Connection - * will be retained accross connections.

- *

- * If a connected XMPPConnection gets disconnected abruptly then it will try to reconnect - * again. To stop the reconnection process, use {@link #disconnect()}. Once stopped - * you can use {@link #connect()} to manually connect to the server. + *

+ * Connections can be reused between connections. This means that an Connection may be connected, + * disconnected and then connected again. Listeners of the Connection will be retained accross + * connections. + *

+ * If a connected XMPPConnection gets disconnected abruptly and automatic reconnection is enabled ( + * {@link ConnectionConfiguration#isReconnectionAllowed()}, the default), then it will try to + * reconnect again. To stop the reconnection process, use {@link #disconnect()}. Once stopped you + * can use {@link #connect()} to manually connect to the server. * * @author Matt Tucker * @author Guenther Niess