|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.pool.RecyclableSupport
org.norther.tammi.core.pool.PoolableSupport
org.norther.tammi.spray.connector.chain.AbstractConnection
org.norther.tammi.spray.connector.chain.ChannelConnection
public class ChannelConnection
A connection through a non-blocking socket channel registered with the specified key.
| Field Summary |
|---|
| Fields inherited from interface org.norther.tammi.spray.connector.chain.Connection |
|---|
BUSY, DONE, IDLE, IN_QUEUE, INITIAL |
| Constructor Summary | |
|---|---|
ChannelConnection(MBeanReference connector,
MBeanReference filter,
MBeanReference logger,
MBeanReference timeout,
Thread thread,
SelectionKey key,
Channel channel)
Constructs a new connection. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this connection and stops execution. |
void |
dispose()
Disposes the object by setting its disposed flag. |
int |
filter()
Filters the request of this connection. |
int |
getByteCount()
Gets the number of bytes written to this connection. |
Channel |
getChannel()
Gets the channel of this connection. |
Certificate[] |
getPeerCertificates()
Gets the client certificate chain, if available. |
String |
getRemoteAddr()
Gets the remote address of this connection. |
int |
getRemotePort()
Gets the remote port of this connection. |
ServletRequest |
getRequest()
Gets of the request of this connection. |
ServletResponse |
getResponse()
Gets of the response of this connection. |
SelectionKey |
getSelectionKey()
Gets the selection key of this connection. |
boolean |
keepConnection()
Keeps this connection alive in idle after processing request processing if applicable. |
void |
recycle(MBeanReference connector,
MBeanReference filter,
MBeanReference logger,
MBeanReference timeout,
Thread thread,
SelectionKey key,
Channel channel)
Recycles an existing connection. |
void |
setReadyOps(int ops)
Sets the ready operations set of this connection. |
String |
toString()
|
| Methods inherited from class org.norther.tammi.spray.connector.chain.AbstractConnection |
|---|
connected, disposed, getConnectionStatus, getConnectionTime, getConnectionTimeout, getConnector, getFilter, getLogger, getMBeanServer, getReadyOps, getRequestTimeout, getTimeout, isContextThread, isKeepConnection, log, recycle, run, waitUntilDone |
| Methods inherited from class org.norther.tammi.core.pool.PoolableSupport |
|---|
recycled |
| Methods inherited from class org.norther.tammi.core.pool.RecyclableSupport |
|---|
isDisposed, recycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.core.pool.Recyclable |
|---|
isDisposed, recycle |
| Constructor Detail |
|---|
public ChannelConnection(MBeanReference connector,
MBeanReference filter,
MBeanReference logger,
MBeanReference timeout,
Thread thread,
SelectionKey key,
Channel channel)
connector - the socket connector.filter - the active filter.logger - the active logger.timeout - the active timeout.thread - the connector thread.key - the selection key.channel - the channel.| Method Detail |
|---|
public void recycle(MBeanReference connector,
MBeanReference filter,
MBeanReference logger,
MBeanReference timeout,
Thread thread,
SelectionKey key,
Channel channel)
connector - the socket connector.filter - the active filter.logger - the active logger.timeout - the active timeout.thread - the connector thread.key - the selection key.channel - the channel.public void dispose()
RecyclableSupport
dispose in interface Recyclabledispose in class AbstractConnectionpublic void setReadyOps(int ops)
ConnectionNote that this method must be thread safe and not causing deadlocks as it may be called by several threads during channel selections.
setReadyOps in interface ConnectionsetReadyOps in class AbstractConnectionops - the operations set as a bit mask.public boolean keepConnection()
Connection
keepConnection in interface ConnectionkeepConnection in class AbstractConnectionpublic int getByteCount()
Connection
public int getRemotePort()
Connection
public String getRemoteAddr()
Connection
public ServletRequest getRequest()
Connection
public ServletResponse getResponse()
Connection
public Certificate[] getPeerCertificates()
Connection
public int filter()
throws ServletException,
IOException
Connection
ServletException - for servlet errors.
IOException - for general errors.public void close()
ConnectionNote that this method must be thread safe and not causing deadlocks as it may be called by several threads during timeouts.
close in interface Closeableclose in interface Connectionclose in class AbstractConnectionpublic String toString()
toString in class Objectpublic SelectionKey getSelectionKey()
public Channel getChannel()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||