Package edu.emory.mathcs.backport.java.util.concurrent

Examples of edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory


        this.threadNamePrefix = threadNamePrefix;
       
        // Create the default filter
        defaultFilter = new ExecutorFilter();
        ThreadPoolExecutor tpe = ( ThreadPoolExecutor ) defaultFilter.getExecutor();
        final ThreadFactory originalThreadFactory = tpe.getThreadFactory();
        ThreadFactory newThreadFactory = new ThreadFactory()
        {
            private final AtomicInteger threadId = new AtomicInteger( 0 );

            public Thread newThread( Runnable runnable )
            {
View Full Code Here


     * Start ClockDaemon Set up TaskExecutors Set up TaskFactory
     */
    public DefaultTaskProcessor(Configuration config, TaskFactory taskFactory)
    {
        clockDaemon_ = Executors.newSingleThreadScheduledExecutor(
                new ThreadFactory()
                {
                    public Thread newThread(Runnable command)
                    {
                        Thread _t = new Thread(command);
                        _t.setName("ClockDaemonThread");
View Full Code Here

        {
            executor_ = new DirectExecutor();
        }
        else
        {
            ThreadFactory _threadFactory = new DefaultThreadFactory(name);

            final ExecutorService _executor;
           
            if (mayDie)
            {
View Full Code Here

        this.clockDaemon = clockDaemon;
    }

    public ScheduledThreadPoolExecutor getScheduledThreadPoolExecutor() {
        if (clockDaemon == null) {
            clockDaemon = new ScheduledThreadPoolExecutor(5, new ThreadFactory() {
                public Thread newThread(Runnable runnable) {
                    Thread thread = new Thread(runnable, "ActiveMQ Cleanup Timer");
                    thread.setDaemon(true);
                    return thread;
                }
View Full Code Here

        if( !started.compareAndSet(false, true) )
            return;
       
        longTermPersistence.setUseExternalMessageReferences(false);

        checkpointExecutor = new ThreadPoolExecutor(maxCheckpointWorkers, maxCheckpointWorkers, 30, TimeUnit.SECONDS, new LinkedBlockingQueue(), new ThreadFactory() {
            public Thread newThread(Runnable runable) {
                Thread t = new Thread(runable, "Journal checkpoint worker");
                t.setPriority(7);
                return t;
            }           
View Full Code Here

    public synchronized void start() throws Exception {
        if( !started.compareAndSet(false, true) )
            return;
       
        checkpointExecutor = new ThreadPoolExecutor(maxCheckpointWorkers, maxCheckpointWorkers, 30, TimeUnit.SECONDS, new LinkedBlockingQueue(), new ThreadFactory() {
            public Thread newThread(Runnable runable) {
                Thread t = new Thread(runable, "Journal checkpoint worker");
                t.setPriority(7);
                return t;
            }           
View Full Code Here

        if( !started.compareAndSet(false, true) )
            return;
       
        longTermPersistence.setUseExternalMessageReferences(true);

        checkpointExecutor = new ThreadPoolExecutor(maxCheckpointWorkers, maxCheckpointWorkers, 30, TimeUnit.SECONDS, new LinkedBlockingQueue(), new ThreadFactory() {
            public Thread newThread(Runnable runable) {
                Thread t = new Thread(runable, "Journal checkpoint worker");
                t.setPriority(7);
                return t;
            }           
View Full Code Here

        this.transport = transport;
        this.clientIdGenerator = clientIdGenerator;
        this.factoryStats = factoryStats;
       
        // Configure a single threaded executor who's core thread can timeout if idle
        asyncConnectionThread = new ThreadPoolExecutor(1,1,5,TimeUnit.SECONDS, new LinkedBlockingQueue(), new ThreadFactory() {
            public Thread newThread(Runnable r) {
                Thread thread = new Thread(r, "AcitveMQ Connection Worker: "+transport);
                thread.setDaemon(true);
                return thread;
            }});
View Full Code Here

            return new DedicatedTaskRunner(task, name, priority, daemon);
        }
    }
   
    protected ExecutorService createDefaultExecutor() {
        ThreadPoolExecutor rc = new ThreadPoolExecutor(1, Integer.MAX_VALUE, 10, TimeUnit.SECONDS, new SynchronousQueue(), new ThreadFactory() {
            public Thread newThread(Runnable runnable) {
                Thread thread = new Thread(runnable, name);
                thread.setDaemon(daemon);
                thread.setPriority(priority);
                return thread;
View Full Code Here

        // Create the default filter
        defaultFilter = new ExecutorFilter();
        ThreadPoolExecutor tpe = (ThreadPoolExecutor) defaultFilter
                .getExecutor();
        final ThreadFactory originalThreadFactory = tpe.getThreadFactory();
        ThreadFactory newThreadFactory = new ThreadFactory() {
            private final AtomicInteger threadId = new AtomicInteger(0);

            public Thread newThread(Runnable runnable) {
                Thread t = originalThreadFactory.newThread(
                        new NamePreservingRunnable(
View Full Code Here

TOP

Related Classes of edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory

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.