org.apache.catalina.tribes.util.ExecutorFactory Java Examples

The following examples show how to use org.apache.catalina.tribes.util.ExecutorFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MessageDispatchInterceptor.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
public void startQueue() {
    if (run) {
        return;
    }
    String channelName = "";
    if (getChannel().getName() != null) channelName = "[" + getChannel().getName() + "]";
    executor = ExecutorFactory.newThreadPool(maxSpareThreads, maxThreads, keepAliveTime,
            TimeUnit.MILLISECONDS,
            new TcclThreadFactory("MessageDispatchInterceptor.MessageDispatchThread" + channelName));
    run = true;
}
 
Example #2
Source File: ReceiverBase.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public void start() throws IOException {
    if ( executor == null ) {
        //executor = new ThreadPoolExecutor(minThreads,maxThreads,60,TimeUnit.SECONDS,new LinkedBlockingQueue<Runnable>());
        String channelName = "";
        if (channel.getName() != null) channelName = "[" + channel.getName() + "]";
        TaskThreadFactory tf = new TaskThreadFactory("Tribes-Task-Receiver" + channelName + "-");
        executor = ExecutorFactory.newThreadPool(minThreads, maxThreads, maxIdleTime, TimeUnit.MILLISECONDS, tf);
    }
    // register jmx
    JmxRegistry jmxRegistry = JmxRegistry.getRegistry(channel);
    if (jmxRegistry != null) this.oname = jmxRegistry.registerJmx(",component=Receiver", this);
}
 
Example #3
Source File: MessageDispatch15Interceptor.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
@Override
public void startQueue() {
    if ( run ) return;
    executor = ExecutorFactory.newThreadPool(maxSpareThreads, maxThreads,
            keepAliveTime, TimeUnit.MILLISECONDS,
            new TcclThreadFactory("MessageDispatch15Interceptor.MessageDispatchThread"));
    run = true;
}
 
Example #4
Source File: ReceiverBase.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
@Override
public void start() throws IOException {
    if ( executor == null ) {
        //executor = new ThreadPoolExecutor(minThreads,maxThreads,60,TimeUnit.SECONDS,new LinkedBlockingQueue<Runnable>());
        TaskThreadFactory tf = new TaskThreadFactory("Tribes-Task-Receiver-");
        executor = ExecutorFactory.newThreadPool(minThreads, maxThreads, maxIdleTime, TimeUnit.MILLISECONDS, tf);
    }
}
 
Example #5
Source File: MessageDispatch15Interceptor.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
@Override
public void startQueue() {
    if ( run ) return;
    String channelName = "";
    if (getChannel() instanceof GroupChannel
            && ((GroupChannel)getChannel()).getName() != null) {
        channelName = "[" + ((GroupChannel)getChannel()).getName() + "]";
    }
    executor = ExecutorFactory.newThreadPool(maxSpareThreads, maxThreads,
            keepAliveTime, TimeUnit.MILLISECONDS,
            new TcclThreadFactory("MessageDispatch15Interceptor.MessageDispatchThread" + channelName));
    run = true;
}
 
Example #6
Source File: ReceiverBase.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
@Override
public void start() throws IOException {
    if ( executor == null ) {
        //executor = new ThreadPoolExecutor(minThreads,maxThreads,60,TimeUnit.SECONDS,new LinkedBlockingQueue<Runnable>());
        String channelName = "";
        if (channel instanceof GroupChannel && ((GroupChannel)channel).getName() != null) {
            channelName = "[" + ((GroupChannel)channel).getName() + "]";
        }
        TaskThreadFactory tf = new TaskThreadFactory("Tribes-Task-Receiver" + channelName + "-");
        executor = ExecutorFactory.newThreadPool(minThreads, maxThreads, maxIdleTime, TimeUnit.MILLISECONDS, tf);
    }
}