|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glassfish.grizzly.nio.NIOConnection
org.glassfish.grizzly.nio.transport.TCPNIOConnection
public class TCPNIOConnection
Connection
implementation
for the TCPNIOTransport
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.glassfish.grizzly.Connection |
---|
Connection.CloseListener, Connection.CloseType |
Field Summary |
---|
Fields inherited from class org.glassfish.grizzly.nio.NIOConnection |
---|
asyncReadQueue, asyncWriteQueue, attributes, channel, closeTypeFlag, connectCloseSemaphor, isBlocking, isStandalone, maxAsyncWriteQueueSize, monitoringConfig, NOTIFICATION_CLOSED_COMPLETE, NOTIFICATION_INITIALIZED, processor, processorSelector, readBufferSize, readTimeoutMillis, selectionKey, selectorRunner, transport, writeBufferSize, writeTimeoutMillis, zeroByteReadCount |
Constructor Summary | |
---|---|
TCPNIOConnection(TCPNIOTransport transport,
SelectableChannel channel)
|
Method Summary | |
---|---|
protected void |
checkConnectFailed(Throwable failure)
Method will be called in order to check if failure happened before Connection was reported as connected. |
protected void |
close0(CompletionHandler<Connection> completionHandler,
boolean isClosedLocally)
|
SocketAddress |
getLocalAddress()
Returns the local address of this Connection, or null if it is unconnected. |
SocketAddress |
getPeerAddress()
Returns the address of the endpoint this Connection is connected to, or null if it is unconnected. |
protected boolean |
notifyReady()
|
protected void |
onConnect()
Method will be called, when the connection gets connected. |
protected void |
onRead(Buffer data,
int size)
Method will be called, when some data was read on the connection |
protected void |
onWrite(Buffer data,
long size)
Method will be called, when some data was written on the connection |
protected void |
preClose()
|
protected void |
resetProperties()
|
protected void |
setConnectCompletionHandler(CompletionHandler<Connection> connectHandler)
|
void |
setReadBufferSize(int readBufferSize)
Set the default size of Buffer s, which will be allocated for
reading data from Connection . |
protected void |
setSelectionKey(SelectionKey selectionKey)
|
protected void |
setSelectorRunner(SelectorRunner selectorRunner)
|
void |
setWriteBufferSize(int writeBufferSize)
Set the default size of Buffer s, which will be allocated for
writing data to Connection . |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TCPNIOConnection(TCPNIOTransport transport, SelectableChannel channel)
Method Detail |
---|
protected void setSelectionKey(SelectionKey selectionKey)
setSelectionKey
in class NIOConnection
protected void setSelectorRunner(SelectorRunner selectorRunner)
setSelectorRunner
in class NIOConnection
protected void preClose()
preClose
in class NIOConnection
protected boolean notifyReady()
public SocketAddress getPeerAddress()
public SocketAddress getLocalAddress()
protected final void resetProperties()
public void setReadBufferSize(int readBufferSize)
Connection
Buffer
s, which will be allocated for
reading data from Connection
.
setReadBufferSize
in interface Connection<SocketAddress>
setReadBufferSize
in class NIOConnection
readBufferSize
- the default size of Buffer
s, which will
be allocated for reading data from Connection
.public void setWriteBufferSize(int writeBufferSize)
Connection
Buffer
s, which will be allocated for
writing data to Connection
.
setWriteBufferSize
in interface Connection<SocketAddress>
setWriteBufferSize
in class NIOConnection
writeBufferSize
- the default size of Buffer
s, which will
be allocated for writing data to Connection
.protected final void setConnectCompletionHandler(CompletionHandler<Connection> connectHandler)
protected final void onConnect() throws IOException
IOException
protected final void checkConnectFailed(Throwable failure)
Connection
was reported as connected.
IOException
protected void close0(CompletionHandler<Connection> completionHandler, boolean isClosedLocally)
close0
in class NIOConnection
protected final void onRead(Buffer data, int size)
protected final void onWrite(Buffer data, long size)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |