org.mortbay.io.nio
public class SelectChannelEndPoint extends ChannelEndPoint implements java.lang.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 java.nio.channels.SelectionKey |
_key |
protected SelectorManager |
_manager |
protected boolean |
_readBlocked |
protected SelectorManager.SelectSet |
_selectSet |
protected boolean |
_writable |
protected boolean |
_writeBlocked |
| Constructor and Description |
|---|
SelectChannelEndPoint(java.nio.channels.SocketChannel channel,
SelectorManager.SelectSet selectSet,
java.nio.channels.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) |
java.lang.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, shutdownOutputprotected SelectorManager _manager
protected SelectorManager.SelectSet _selectSet
protected boolean _dispatched
protected boolean _writable
protected java.nio.channels.SelectionKey _key
protected int _interestOps
protected boolean _readBlocked
protected boolean _writeBlocked
protected Connection _connection
public SelectChannelEndPoint(java.nio.channels.SocketChannel channel,
SelectorManager.SelectSet selectSet,
java.nio.channels.SelectionKey key)
public Connection getConnection()
public boolean dispatch(boolean assumeShortDispatch)
throws java.io.IOException
assumeShortDispatch - If true, the interested ops are not modified.java.io.IOExceptionpublic void scheduleIdle()
public void cancelIdle()
protected void idleExpired()
public void undispatch()
public int flush(Buffer header, Buffer buffer, Buffer trailer) throws java.io.IOException
EndPointflush in interface EndPointflush in class ChannelEndPointheader - 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.java.io.IOExceptionpublic int flush(Buffer buffer) throws java.io.IOException
EndPointflush in interface EndPointflush in class ChannelEndPointbuffer - The buffer to flush. This buffers getIndex is updated.java.io.IOExceptionpublic boolean blockReadable(long timeoutMs)
throws java.io.IOException
blockReadable in interface EndPointblockReadable in class ChannelEndPointjava.io.IOExceptionpublic boolean blockWritable(long timeoutMs)
throws java.io.IOException
blockWritable in interface EndPointblockWritable in class ChannelEndPointjava.io.IOExceptionpublic void setWritable(boolean writable)
public void scheduleWrite()
public void run()
run in interface java.lang.Runnablepublic void close()
throws java.io.IOException
EndPointclose in interface EndPointclose in class ChannelEndPointjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic org.mortbay.thread.Timeout.Task getTimeoutTask()
public SelectorManager.SelectSet getSelectSet()
Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.