Package org.jboss.threads

Examples of org.jboss.threads.JBossThreadPoolExecutor$CountingRejectHandler


    }

    public synchronized void start(final StartContext context) throws StartException {
        final TimeSpec keepAliveSpec = keepAlive;
        long keepAliveTime = keepAliveSpec == null ? Long.MAX_VALUE : keepAliveSpec.getUnit().toNanos(keepAliveSpec.getDuration());
        final JBossThreadPoolExecutor jbossExecutor = new JBossThreadPoolExecutor(maxThreads, maxThreads, keepAliveTime, TimeUnit.NANOSECONDS, new LinkedBlockingQueue<Runnable>(), threadFactoryValue.getValue());
        executor = new ManagedJBossThreadPoolExecutorService(jbossExecutor);
    }
View Full Code Here


    }

    public synchronized void start(final StartContext context) throws StartException {
        final TimeSpec keepAliveSpec = keepAlive;
        long keepAliveTime = keepAliveSpec == null ? Long.MAX_VALUE : keepAliveSpec.getUnit().toNanos(keepAliveSpec.getDuration());
        final JBossThreadPoolExecutor jbossExecutor = new JBossThreadPoolExecutor(maxThreads, maxThreads, keepAliveTime, TimeUnit.NANOSECONDS, new LinkedBlockingQueue<Runnable>(), threadFactoryValue.getValue());
        executor = new ManagedJBossThreadPoolExecutorService(jbossExecutor);
    }
View Full Code Here

        this.maxThreads = maxThreads;
        this.keepAlive = keepAlive;
    }

    public synchronized void start(final StartContext context) throws StartException {
        executor = new JBossThreadPoolExecutor(maxThreads, maxThreads, keepAlive.getDuration(), keepAlive.getUnit(), new LinkedBlockingQueue<Runnable>(), threadFactoryValue.getValue());
        value = JBossExecutors.protectedExecutorService(executor);
    }
View Full Code Here

        executor = new JBossThreadPoolExecutor(maxThreads, maxThreads, keepAlive.getDuration(), keepAlive.getUnit(), new LinkedBlockingQueue<Runnable>(), threadFactoryValue.getValue());
        value = JBossExecutors.protectedExecutorService(executor);
    }

    public synchronized void stop(final StopContext context) {
        final JBossThreadPoolExecutor executor = this.executor;
        if (executor == null) {
            throw new IllegalStateException();
        }
        context.asynchronous();
        executor.shutdown();
        executor.addShutdownListener(new EventListener<StopContext>() {
            public void handleEvent(final StopContext stopContext) {
                stopContext.complete();
            }
        }, context);
        this.executor = null;
View Full Code Here

        return threadFactoryValue;
    }

    public synchronized void setMaxThreads(final int maxThreads) {
        this.maxThreads = maxThreads;
        final JBossThreadPoolExecutor executor = this.executor;
        if(executor != null) {
            executor.setMaxThreads(maxThreads);
        }
    }
View Full Code Here

        }
    }

    public synchronized void setKeepAlive(final TimeSpec keepAlive) {
        this.keepAlive = keepAlive;
        final JBossThreadPoolExecutor executor = this.executor;
        if(executor != null) {
            executor.setKeepAliveTime(keepAlive.getDuration(), keepAlive.getUnit());
        }
    }
View Full Code Here

    }

    public synchronized void start(final StartContext context) throws StartException {
        final TimeSpec keepAliveSpec = keepAlive;
        long keepAliveTime = keepAliveSpec == null ? Long.MAX_VALUE : keepAliveSpec.getUnit().toNanos(keepAliveSpec.getDuration());
        final JBossThreadPoolExecutor jbossExecutor = new JBossThreadPoolExecutor(maxThreads, maxThreads, keepAliveTime, TimeUnit.NANOSECONDS, new LinkedBlockingQueue<Runnable>(), threadFactoryValue.getValue());
        executor = new ManagedJBossThreadPoolExecutorService(jbossExecutor);
    }
View Full Code Here

    }

    public synchronized void start(final StartContext context) throws StartException {
        final TimeSpec keepAliveSpec = keepAlive;
        long keepAliveTime = keepAliveSpec == null ? Long.MAX_VALUE : keepAliveSpec.getUnit().toNanos(keepAliveSpec.getDuration());
        executor = new JBossThreadPoolExecutor(maxThreads, maxThreads, keepAliveTime, TimeUnit.NANOSECONDS, new LinkedBlockingQueue<Runnable>(), threadFactoryValue.getValue());
        value = JBossExecutors.protectedExecutorService(executor);
    }
View Full Code Here

        executor = new JBossThreadPoolExecutor(maxThreads, maxThreads, keepAliveTime, TimeUnit.NANOSECONDS, new LinkedBlockingQueue<Runnable>(), threadFactoryValue.getValue());
        value = JBossExecutors.protectedExecutorService(executor);
    }

    public synchronized void stop(final StopContext context) {
        final JBossThreadPoolExecutor executor = this.executor;
        if (executor == null) {
            throw new IllegalStateException();
        }
        context.asynchronous();
        executor.shutdown();
        executor.addShutdownListener(new EventListener<StopContext>() {
            public void handleEvent(final StopContext stopContext) {
                stopContext.complete();
            }
        }, context);
        this.executor = null;
View Full Code Here

        return threadFactoryValue;
    }

    public synchronized void setMaxThreads(final int maxThreads) {
        this.maxThreads = maxThreads;
        final JBossThreadPoolExecutor executor = this.executor;
        if(executor != null) {
            executor.setMaxThreads(maxThreads);
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.threads.JBossThreadPoolExecutor$CountingRejectHandler

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.