Examples of TcpReplicationThread


Examples of org.apache.catalina.tribes.tcp.nio.TcpReplicationThread

     */
    public void start() {
        try {
            TcpReplicationThread[] receivers = new TcpReplicationThread[tcpThreadCount];
            for ( int i=0; i<receivers.length; i++ ) {
                receivers[i] = new TcpReplicationThread();
                receivers[i].setRxBufSize(getRxBufSize());
                receivers[i].setOptions(getWorkerThreadOptions());
            }
            pool = new ThreadPool(interestOpsMutex, receivers);
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.catalina.tribes.tcp.nio.TcpReplicationThread

     *  channel returns an EOF condition, it is closed here, which
     *  automatically invalidates the associated key.  The selector
     *  will then de-register the channel on the next select call.
     */
    protected void readDataFromSocket(SelectionKey key) throws Exception {
        TcpReplicationThread worker = (TcpReplicationThread) pool.getWorker();
        if (worker == null) {
            // No threads available, do nothing, the selection
            // loop will keep calling this method until a
            // thread becomes available.
            // FIXME: This design could be improved.
            if (log.isDebugEnabled())
                log.debug("No TcpReplicationThread available");
        } else {
            // invoking this wakes up the worker thread then returns
            worker.serviceChannel(key);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.