📄 iosessionattributemap.html
字号:
specified key. If there's no such attribute, the specified default value is associated with the specified key, and the default value is returned. This method is same with the following code except that the operation is performed atomically. <pre> if (containsAttribute(key)) { return getAttribute(key); } else { setAttribute(key, defaultValue); return defaultValue; } </pre><P><DD><DL></DL></DD></DL><HR><A NAME="setAttribute(org.apache.mina.common.IoSession, java.lang.Object, java.lang.Object)"><!-- --></A><H3>setAttribute</H3><PRE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>setAttribute</B>(<A HREF="../../../../org/apache/mina/common/IoSession.html" title="interface in org.apache.mina.common">IoSession</A> session, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> key, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> value)</PRE><DL><DD>Sets a user-defined attribute.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - the key of the attribute<DD><CODE>value</CODE> - the value of the attribute<DT><B>Returns:</B><DD>The old value of the attribute. <tt>null</tt> if it is new.</DL></DD></DL><HR><A NAME="setAttributeIfAbsent(org.apache.mina.common.IoSession, java.lang.Object, java.lang.Object)"><!-- --></A><H3>setAttributeIfAbsent</H3><PRE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>setAttributeIfAbsent</B>(<A HREF="../../../../org/apache/mina/common/IoSession.html" title="interface in org.apache.mina.common">IoSession</A> session, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> key, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> value)</PRE><DL><DD>Sets a user defined attribute if the attribute with the specified key is not set yet. This method is same with the following code except that the operation is performed atomically. <pre> if (containsAttribute(key)) { return getAttribute(key); } else { return setAttribute(key, value); } </pre><P><DD><DL></DL></DD></DL><HR><A NAME="removeAttribute(org.apache.mina.common.IoSession, java.lang.Object)"><!-- --></A><H3>removeAttribute</H3><PRE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>removeAttribute</B>(<A HREF="../../../../org/apache/mina/common/IoSession.html" title="interface in org.apache.mina.common">IoSession</A> session, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> key)</PRE><DL><DD>Removes a user-defined attribute with the specified key.<P><DD><DL><DT><B>Returns:</B><DD>The old value of the attribute. <tt>null</tt> if not found.</DL></DD></DL><HR><A NAME="removeAttribute(org.apache.mina.common.IoSession, java.lang.Object, java.lang.Object)"><!-- --></A><H3>removeAttribute</H3><PRE>boolean <B>removeAttribute</B>(<A HREF="../../../../org/apache/mina/common/IoSession.html" title="interface in org.apache.mina.common">IoSession</A> session, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> key, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> value)</PRE><DL><DD>Removes a user defined attribute with the specified key if the current attribute value is equal to the specified value. This method is same with the following code except that the operation is performed atomically. <pre> if (containsAttribute(key) && getAttribute(key).equals(value)) { removeAttribute(key); return true; } else { return false; } </pre><P><DD><DL></DL></DD></DL><HR><A NAME="replaceAttribute(org.apache.mina.common.IoSession, java.lang.Object, java.lang.Object, java.lang.Object)"><!-- --></A><H3>replaceAttribute</H3><PRE>boolean <B>replaceAttribute</B>(<A HREF="../../../../org/apache/mina/common/IoSession.html" title="interface in org.apache.mina.common">IoSession</A> session, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> key, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> oldValue, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> newValue)</PRE><DL><DD>Replaces a user defined attribute with the specified key if the value of the attribute is equals to the specified old value. This method is same with the following code except that the operation is performed atomically. <pre> if (containsAttribute(key) && getAttribute(key).equals(oldValue)) { setAttribute(key, newValue); return true; } else { return false; } </pre><P><DD><DL></DL></DD></DL><HR><A NAME="containsAttribute(org.apache.mina.common.IoSession, java.lang.Object)"><!-- --></A><H3>containsAttribute</H3><PRE>boolean <B>containsAttribute</B>(<A HREF="../../../../org/apache/mina/common/IoSession.html" title="interface in org.apache.mina.common">IoSession</A> session, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> key)</PRE><DL><DD>Returns <tt>true</tt> if this session contains the attribute with the specified <tt>key</tt>.<P><DD><DL></DL></DD></DL><HR><A NAME="getAttributeKeys(org.apache.mina.common.IoSession)"><!-- --></A><H3>getAttributeKeys</H3><PRE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A><<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>> <B>getAttributeKeys</B>(<A HREF="../../../../org/apache/mina/common/IoSession.html" title="interface in org.apache.mina.common">IoSession</A> session)</PRE><DL><DD>Returns the set of keys of all user-defined attributes.<P><DD><DL></DL></DD></DL><HR><A NAME="dispose(org.apache.mina.common.IoSession)"><!-- --></A><H3>dispose</H3><PRE>void <B>dispose</B>(<A HREF="../../../../org/apache/mina/common/IoSession.html" title="interface in org.apache.mina.common">IoSession</A> session) throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A></PRE><DL><DD>Disposes any releases associated with the specified session. This method is invoked on disconnection.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A></CODE></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/IoSessionAttributeMap.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../org/apache/mina/common/IoSession.html" title="interface in org.apache.mina.common"><B>PREV CLASS</B></A> <A HREF="../../../../org/apache/mina/common/IoSessionConfig.html" title="interface in org.apache.mina.common"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/apache/mina/common/IoSessionAttributeMap.html" target="_top"><B>FRAMES</B></A> <A HREF="IoSessionAttributeMap.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR>Copyright 漏 2004-2008 <a href="http://mina.apache.org/">Apache MINA Project</a>. All Rights Reserved.</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -