Author: buildbot
Date: Tue Sep 20 21:53:45 2016
New Revision: 997864

Log:
Staging update by buildbot for mina

Modified:
    websites/staging/mina/trunk/content/   (props changed)
    
websites/staging/mina/trunk/content/mina-project/userguide/ch4-session/ch4-session.html

Propchange: websites/staging/mina/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Sep 20 21:53:45 2016
@@ -1 +1 @@
-1761541
+1761643

Modified: 
websites/staging/mina/trunk/content/mina-project/userguide/ch4-session/ch4-session.html
==============================================================================
--- 
websites/staging/mina/trunk/content/mina-project/userguide/ch4-session/ch4-session.html
 (original)
+++ 
websites/staging/mina/trunk/content/mina-project/userguide/ch4-session/ch4-session.html
 Tue Sep 20 21:53:45 2016
@@ -221,24 +221,26 @@ In other words, don't call session.read(
 <h2 id="opening-a-session">Opening a session<a class="headerlink" 
href="#opening-a-session" title="Permanent link">&para;</a></h2>
 <p>Actually, there is nothing you have to do : it's automatic ! Everytime a 
remote peer connect to a server, the server will create a new connection. On 
the client side, everytime you connect to a server, a session will be 
created.</p>
 <p>This session is passed as an argument to your handler, so that you can do 
something with it in your application. On the client side, when you do connect 
to a server, you can get back the created session this way :</p>
-<p>:::java
-    ...
-    ConnectFuture connectionFuture = connector.connect(address);
-    connectionFuture.awaitUninterruptibly();</p>
-<div class="codehilite"><pre><span class="k">if</span> <span 
class="p">(</span>!<span class="n">connectionFuture</span><span 
class="p">.</span><span class="n">isConnected</span><span class="p">())</span> 
<span class="p">{</span>
-    <span class="k">return</span> <span class="n">false</span><span 
class="p">;</span>
-<span class="p">}</span>
+<div class="codehilite"><pre><span class="o">...</span>
+<span class="n">ConnectFuture</span> <span class="n">connectionFuture</span> 
<span class="o">=</span> <span class="n">connector</span><span 
class="o">.</span><span class="na">connect</span><span class="o">(</span><span 
class="n">address</span><span class="o">);</span>
+<span class="n">connectionFuture</span><span class="o">.</span><span 
class="na">awaitUninterruptibly</span><span class="o">();</span>
 
-<span class="n">session</span> <span class="p">=</span> <span 
class="n">connectionFuture</span><span class="p">.</span><span 
class="n">getSession</span><span class="p">();</span>
-<span class="p">...</span>
+<span class="k">if</span> <span class="o">(!</span><span 
class="n">connectionFuture</span><span class="o">.</span><span 
class="na">isConnected</span><span class="o">())</span> <span class="o">{</span>
+    <span class="k">return</span> <span class="kc">false</span><span 
class="o">;</span>
+<span class="o">}</span>
+
+<span class="n">session</span> <span class="o">=</span> <span 
class="n">connectionFuture</span><span class="o">.</span><span 
class="na">getSession</span><span class="o">();</span>
+<span class="o">...</span>
 </pre></div>
 
 
 <p>You can also do it in a shortest way :</p>
-<p>:::java
-    ...
-    session = connector.connect(address).getSession();
-    ...</p>
+<div class="codehilite"><pre><span class="o">...</span>
+<span class="n">session</span> <span class="o">=</span> <span 
class="n">connector</span><span class="o">.</span><span 
class="na">connect</span><span class="o">(</span><span 
class="n">address</span><span class="o">).</span><span 
class="na">getSession</span><span class="o">();</span>
+<span class="o">...</span>
+</pre></div>
+
+
 <h2 id="initialization">Initialization<a class="headerlink" 
href="#initialization" title="Permanent link">&para;</a></h2>
 <p>When a new session is created, it has to be initialized. This is done using 
the default IoService configuration, bt you can update this configuration later 
on. Actually, when the session is created, we internally create a copy of the 
default IoService configuration that is stored within the session, and this is 
this configuration instance that will be used (and that can be modified).</p>
 <p>This initialization will also starts the statistics counters, create the 
Attributes container, associate a write queue to to the session (this is where 
the messages will be enqueued until they have been sent), and ultimately, would 
you have provided a specific task to do during this phase, it will call it.</p>
@@ -305,17 +307,15 @@ Be aware that if the remote peer is not
 
 
 <p>and here is the factory interface we can implement if we want to define 
another kind of container :</p>
-<div class="codehilite"><pre>public interface IoSessionDataStructureFactory {
-    /**
-     * Returns an {@link IoSessionAttributeMap} which is going to be associated
-     * with the specified <span class="nt">&lt;tt&gt;</span>session<span 
class="nt">&lt;/tt&gt;</span>.  Please note that the returned
-     * implementation must be thread-safe.
-     */
-     IoSessionAttributeMap getAttributeMap(IoSession session) throws Exception;
- }
-</pre></div>
-
-
+<p>:::java
+    public interface IoSessionDataStructureFactory {
+        /*<em>
+         * Returns an {@link IoSessionAttributeMap} which is going to be 
associated
+         * with the specified <tt>session</tt>.  Please note that the returned
+         * implementation must be thread-safe.
+         </em>/
+         IoSessionAttributeMap getAttributeMap(IoSession session) throws 
Exception;
+     }</p>
 <h3 id="the-session-attributes-access">The session attributes access<a 
class="headerlink" href="#the-session-attributes-access" title="Permanent 
link">&para;</a></h3>
 <p>There are many methods available to manipulate the session's attributes 
:</p>
 <ul>


Reply via email to