|
||||||||||
| 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
public abstract class AbstractConnection
An abstact connection avoiding synchronized methods for performance reasons but trusts on atomic fields. So it can return stale values but that has been considered acceptable when the number of allowed connections is large.
| Field Summary |
|---|
| Fields inherited from interface org.norther.tammi.spray.connector.chain.Connection |
|---|
BUSY, DONE, IDLE, IN_QUEUE, INITIAL |
| Constructor Summary | |
|---|---|
AbstractConnection(MBeanReference connector,
MBeanReference filter,
MBeanReference logger,
MBeanReference timeout,
Thread thread)
Constructs a new client connection. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this connection and stops execution. |
void |
connected()
Sets the status of this connection to busy after idle. |
void |
dispose()
Disposes the object by setting its disposed flag. |
void |
disposed()
A call back indicating that this instance is not needed any more and can be disposed. |
int |
getConnectionStatus()
Gets the connection status of this connection. |
long |
getConnectionTime()
Gets the connection time of this connection. |
int |
getConnectionTimeout()
Gets the connection timeout of this connection. |
Connector |
getConnector()
Gets the connector of this connection. |
Filter |
getFilter()
Gets the filter of this connection. |
Logger |
getLogger()
Gets the logger of this connection. |
MBeanServer |
getMBeanServer()
Gets the MBean server of this connection. |
int |
getReadyOps()
Gets the ready operations set of this connection. |
int |
getRequestTimeout()
Gets the request timeout of this connection. |
Timeout |
getTimeout()
Gets the timer of this connection. |
boolean |
isContextThread()
Checks whether this connection executes in a connector context thread. |
boolean |
isKeepConnection()
Checks whether to keep this connection alive in idle after request processing. |
boolean |
keepConnection()
Keeps this connection alive in idle after processing request processing if applicable. |
void |
log()
Logs the request of this connection, if applicable |
void |
recycle(MBeanReference connector,
MBeanReference filter,
MBeanReference logger,
MBeanReference timeout,
Thread thread)
Recycles a client connection. |
void |
run()
|
void |
setReadyOps(int ops)
Sets the ready operations set of this connection. |
boolean |
waitUntilDone(int msecs)
Waits until this the execution of connection is done. |
| 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, toString, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.spray.connector.chain.Connection |
|---|
filter, getByteCount, getPeerCertificates, getRemoteAddr, getRemotePort, getRequest, getResponse |
| Methods inherited from interface org.norther.tammi.core.pool.Recyclable |
|---|
isDisposed, recycle |
| Constructor Detail |
|---|
public AbstractConnection(MBeanReference connector,
MBeanReference filter,
MBeanReference logger,
MBeanReference timeout,
Thread thread)
connector - the connector.filter - the filter.logger - the logger.timeout - the timeout.thread - the connector thread.| Method Detail |
|---|
public void recycle(MBeanReference connector,
MBeanReference filter,
MBeanReference logger,
MBeanReference timeout,
Thread thread)
connector - the connector.filter - the filter.logger - the logger.timeout - the timeout.thread - the connector thread.public void dispose()
RecyclableSupport
dispose in interface Recyclabledispose in class RecyclableSupportpublic void disposed()
Poolable
disposed in interface Poolabledisposed in class PoolableSupportpublic final void run()
run in interface Runnablepublic Connector getConnector()
Connection
getConnector in interface Connectionpublic Filter getFilter()
Connection
getFilter in interface Connectionpublic Logger getLogger()
Connection
getLogger in interface Connectionpublic Timeout getTimeout()
Connection
getTimeout in interface Connectionpublic MBeanServer getMBeanServer()
Connection
getMBeanServer in interface Connectionpublic boolean isContextThread()
Connection
isContextThread in interface Connectionpublic int getConnectionStatus()
Connection
getConnectionStatus in interface Connectionpublic long getConnectionTime()
Connection
getConnectionTime in interface Connectionpublic void connected()
Connection
connected in interface Connectionpublic int getRequestTimeout()
Connection
getRequestTimeout in interface Connectionpublic int getConnectionTimeout()
Connection
getConnectionTimeout in interface Connectionpublic int getReadyOps()
Connection
getReadyOps in interface Connectionpublic 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 Connectionops - the operations set as a bit mask.public boolean isKeepConnection()
Connection
isKeepConnection in interface Connectionpublic boolean keepConnection()
Connection
keepConnection in interface Connectionpublic boolean waitUntilDone(int msecs)
Connection
waitUntilDone in interface Connectionmsecs - a timeout to wait in msecs.
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 Connectionpublic void log()
Connection
log in interface Connection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||