Search in sources :

Example 1 with RxTaskPool

use of org.apache.catalina.tribes.transport.RxTaskPool in project tomcat by apache.

the class BioReceiver method start.

@Override
public void start() throws IOException {
    super.start();
    try {
        setPool(new RxTaskPool(getMaxThreads(), getMinThreads(), this));
    } catch (Exception x) {
        log.fatal(sm.getString("bioReceiver.threadpool.fail"), x);
        if (x instanceof IOException)
            throw (IOException) x;
        else
            throw new IOException(x.getMessage());
    }
    try {
        getBind();
        bind();
        String channelName = "";
        if (getChannel().getName() != null)
            channelName = "[" + getChannel().getName() + "]";
        Thread t = new Thread(this, "BioReceiver" + channelName);
        t.setDaemon(true);
        t.start();
    } catch (Exception x) {
        log.fatal(sm.getString("bioReceiver.start.fail"), x);
        if (x instanceof IOException)
            throw (IOException) x;
        else
            throw new IOException(x.getMessage());
    }
}
Also used : RxTaskPool(org.apache.catalina.tribes.transport.RxTaskPool) IOException(java.io.IOException) IOException(java.io.IOException)

Example 2 with RxTaskPool

use of org.apache.catalina.tribes.transport.RxTaskPool in project tomcat by apache.

the class NioReceiver method start.

/**
     * Start cluster receiver.
     *
     * @throws IOException If the receiver fails to start
     *
     * @see org.apache.catalina.tribes.ChannelReceiver#start()
     */
@Override
public void start() throws IOException {
    super.start();
    try {
        setPool(new RxTaskPool(getMaxThreads(), getMinThreads(), this));
    } catch (Exception x) {
        log.fatal(sm.getString("nioReceiver.threadpool.fail"), x);
        if (x instanceof IOException)
            throw (IOException) x;
        else
            throw new IOException(x.getMessage());
    }
    try {
        getBind();
        bind();
        String channelName = "";
        if (getChannel().getName() != null)
            channelName = "[" + getChannel().getName() + "]";
        Thread t = new Thread(this, "NioReceiver" + channelName);
        t.setDaemon(true);
        t.start();
    } catch (Exception x) {
        log.fatal(sm.getString("nioReceiver.start.fail"), x);
        if (x instanceof IOException)
            throw (IOException) x;
        else
            throw new IOException(x.getMessage());
    }
}
Also used : RxTaskPool(org.apache.catalina.tribes.transport.RxTaskPool) IOException(java.io.IOException) CancelledKeyException(java.nio.channels.CancelledKeyException) IOException(java.io.IOException) ClosedSelectorException(java.nio.channels.ClosedSelectorException)

Aggregations

IOException (java.io.IOException)2 RxTaskPool (org.apache.catalina.tribes.transport.RxTaskPool)2 CancelledKeyException (java.nio.channels.CancelledKeyException)1 ClosedSelectorException (java.nio.channels.ClosedSelectorException)1