|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mortbay.io.nio.ChannelEndPoint org.mortbay.io.nio.SelectChannelEndPoint
public class SelectChannelEndPoint
An Endpoint that can be scheduled by SelectorManager
.
Nested Class Summary | |
---|---|
class |
SelectChannelEndPoint.IdleTask
|
Field Summary | |
---|---|
protected Connection |
_connection
|
protected boolean |
_dispatched
|
protected int |
_interestOps
|
protected SelectionKey |
_key
|
protected SelectorManager |
_manager
|
protected boolean |
_readBlocked
|
protected SelectorManager.SelectSet |
_selectSet
|
protected boolean |
_writable
|
protected boolean |
_writeBlocked
|
Fields inherited from class org.mortbay.io.nio.ChannelEndPoint |
---|
_channel, _gather2, _gather3, _local, _remote, _socket |
Constructor Summary | |
---|---|
SelectChannelEndPoint(SocketChannel channel,
SelectorManager.SelectSet selectSet,
SelectionKey key)
|
Method Summary | |
---|---|
boolean |
blockReadable(long timeoutMs)
|
boolean |
blockWritable(long timeoutMs)
|
void |
cancelIdle()
|
void |
close()
Close any backing stream associated with the buffer |
boolean |
dispatch(boolean assumeShortDispatch)
Put the endpoint into the dispatched state. |
int |
flush(Buffer buffer)
Flush the buffer from the current getIndex to it's putIndex using whatever byte sink is backing the buffer. |
int |
flush(Buffer header,
Buffer buffer,
Buffer trailer)
Flush the buffer from the current getIndex to it's putIndex using whatever byte sink is backing the buffer. |
Connection |
getConnection()
|
SelectorManager.SelectSet |
getSelectSet()
|
Timeout.Task |
getTimeoutTask()
|
protected void |
idleExpired()
|
boolean |
isOpen()
|
void |
run()
|
void |
scheduleIdle()
|
void |
syncKey()
Synchronize the interestOps with the actual key. |
String |
toString()
|
void |
undispatch()
Called when a dispatched thread is no longer handling the endpoint. |
Methods inherited from class org.mortbay.io.nio.ChannelEndPoint |
---|
fill, flush, getChannel, getLocalAddr, getLocalHost, getLocalPort, getRemoteAddr, getRemoteHost, getRemotePort, getTransport, isBlocking, isBufferingInput, isBufferingOutput, isBufferred |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected SelectorManager _manager
protected SelectorManager.SelectSet _selectSet
protected boolean _dispatched
protected boolean _writable
protected SelectionKey _key
protected int _interestOps
protected boolean _readBlocked
protected boolean _writeBlocked
protected Connection _connection
Constructor Detail |
---|
public SelectChannelEndPoint(SocketChannel channel, SelectorManager.SelectSet selectSet, SelectionKey key)
Method Detail |
---|
public Connection getConnection()
public boolean dispatch(boolean assumeShortDispatch) throws IOException
assumeShortDispatch
- If true, the interested ops are not modified.
IOException
public void scheduleIdle()
public void cancelIdle()
protected void idleExpired()
public void undispatch()
public int flush(Buffer header, Buffer buffer, Buffer trailer) throws IOException
EndPoint
flush
in interface EndPoint
flush
in class ChannelEndPoint
header
- A buffer to write before flushing this buffer. This buffers getIndex is updated.buffer
- The buffer to flush. This buffers getIndex is updated.trailer
- A buffer to write after flushing this buffer. This buffers getIndex is updated.
IOException
public int flush(Buffer buffer) throws IOException
EndPoint
flush
in interface EndPoint
flush
in class ChannelEndPoint
buffer
- The buffer to flush. This buffers getIndex is updated.
IOException
public boolean isOpen()
isOpen
in interface EndPoint
isOpen
in class ChannelEndPoint
public boolean blockReadable(long timeoutMs) throws IOException
blockReadable
in interface EndPoint
blockReadable
in class ChannelEndPoint
IOException
public boolean blockWritable(long timeoutMs) throws IOException
blockWritable
in interface EndPoint
blockWritable
in class ChannelEndPoint
IOException
public void syncKey()
public void run()
run
in interface Runnable
public void close() throws IOException
EndPoint
close
in interface EndPoint
close
in class ChannelEndPoint
IOException
public String toString()
toString
in class Object
public Timeout.Task getTimeoutTask()
public SelectorManager.SelectSet getSelectSet()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |