Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.PooledExecutor


                    if (closed.get()) {
                        socket.close();
                    }
                    else {
                        // have thread per channel for sending messages and a thread for receiving them
                        PooledExecutor executor = null;
                        if (useAsyncSend) {
                            executor = new PooledExecutor(new BoundedBuffer(maxOutstandingMessages), 1);
                            executor.waitWhenBlocked();
                            executor.setKeepAliveTime(1000);
                        }
                        TcpTransportChannel channel = createTransportChannel(socket, executor);
                        addClient(channel);
                    }
                }
View Full Code Here


     */   
     public void setUseAsyncSend(boolean useAsyncSend) {
        this.useAsyncSend = useAsyncSend;
        try {
            if (useAsyncSend && executor==null ) {
                PooledExecutor pe = new PooledExecutor(new BoundedBuffer(10), 1);
                pe.waitWhenBlocked();
                pe.setKeepAliveTime(1000);
                executor = pe;
            }
            else if (!useAsyncSend && executor != null) {
                stopExecutor(executor);
            }
View Full Code Here

        this.destinations = new ConcurrentHashMap();
        this.subscriptions = new ConcurrentHashMap();
        this.filterFactory = new FilterFactoryImpl();
        this.started = new SynchronizedBoolean(false);
        this.doingGarbageCollection = new SynchronizedBoolean(false);
        this.threadPool = new PooledExecutor();
        this.threadPool.setThreadFactory(new TransientQueueThreadFactory());
        this.inactiveTimeout = DEFAULT_INACTIVE_TIMEOUT;
        this.garbageCoolectionCapacityLimit = DEFAULT_GARBAGE_COLLECTION_CAPACITY_LIMIT;
    }
View Full Code Here

        this.destinations = new ConcurrentHashMap();
        this.subscriptions = new ConcurrentHashMap();
        this.filterFactory = new FilterFactoryImpl();
        this.started = new SynchronizedBoolean(false);
        this.doingGarbageCollection = new SynchronizedBoolean(false);
        this.threadPool = new PooledExecutor();
        this.threadPool.setThreadFactory(new DurableQueueThreadFactory());
        this.inactiveTimeout = DEFAULT_INACTIVE_TIMEOUT;
        this.garbageCoolectionCapacityLimit = DEFAULT_GARBAGE_COLLECTION_CAPACITY_LIMIT;
    }
View Full Code Here

    private ActiveMQPrefetchPolicy remotePrefetchPolicy = new ActiveMQPrefetchPolicy();


    public NetworkConnector(BrokerContainer brokerContainer) {
        this.brokerContainer = brokerContainer;
        this.threadPool = new PooledExecutor();
    }
View Full Code Here

            this(objectListener, 10);
        }

        public ObjectDispatcher(AsynchWriteAsynchChannelAdapter objectListener, int queueSize) {
            this.objectListener = objectListener;
            executor = new PooledExecutor(new BoundedBuffer(queueSize), 1);
            executor.waitWhenBlocked();
        }
View Full Code Here

        final boolean useQueueing = poolConfig.getChild("use-queueing").getValueAsBoolean(false);
        final int queueSize = poolConfig.getChild("queue-size").getValueAsInteger(-1);

        if (useQueueing) {
            if (queueSize > 0) {
                m_executor = new PooledExecutor(new BoundedBuffer(queueSize));
            } else {
                m_executor = new PooledExecutor(new LinkedQueue());
            }
        } else {
            m_executor = new PooledExecutor();
        }

        final int maxPoolSize = poolConfig.getChild("max-pool-size").getValueAsInteger(-1);

        if (maxPoolSize > 0) {
View Full Code Here

   
    public ThreadManagerImpl() {
       
        log.info("Intializing Thread Manager");
       
        backgroundExecutor = new PooledExecutor(new BoundedBuffer(10), 25);
        backgroundExecutor.setMinimumPoolSize(4);
        backgroundExecutor.setKeepAliveTime(1000 * 60 * 5);
        backgroundExecutor.waitWhenBlocked();
        backgroundExecutor.createThreads(9);
       
View Full Code Here

        started = new SynchronizedBoolean(false);
        // there's not much point logging all exceptions, lets just keep a few around
        exceptionsList = new BoundedLinkedQueue(10);
        outboundLock = new Object();
        if (useAsyncSend) {
            executor = new PooledExecutor(new BoundedBuffer(1000), 1);
        }
        super.setCachingEnabled(true);
    }
View Full Code Here

        this.destinations = new ConcurrentHashMap();
        this.subscriptions = new ConcurrentHashMap();
        this.filterFactory = new FilterFactoryImpl();
        this.started = new SynchronizedBoolean(false);
        this.doingGarbageCollection = new SynchronizedBoolean(false);
        this.threadPool = new PooledExecutor();
        this.threadPool.setThreadFactory(new TransientQueueThreadFactory());
        this.inactiveTimeout = DEFAULT_INACTIVE_TIMEOUT;
        this.garbageCoolectionCapacityLimit = DEFAULT_GARBAGE_COLLECTION_CAPACITY_LIMIT;
    }
View Full Code Here

TOP

Related Classes of EDU.oswego.cs.dl.util.concurrent.PooledExecutor

Copyright © 2018 www.massapicom. 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.