You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by el...@apache.org on 2016/09/20 21:53:39 UTC
svn commit: r1761643 -
/mina/site/trunk/content/mina-project/userguide/ch4-session/ch4-session.mdtext
Author: elecharny
Date: Tue Sep 20 21:53:39 2016
New Revision: 1761643
URL: http://svn.apache.org/viewvc?rev=1761643&view=rev
Log:
Fixed the formating
Modified:
mina/site/trunk/content/mina-project/userguide/ch4-session/ch4-session.mdtext
Modified: mina/site/trunk/content/mina-project/userguide/ch4-session/ch4-session.mdtext
URL: http://svn.apache.org/viewvc/mina/site/trunk/content/mina-project/userguide/ch4-session/ch4-session.mdtext?rev=1761643&r1=1761642&r2=1761643&view=diff
==============================================================================
--- mina/site/trunk/content/mina-project/userguide/ch4-session/ch4-session.mdtext (original)
+++ mina/site/trunk/content/mina-project/userguide/ch4-session/ch4-session.mdtext Tue Sep 20 21:53:39 2016
@@ -71,7 +71,7 @@ Actually, there is nothing you have to d
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 :
- :::java
+ :::java
...
ConnectFuture connectionFuture = connector.connect(address);
connectionFuture.awaitUninterruptibly();
@@ -85,7 +85,7 @@ This session is passed as an argument to
You can also do it in a shortest way :
- :::java
+ :::java
...
session = connector.connect(address).getSession();
...
@@ -151,7 +151,7 @@ It might be necessary to store some data
For instance, if you want to track the number of request a user has sent since the session has been created, it's easy to store it into this map: just create a key that will be associated with this value.
- :::java
+ :::java
...
int counterValue = session.getAttribute( "counter" );
session.setAttribute( "counter", counterValue + 1 );
@@ -185,6 +185,7 @@ This snippet of code shows how the conta
and here is the factory interface we can implement if we want to define another kind of container :
+ :::java
public interface IoSessionDataStructureFactory {
/**
* Returns an {@link IoSessionAttributeMap} which is going to be associated
@@ -210,6 +211,7 @@ There are many methods available to mani
* Object setAttributeIfAbsent(Object key) : adds a new attribute with no value, if it does not already exist
* Object setAttributeIfAbsent(Object key, Object value) : adds a new attribute/value pair, if it does not already exist
+
All those methods allows your application to store, remove, get or update the attributes stored into your session. Also note that some attributes are used internally by MINA : don't lightly modify those you didn't create !
## Filter chain