directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r354357 - /directory/network/trunk/src/java/org/apache/mina/common/IoSession.java
Date Tue, 06 Dec 2005 08:19:55 GMT
Author: trustin
Date: Tue Dec  6 00:19:49 2005
New Revision: 354357

URL: http://svn.apache.org/viewcvs?rev=354357&view=rev
Log:
Added JavaDoc on thread safety of IoSession

Modified:
    directory/network/trunk/src/java/org/apache/mina/common/IoSession.java

Modified: directory/network/trunk/src/java/org/apache/mina/common/IoSession.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/IoSession.java?rev=354357&r1=354356&r2=354357&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/IoSession.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/IoSession.java Tue Dec  6 00:19:49
2005
@@ -25,14 +25,30 @@
  * A handle which represents connection between two endpoints regardless of 
  * transport types.
  * <p>
- * Session provides user-defined attributes.  User-defined attributes are
- * application-specific data which is associated with a session.
+ * {@link IoSession} provides user-defined attributes.  User-defined attributes
+ * are application-specific data which is associated with a session.
  * It often contains objects that represents the state of a higher-level protocol
  * and becomes a way to exchange data between filters and handlers.
  * 
- * <h2>Adjusting Transport Type Specific Properties</h2>
+ * <h3>Adjusting Transport Type Specific Properties</h3>
  * <p>
  * You can simply downcast the session to an appropriate subclass.
+ * </p>
+ * 
+ * <h3>Thread Safety</h3>
+ * <p>
+ * {@link IoSession} is thread safe.  {@link #close()} and {@link #write(Object)}
+ * operations are performed exclusively acquiring its {@link IoSession} instance
+ * as a lock.  You can also use {@link IoSession} instance to synchronize your code:
+ * <pre>
+ *   IoSession session = ...;
+ *   synchronized( session )
+ *   {
+ *       // Some code that may not be executed while <tt>session.close()</tt>
+ *       // or <tt>session.write</tt> is being executed.
+ *       ...
+ *   }
+ * </pre>
  * </p>
  *   
  * @author The Apache Directory Project (dev@directory.apache.org)



Mime
View raw message