Javadoc fixes

- Add hint to reconnection configuration
- s/connection.getChatManager/ChatManager.getInstanceFor(connection)
- typos
This commit is contained in:
Florian Schmaus 2014-04-15 11:22:46 +02:00
parent 0136c3eb81
commit b4eb8ad182
3 changed files with 25 additions and 23 deletions

View File

@ -353,22 +353,24 @@ public class ConnectionConfiguration implements Cloneable {
/** /**
* Sets if the reconnection mechanism is allowed to be used. By default * Sets if the reconnection mechanism is allowed to be used. By default
* reconnection is allowed. * 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) { public void setReconnectionAllowed(boolean isAllowed) {
this.reconnectionAllowed = isAllowed; this.reconnectionAllowed = isAllowed;
} }
/** /**
* Returns if the reconnection mechanism is allowed to be used. By default * Returns if the reconnection mechanism is allowed to be used. By default reconnection is
* reconnection is allowed. * 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() { public boolean isReconnectionAllowed() {
return this.reconnectionAllowed; return this.reconnectionAllowed;
} }
/** /**
* Sets the socket factory used to create new xmppConnection sockets. * Sets the socket factory used to create new xmppConnection sockets.
* This is useful when connecting through SOCKS5 proxies. * This is useful when connecting through SOCKS5 proxies.

View File

@ -23,7 +23,7 @@ import java.util.Random;
import java.util.logging.Logger; import java.util.logging.Logger;
/** /**
* Handles the automatic reconnection process. Every time a connection is dropped without * 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.<p> * the server.<p>
* *
* The reconnection mechanism will try to reconnect periodically: * 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 * The process will try the reconnection until the connection succeed or the user
* cancell it * cancel it
*/ */
public void run() { public void run() {
// The process will try to reconnect until the connection is established or // The process will try to reconnect until the connection is established or

View File

@ -53,12 +53,12 @@ import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.packet.Presence; import org.jivesoftware.smack.packet.Presence;
/** /**
* The abstract XMPPConnection class provides an interface for connections to a * The abstract XMPPConnection class provides an interface for connections to a XMPP server and
* XMPP server and implements shared methods which are used by the * implements shared methods which are used by the different types of connections (e.g.
* different types of connections (e.g. XMPPTCPConnection or XMPPBOSHConnection). * {@link XMPPTCPConnection} or {@link XMPPBOSHConnection}). To create a connection to a XMPP server
* a simple usage of this API might look like the following:
* <p>
* *
* To create a connection to a XMPP server a simple usage of this API might
* look like the following:
* <pre> * <pre>
* // Create a connection to the igniterealtime.org XMPP server. * // Create a connection to the igniterealtime.org XMPP server.
* XMPPConnection con = new XMPPTCPConnection("igniterealtime.org"); * 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. * // Most servers require you to login before performing other tasks.
* con.login("jsmith", "mypass"); * con.login("jsmith", "mypass");
* // Start a new conversation with John Doe and send him a message. * // Start a new conversation with John Doe and send him a message.
* Chat chat = connection.getChatManager().createChat("jdoe@igniterealtime.org"</font>, new MessageListener() { * Chat chat = ChatManager.getInstanceFor(con).createChat(<font color="green">"jdoe@igniterealtime.org"</font>, new MessageListener() {
* <p/>
* public void processMessage(Chat chat, Message message) { * public void processMessage(Chat chat, Message message) {
* // Print out any messages we get back to standard out. * // Print out any messages we get back to standard out.
* System.out.println(<font color="green">"Received message: "</font> + message); * System.out.println(<font color="green">"Received message: "</font> + message);
@ -78,14 +77,15 @@ import org.jivesoftware.smack.packet.Presence;
* // Disconnect from the server * // Disconnect from the server
* con.disconnect(); * con.disconnect();
* </pre> * </pre>
* <p/> * <p>
* Connections can be reused between connections. This means that an Connection * Connections can be reused between connections. This means that an Connection may be connected,
* may be connected, disconnected and then connected again. Listeners of the Connection * disconnected and then connected again. Listeners of the Connection will be retained accross
* will be retained accross connections.<p> * connections.
* <p/> * <p>
* If a connected XMPPConnection gets disconnected abruptly then it will try to reconnect * If a connected XMPPConnection gets disconnected abruptly and automatic reconnection is enabled (
* again. To stop the reconnection process, use {@link #disconnect()}. Once stopped * {@link ConnectionConfiguration#isReconnectionAllowed()}, the default), then it will try to
* you can use {@link #connect()} to manually connect to the server. * 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 Matt Tucker
* @author Guenther Niess * @author Guenther Niess