blob: e2c74d86b7c6d5f885cebdd54d1262768278c095 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_22) on Tue Sep 18 20:44:15 GMT+01:00 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
IOSession (HttpComponents Core 4.2.2 API)
</TITLE>
<META NAME="keywords" CONTENT="org.apache.http.nio.reactor.IOSession interface">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="IOSession (HttpComponents Core 4.2.2 API)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" 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_top_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>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/IOSession.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/http/nio/reactor/IOReactorStatus.html" title="enum in org.apache.http.nio.reactor"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/http/nio/reactor/ListenerEndpoint.html" title="interface in org.apache.http.nio.reactor"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/http/nio/reactor/IOSession.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="IOSession.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.http.nio.reactor</FONT>
<BR>
Interface IOSession</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../../org/apache/http/impl/nio/reactor/IOSessionImpl.html" title="class in org.apache.http.impl.nio.reactor">IOSessionImpl</A>, <A HREF="../../../../../org/apache/http/nio/reactor/ssl/SSLIOSession.html" title="class in org.apache.http.nio.reactor.ssl">SSLIOSession</A>, <A HREF="../../../../../org/apache/http/impl/nio/reactor/SSLIOSession.html" title="class in org.apache.http.impl.nio.reactor">SSLIOSession</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>IOSession</B></DL>
</PRE>
<P>
IOSession interface represents a sequence of logically related data exchanges
between two end points.
<p>
The channel associated with implementations of this interface can be used to
read data from and write data to the session.
<p>
I/O sessions are not bound to an execution thread, therefore one cannot use
the context of the thread to store a session's state. All details about
a particular session must be stored within the session itself, usually
using execution context associated with it.
<p>
Implementations of this interface are expected to be threading safe.
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>4.0</DD>
</DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#ACTIVE">ACTIVE</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#ATTACHMENT_KEY">ATTACHMENT_KEY</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name of the context attribute key, which can be used to obtain the
session attachment object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#CLOSED">CLOSED</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#CLOSING">CLOSING</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/ByteChannel.html" title="class or interface in java.nio.channels">ByteChannel</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#channel()">channel</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the underlying I/O channel associated with this session.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#clearEvent(int)">clearEvent</A></B>(int&nbsp;op)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clears interest in a particular I/O event type by updating the event
mask associated with the session.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#close()">close</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Terminates the session gracefully and closes the underlying I/O channel.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#getAttribute(java.lang.String)">getAttribute</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;name)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the value of the attribute with the given name.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#getEventMask()">getEventMask</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns mask of I/O evens this session declared interest in.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/SocketAddress.html" title="class or interface in java.net">SocketAddress</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#getLocalAddress()">getLocalAddress</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns local address.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/SocketAddress.html" title="class or interface in java.net">SocketAddress</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#getRemoteAddress()">getRemoteAddress</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns address of the remote peer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#getSocketTimeout()">getSocketTimeout</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns value of the socket timeout in milliseconds.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#getStatus()">getStatus</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns status of the session:</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#hasBufferedInput()">hasBufferedInput</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determines if the input buffer associated with the session contains data.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#hasBufferedOutput()">hasBufferedOutput</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determines if the output buffer associated with the session contains
data.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#isClosed()">isClosed</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determines if the session has been terminated.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#removeAttribute(java.lang.String)">removeAttribute</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;name)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes attribute with the given name.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#setAttribute(java.lang.String, java.lang.Object)">setAttribute</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;name,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;obj)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method can be used to associate a particular object with the
session by the given attribute name.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#setBufferStatus(org.apache.http.nio.reactor.SessionBufferStatus)">setBufferStatus</A></B>(<A HREF="../../../../../org/apache/http/nio/reactor/SessionBufferStatus.html" title="interface in org.apache.http.nio.reactor">SessionBufferStatus</A>&nbsp;status)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Quite often I/O sessions need to maintain internal I/O buffers in order
to transform input / output data prior to returning it to the consumer or
writing it to the underlying channel.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#setEvent(int)">setEvent</A></B>(int&nbsp;op)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Declares interest in a particular I/O event type by updating the event
mask associated with the session.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#setEventMask(int)">setEventMask</A></B>(int&nbsp;ops)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Declares interest in I/O event notifications by setting the event mask
associated with the session</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#setSocketTimeout(int)">setSocketTimeout</A></B>(int&nbsp;timeout)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets value of the socket timeout in milliseconds.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#shutdown()">shutdown</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Terminates the session by shutting down the underlying I/O channel.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="ATTACHMENT_KEY"><!-- --></A><H3>
ATTACHMENT_KEY</H3>
<PRE>
static final <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>ATTACHMENT_KEY</B></PRE>
<DL>
<DD>Name of the context attribute key, which can be used to obtain the
session attachment object.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.http.nio.reactor.IOSession.ATTACHMENT_KEY">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="ACTIVE"><!-- --></A><H3>
ACTIVE</H3>
<PRE>
static final int <B>ACTIVE</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.http.nio.reactor.IOSession.ACTIVE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="CLOSING"><!-- --></A><H3>
CLOSING</H3>
<PRE>
static final int <B>CLOSING</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.http.nio.reactor.IOSession.CLOSING">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="CLOSED"><!-- --></A><H3>
CLOSED</H3>
<PRE>
static final int <B>CLOSED</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.http.nio.reactor.IOSession.CLOSED">Constant Field Values</A></DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="channel()"><!-- --></A><H3>
channel</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/ByteChannel.html" title="class or interface in java.nio.channels">ByteChannel</A> <B>channel</B>()</PRE>
<DL>
<DD>Returns the underlying I/O channel associated with this session.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the I/O channel.</DL>
</DD>
</DL>
<HR>
<A NAME="getRemoteAddress()"><!-- --></A><H3>
getRemoteAddress</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/SocketAddress.html" title="class or interface in java.net">SocketAddress</A> <B>getRemoteAddress</B>()</PRE>
<DL>
<DD>Returns address of the remote peer.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>socket address.</DL>
</DD>
</DL>
<HR>
<A NAME="getLocalAddress()"><!-- --></A><H3>
getLocalAddress</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/net/SocketAddress.html" title="class or interface in java.net">SocketAddress</A> <B>getLocalAddress</B>()</PRE>
<DL>
<DD>Returns local address.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>socket address.</DL>
</DD>
</DL>
<HR>
<A NAME="getEventMask()"><!-- --></A><H3>
getEventMask</H3>
<PRE>
int <B>getEventMask</B>()</PRE>
<DL>
<DD>Returns mask of I/O evens this session declared interest in.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>I/O event mask.</DL>
</DD>
</DL>
<HR>
<A NAME="setEventMask(int)"><!-- --></A><H3>
setEventMask</H3>
<PRE>
void <B>setEventMask</B>(int&nbsp;ops)</PRE>
<DL>
<DD>Declares interest in I/O event notifications by setting the event mask
associated with the session
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>ops</CODE> - new I/O event mask.</DL>
</DD>
</DL>
<HR>
<A NAME="setEvent(int)"><!-- --></A><H3>
setEvent</H3>
<PRE>
void <B>setEvent</B>(int&nbsp;op)</PRE>
<DL>
<DD>Declares interest in a particular I/O event type by updating the event
mask associated with the session.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>op</CODE> - I/O event type.</DL>
</DD>
</DL>
<HR>
<A NAME="clearEvent(int)"><!-- --></A><H3>
clearEvent</H3>
<PRE>
void <B>clearEvent</B>(int&nbsp;op)</PRE>
<DL>
<DD>Clears interest in a particular I/O event type by updating the event
mask associated with the session.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>op</CODE> - I/O event type.</DL>
</DD>
</DL>
<HR>
<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
void <B>close</B>()</PRE>
<DL>
<DD>Terminates the session gracefully and closes the underlying I/O channel.
This method ensures that session termination handshake, such as the one
used by the SSL/TLS protocol, is correctly carried out.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="shutdown()"><!-- --></A><H3>
shutdown</H3>
<PRE>
void <B>shutdown</B>()</PRE>
<DL>
<DD>Terminates the session by shutting down the underlying I/O channel.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getStatus()"><!-- --></A><H3>
getStatus</H3>
<PRE>
int <B>getStatus</B>()</PRE>
<DL>
<DD>Returns status of the session:
<p>
<A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#ACTIVE"><CODE>ACTIVE</CODE></A>: session is active.
<p>
<A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#CLOSING"><CODE>CLOSING</CODE></A>: session is being closed.
<p>
<A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#CLOSED"><CODE>CLOSED</CODE></A>: session has been terminated.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>session status.</DL>
</DD>
</DL>
<HR>
<A NAME="isClosed()"><!-- --></A><H3>
isClosed</H3>
<PRE>
boolean <B>isClosed</B>()</PRE>
<DL>
<DD>Determines if the session has been terminated.
<P>
<DD><DL>
<DT><B>Returns:</B><DD><code>true</code> if the session has been terminated,
<code>false</code> otherwise.</DL>
</DD>
</DL>
<HR>
<A NAME="getSocketTimeout()"><!-- --></A><H3>
getSocketTimeout</H3>
<PRE>
int <B>getSocketTimeout</B>()</PRE>
<DL>
<DD>Returns value of the socket timeout in milliseconds. The value of
<code>0</code> signifies the session cannot time out.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>socket timeout.</DL>
</DD>
</DL>
<HR>
<A NAME="setSocketTimeout(int)"><!-- --></A><H3>
setSocketTimeout</H3>
<PRE>
void <B>setSocketTimeout</B>(int&nbsp;timeout)</PRE>
<DL>
<DD>Sets value of the socket timeout in milliseconds. The value of
<code>0</code> signifies the session cannot time out.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>timeout</CODE> - socket timeout.</DL>
</DD>
</DL>
<HR>
<A NAME="setBufferStatus(org.apache.http.nio.reactor.SessionBufferStatus)"><!-- --></A><H3>
setBufferStatus</H3>
<PRE>
void <B>setBufferStatus</B>(<A HREF="../../../../../org/apache/http/nio/reactor/SessionBufferStatus.html" title="interface in org.apache.http.nio.reactor">SessionBufferStatus</A>&nbsp;status)</PRE>
<DL>
<DD>Quite often I/O sessions need to maintain internal I/O buffers in order
to transform input / output data prior to returning it to the consumer or
writing it to the underlying channel. Memory management in HttpCore NIO
is based on the fundamental principle that the data consumer can read
only as much input data as it can process without having to allocate more
memory. That means, quite often some input data may remain unread in one
of the internal or external session buffers. The I/O reactor can query
the status of these session buffers, and make sure the consumer gets
notified correctly as more data gets stored in one of the session
buffers, thus allowing the consumer to read the remaining data once it
is able to process it
<p>
I/O sessions can be made aware of the status of external session buffers
using the <A HREF="../../../../../org/apache/http/nio/reactor/SessionBufferStatus.html" title="interface in org.apache.http.nio.reactor"><CODE>SessionBufferStatus</CODE></A> interface.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>status</CODE> - </DL>
</DD>
</DL>
<HR>
<A NAME="hasBufferedInput()"><!-- --></A><H3>
hasBufferedInput</H3>
<PRE>
boolean <B>hasBufferedInput</B>()</PRE>
<DL>
<DD>Determines if the input buffer associated with the session contains data.
<P>
<DD><DL>
<DT><B>Returns:</B><DD><code>true</code> if the session input buffer contains data,
<code>false</code> otherwise.</DL>
</DD>
</DL>
<HR>
<A NAME="hasBufferedOutput()"><!-- --></A><H3>
hasBufferedOutput</H3>
<PRE>
boolean <B>hasBufferedOutput</B>()</PRE>
<DL>
<DD>Determines if the output buffer associated with the session contains
data.
<P>
<DD><DL>
<DT><B>Returns:</B><DD><code>true</code> if the session output buffer contains data,
<code>false</code> otherwise.</DL>
</DD>
</DL>
<HR>
<A NAME="setAttribute(java.lang.String, java.lang.Object)"><!-- --></A><H3>
setAttribute</H3>
<PRE>
void <B>setAttribute</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;name,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;obj)</PRE>
<DL>
<DD>This method can be used to associate a particular object with the
session by the given attribute name.
<p>
I/O sessions are not bound to an execution thread, therefore one cannot
use the context of the thread to store a session's state. All details
about a particular session must be stored within the session itself.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - name of the attribute.<DD><CODE>obj</CODE> - value of the attribute.</DL>
</DD>
</DL>
<HR>
<A NAME="getAttribute(java.lang.String)"><!-- --></A><H3>
getAttribute</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getAttribute</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;name)</PRE>
<DL>
<DD>Returns the value of the attribute with the given name. The value can be
<code>null</code> if not set.
<p>
The value of the session attachment object can be obtained using
<A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#ATTACHMENT_KEY"><CODE>ATTACHMENT_KEY</CODE></A> name.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - name of the attribute.
<DT><B>Returns:</B><DD>value of the attribute.<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#setAttribute(java.lang.String, java.lang.Object)"><CODE>setAttribute(String, Object)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="removeAttribute(java.lang.String)"><!-- --></A><H3>
removeAttribute</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>removeAttribute</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;name)</PRE>
<DL>
<DD>Removes attribute with the given name.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - name of the attribute to be removed.
<DT><B>Returns:</B><DD>value of the removed attribute.<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/http/nio/reactor/IOSession.html#setAttribute(java.lang.String, java.lang.Object)"><CODE>setAttribute(String, Object)</CODE></A></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>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/IOSession.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/http/nio/reactor/IOReactorStatus.html" title="enum in org.apache.http.nio.reactor"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/http/nio/reactor/ListenerEndpoint.html" title="interface in org.apache.http.nio.reactor"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/http/nio/reactor/IOSession.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="IOSession.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &#169; 2005-2012 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>