org.mortbay.io.nio
public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable
SelectorManager
.Modifier and Type | Class and Description |
---|---|
class |
SelectChannelEndPoint.IdleTask |
Modifier and Type | Field and Description |
---|---|
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 |
Constructor and Description |
---|
SelectChannelEndPoint(SocketChannel channel,
SelectorManager.SelectSet selectSet,
SelectionKey key) |
Modifier and Type | Method and Description |
---|---|
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() |
org.mortbay.thread.Timeout.Task |
getTimeoutTask() |
protected void |
idleExpired() |
void |
run() |
void |
scheduleIdle() |
void |
scheduleWrite() |
void |
setWritable(boolean writable) |
String |
toString() |
void |
undispatch()
Called when a dispatched thread is no longer handling the endpoint.
|
fill, flush, getChannel, getLocalAddr, getLocalHost, getLocalPort, getRemoteAddr, getRemoteHost, getRemotePort, getTransport, isBlocking, isBufferingInput, isBufferingOutput, isBufferred, isOpen, shutdownOutput
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
public SelectChannelEndPoint(SocketChannel channel, SelectorManager.SelectSet selectSet, SelectionKey key)
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 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 setWritable(boolean writable)
public void scheduleWrite()
public void close() throws IOException
EndPoint
close
in interface EndPoint
close
in class ChannelEndPoint
IOException
public org.mortbay.thread.Timeout.Task getTimeoutTask()
public SelectorManager.SelectSet getSelectSet()
Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.