Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » cluster » tcp » [javadoc | source]
org.apache.catalina.cluster.tcp
public class: FastAsyncSocketSender [javadoc | source]
java.lang.Object
   org.apache.catalina.cluster.tcp.DataSender
      org.apache.catalina.cluster.tcp.FastAsyncSocketSender

All Implemented Interfaces:
    IDataSender

Send cluster messages from a Message queue with only one socket. Ack and keep Alive Handling is supported. Fast Queue can limit queue size and consume all messages at queue at one block.
Limit the queue lock contention under high load!
FIXME: refactor code duplications with AsyncSocketSender => configurable or extract super class
Fields inherited from org.apache.catalina.cluster.tcp.DataSender:
sm,  nrOfRequests,  totalBytes,  connectCounter,  disconnectCounter,  missingAckCounter,  dataResendCounter,  dataFailureCounter,  doProcessingStats,  processingTime,  minProcessingTime,  maxProcessingTime,  doWaitAckStats,  waitAckTime,  minWaitAckTime,  maxWaitAckTime,  keepAliveConnectTime,  keepAliveCount
Constructor:
 public FastAsyncSocketSender(String domain,
    InetAddress host,
    int port) 
    start background thread to push incomming cluster messages to replication node
    Parameters:
    domain - replication cluster domain (session domain)
    host - replication node tcp address
    port - replication node tcp port
Method from org.apache.catalina.cluster.tcp.FastAsyncSocketSender Summary:
checkThread,   connect,   disconnect,   getInQueueCounter,   getInfo,   getMaxQueueLength,   getOutQueueCounter,   getQueueAddWaitTime,   getQueueAddWaitTimeout,   getQueueRemoveWaitTime,   getQueueRemoveWaitTimeout,   getQueueSize,   getQueuedNrOfBytes,   getThreadPriority,   isQueueCheckLock,   isQueueDoStats,   isQueueTimeWait,   resetStatistics,   sendMessage,   setMaxQueueLength,   setQueueAddWaitTimeout,   setQueueCheckLock,   setQueueDoStats,   setQueueTimeWait,   setRemoveWaitTimeout,   setThreadPriority,   stopThread,   toString
Methods from org.apache.catalina.cluster.tcp.DataSender:
addProcessingStats,   addStats,   addWaitAckStats,   checkKeepAlive,   closeSocket,   connect,   createSocket,   disconnect,   getAckTimeout,   getAddress,   getAvgMessageSize,   getAvgProcessingTime,   getAvgWaitAckTime,   getConnectCounter,   getDataFailureCounter,   getDataResendCounter,   getDisconnectCounter,   getDomain,   getInfo,   getKeepAliveConnectTime,   getKeepAliveCount,   getKeepAliveMaxRequestCount,   getKeepAliveTimeout,   getMaxProcessingTime,   getMaxWaitAckTime,   getMinProcessingTime,   getMinWaitAckTime,   getMissingAckCounter,   getNrOfRequests,   getPort,   getProcessingTime,   getSocket,   getSocketCloseCounter,   getSocketOpenCounter,   getSocketOpenFailureCounter,   getSuspect,   getTotalBytes,   getWaitAckTime,   isConnected,   isDoProcessingStats,   isDoWaitAckStats,   isMessageTransferStarted,   isResend,   isSuspect,   isWaitForAck,   openSocket,   pushMessage,   resetStatistics,   sendMessage,   setAckTimeout,   setAddress,   setDoProcessingStats,   setDoWaitAckStats,   setDomain,   setKeepAliveMaxRequestCount,   setKeepAliveTimeout,   setPort,   setResend,   setSocket,   setSocketConnected,   setSuspect,   setWaitForAck,   toString,   waitForAck,   writeData
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.cluster.tcp.FastAsyncSocketSender Detail:
 protected  void checkThread() 
    Start Queue thread as daemon
 public  void connect() throws IOException 
    Connect to socket and start background thread to push queued messages
 public  void disconnect() 
    Disconnect socket ad stop queue thread
 public long getInQueueCounter() 
 public String getInfo() 
    Return descriptive information about this implementation and the corresponding version number, in the format <description>/<version>.
 public int getMaxQueueLength() 
 public long getOutQueueCounter() 
 public long getQueueAddWaitTime() 
 public long getQueueAddWaitTimeout() 
    get current add wait timeout
 public long getQueueRemoveWaitTime() 
 public long getQueueRemoveWaitTimeout() 
    get current remove wait timeout
 public int getQueueSize() 
 public long getQueuedNrOfBytes() 
 public int getThreadPriority() 
    Get the current threadPriority
 public boolean isQueueCheckLock() 
 public boolean isQueueDoStats() 
 public boolean isQueueTimeWait() 
 public synchronized  void resetStatistics() 
    Reset sender statistics
 public  void sendMessage(ClusterData data) throws IOException 
    Send message to queue for later sending.
 public  void setMaxQueueLength(int length) 
 public  void setQueueAddWaitTimeout(long timeout) 
    Set add wait timeout (default 10000 msec)
 public  void setQueueCheckLock(boolean checkLock) 
 public  void setQueueDoStats(boolean doStats) 
 public  void setQueueTimeWait(boolean timeWait) 
 public  void setRemoveWaitTimeout(long timeout) 
    set remove wait timeout ( default 30000 msec)
 public  void setThreadPriority(int threadPriority) 
    change active the queue Thread priority
 protected  void stopThread() 
    stop queue worker thread
 public String toString() 
    Name of this SockerSender