directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r331846 - in /directory/network/trunk/src/java/org/apache/mina/common: CloseFuture.java ConnectFuture.java WriteFuture.java
Date Tue, 08 Nov 2005 17:12:12 GMT
Author: trustin
Date: Tue Nov  8 09:12:06 2005
New Revision: 331846

URL: http://svn.apache.org/viewcvs?rev=331846&view=rev
Log:
Added some example to IoFuture variants.


Modified:
    directory/network/trunk/src/java/org/apache/mina/common/CloseFuture.java
    directory/network/trunk/src/java/org/apache/mina/common/ConnectFuture.java
    directory/network/trunk/src/java/org/apache/mina/common/WriteFuture.java

Modified: directory/network/trunk/src/java/org/apache/mina/common/CloseFuture.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/CloseFuture.java?rev=331846&r1=331845&r2=331846&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/CloseFuture.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/CloseFuture.java Tue Nov  8 09:12:06
2005
@@ -20,6 +20,16 @@
 
 /**
  * An {@link IoFuture} for asynchronous close requests.
+ *
+ * <h3>Example</h3>
+ * <pre>
+ * IoSession session = ...;
+ * CloseFuture future = session.close();
+ * // Wait until the connection is closed
+ * future.join();
+ * // Now connection should be closed.
+ * assert future.isClosed();
+ * </pre>
  * 
  * @author The Apache Directory Project
  * @version $Rev$, $Date$

Modified: directory/network/trunk/src/java/org/apache/mina/common/ConnectFuture.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/ConnectFuture.java?rev=331846&r1=331845&r2=331846&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/ConnectFuture.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/ConnectFuture.java Tue Nov  8
09:12:06 2005
@@ -24,7 +24,16 @@
 
 /**
  * An {@link IoFuture} for asynchronous connect requests.
- * 
+ *
+ * <h3>Example</h3>
+ * <pre>
+ * IoConnector connector = ...;
+ * ConnectFuture future = connector.connect(...);
+ * future.join(); // Wait until the connection attempt is finished.
+ * IoSession session = future.getSession();
+ * session.write(...);
+ * </pre>
+ *
  * @author The Apache Directory Project
  * @version $Rev$, $Date$
  */

Modified: directory/network/trunk/src/java/org/apache/mina/common/WriteFuture.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/WriteFuture.java?rev=331846&r1=331845&r2=331846&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/WriteFuture.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/WriteFuture.java Tue Nov  8 09:12:06
2005
@@ -20,6 +20,23 @@
 
 /**
  * An {@link IoFuture} for asynchronous write requests.
+ *
+ * <h3>Example</h3>
+ * <pre>
+ * IoSession session = ...;
+ * WriteFuture future = session.write(...);
+ * // Wait until the message is completely written out to the O/S buffer.
+ * future.join();
+ * if( future.isWritten() )
+ * {
+ *     // The message has been written successfully.
+ * }
+ * else
+ * {
+ *     // The messsage couldn't written out completely for some reason.
+ *     // (e.g. Connection is closed)
+ * }
+ * </pre>
  * 
  * @author The Apache Directory Project
  * @version $Rev$, $Date$



Mime
View raw message