org.glassfish.grizzly.nio.transport
Class TCPNIOServerConnection
java.lang.Object
org.glassfish.grizzly.nio.AbstractNIOConnection
org.glassfish.grizzly.nio.transport.TCPNIOConnection
org.glassfish.grizzly.nio.transport.TCPNIOServerConnection
- All Implemented Interfaces:
- Closeable, AttributeStorage, Connection<SocketAddress>, NIOConnection, Readable<SocketAddress>, Writable<SocketAddress>
public class TCPNIOServerConnection
- extends TCPNIOConnection
- Author:
- oleksiys
| Fields inherited from class org.glassfish.grizzly.nio.AbstractNIOConnection |
asyncReadQueue, asyncWriteQueue, attributes, channel, isBlocking, isClosed, processor, processorSelector, readBufferSize, selectionKey, selectorRunner, transport, writeBufferSize |
| Methods inherited from class org.glassfish.grizzly.nio.AbstractNIOConnection |
close, configureBlocking, disableIOEvent, enableIOEvent, getAsyncReadQueue, getAsyncWriteQueue, getAttributes, getChannel, getProcessor, getReadBufferSize, getSelectionKey, getSelectorRunner, getTransport, getWriteBufferSize, isBlocking, isOpen, obtainAttributes, read, read, read, setChannel, setProcessor, setProcessorSelector, setReadBufferSize, setWriteBufferSize, write, write, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TCPNIOServerConnection
public TCPNIOServerConnection(TCPNIOTransport transport,
ServerSocketChannel serverSocketChannel)
listen
public void listen()
throws IOException
- Throws:
IOException
getProcessorSelector
public ProcessorSelector getProcessorSelector()
- Description copied from interface:
Connection
- Gets the default
ProcessorSelector, which will be used to get
Processor to process Connection I/O events, in case if
this Connection's Processor is null.
- Specified by:
getProcessorSelector in interface Connection<SocketAddress>- Overrides:
getProcessorSelector in class AbstractNIOConnection
- Returns:
- the default
ProcessorSelector, which will be used to get
Processor to process Connection I/O events, in case if
this Connection's Processor is null.
accept
public Future<Connection> accept()
throws IOException
- Accept a
Connection
- Returns:
Future
- Throws:
IOException
acceptAsync
protected Future<Connection> acceptAsync()
throws IOException
- Asynchronously accept a
Connection
- Returns:
Future
- Throws:
IOException
tryAccept
protected boolean tryAccept()
throws IOException
- Check, if there are queued accept listeners. If yes - accept the
connection and notify listener, otherwise do nothing.
- Returns:
- true, if connection was accepted,
false otherwise.
- Throws:
IOException
preClose
public void preClose()
- Overrides:
preClose in class TCPNIOConnection
throwUnsupportReadWrite
protected void throwUnsupportReadWrite()
Copyright © 2009 SUN Microsystems. All Rights Reserved.