Package com.google.code.tempusfugit.concurrency.annotations

Examples of com.google.code.tempusfugit.concurrency.annotations.Concurrent


        super(type);
        setScheduler(new ConcurrentScheduler(createExecutor(type)));
    }

    private static ExecutorService createExecutor(Class<?> type) {
        Concurrent concurrent = findConcurrentClass(type);
        if (concurrent != null)
            return newFixedThreadPool(concurrent.count(), new ConcurrentTestRunnerThreadFactory());
        return newCachedThreadPool(new ConcurrentTestRunnerThreadFactory());
    }
View Full Code Here


            return newFixedThreadPool(concurrent.count(), new ConcurrentTestRunnerThreadFactory());
        return newCachedThreadPool(new ConcurrentTestRunnerThreadFactory());
    }

    private static Concurrent findConcurrentClass(Class<?> type) {
        Concurrent concurrent = null;
        while (concurrent == null && type.getSuperclass() != null) {
            concurrent = type.getAnnotation(Concurrent.class);
            type = type.getSuperclass();
        }
        return concurrent;
View Full Code Here

TOP

Related Classes of com.google.code.tempusfugit.concurrency.annotations.Concurrent

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.