Package org.apache.openejb.util

Examples of org.apache.openejb.util.ExecutorBuilder


            final Executor threadPool;
            if (threadPoolSize <= 0) {
                logger.warning("Thread pool for '" + serviceInfo.id + "' is (unbounded), consider setting a size using: " + serviceInfo.id + ".QueueSize=[size]");
                threadPool = Executors.newCachedThreadPool(new DaemonThreadFactory(serviceInfo.id + "-worker-"));
            } else {
                threadPool = new ExecutorBuilder()
                    .size(threadPoolSize)
                    .prefix(serviceInfo.id)
                    .threadFactory(new DaemonThreadFactory(serviceInfo.id + "-worker-"))
                    .build(new Options(serviceInfo.properties, SystemInstance.get().getOptions()));
                logger.info("Thread pool size for '" + serviceInfo.id + "' is (" + threadPoolSize + ")");
View Full Code Here


        this.awaitDuration = awaitDuration;
    }

    public static AsynchronousPool create(final AppContext appContext) {
        final Options options = appContext.getOptions();
        final ExecutorBuilder builder = new ExecutorBuilder()
            .prefix("AsynchronousPool")
            .size(options.get("AsynchronousPool.Size", 5))
            .threadFactory(new DaemonThreadFactory("@Asynchronous", appContext.getId()));

        return new AsynchronousPool(
            builder.build(options),
            options.get("AsynchronousPool.ShutdownWaitDuration", new Duration(1, TimeUnit.MINUTES)));
    }
View Full Code Here

        final TimerExecutor timerExecutor = SystemInstance.get().getComponent(TimerExecutor.class);

        if (timerExecutor != null) {
            this.executor = timerExecutor.executor;
        } else {
            this.executor = new ExecutorBuilder()
                .size(threadCount)
                .prefix("EjbTimerPool")
                .build(SystemInstance.get().getOptions());

            SystemInstance.get().setComponent(TimerExecutor.class, new TimerExecutor(this.executor));
View Full Code Here

        this.awaitDuration = awaitDuration;
    }

    public static AsynchronousPool create(final AppContext appContext) {
        final Options options = appContext.getOptions();
        final ExecutorBuilder builder = new ExecutorBuilder()
            .prefix("AsynchronousPool")
            .size(options.get("AsynchronousPool.Size", 5))
            .threadFactory(new DaemonThreadFactory("@Asynchronous", appContext.getId()));

        return new AsynchronousPool(
            builder.build(options),
            options.get("AsynchronousPool.ShutdownWaitDuration", new Duration(1, TimeUnit.MINUTES)));
    }
View Full Code Here

        final TimerExecutor timerExecutor = SystemInstance.get().getComponent(TimerExecutor.class);

        if (timerExecutor != null) {
            this.executor = timerExecutor.incr().executor;
        } else {
            this.executor = new ExecutorBuilder()
                .size(threadCount)
                .prefix("EjbTimerPool")
                .build(SystemInstance.get().getOptions());

            final TimerExecutor value = new TimerExecutor(this.executor).incr();
View Full Code Here

            final Executor threadPool;
            if (threadPoolSize <= 0) {
                logger.warning("Thread pool for '" + serviceInfo.id + "' is (unbounded), consider setting a size using: " + serviceInfo.id + ".QueueSize=[size]");
                threadPool = Executors.newCachedThreadPool(new DaemonThreadFactory(serviceInfo.id + "-worker-"));
            } else {
                threadPool = new ExecutorBuilder()
                    .size(threadPoolSize)
                    .prefix(serviceInfo.id)
                    .threadFactory(new DaemonThreadFactory(serviceInfo.id + "-worker-"))
                    .build(new Options(serviceInfo.properties, SystemInstance.get().getOptions()));
                logger.info("Thread pool size for '" + serviceInfo.id + "' is (" + threadPoolSize + ")");
View Full Code Here

            final Executor threadPool;
            if (threadPoolSize <= 0) {
                logger.warning("Thread pool for '" + serviceInfo.id + "' is (unbounded), consider setting a size using: " + serviceInfo.id + ".QueueSize=[size]");
                threadPool = Executors.newCachedThreadPool(new DaemonThreadFactory(serviceInfo.id + "-worker-"));
            } else {
                threadPool = new ExecutorBuilder()
                    .size(threadPoolSize)
                    .prefix(serviceInfo.id)
                    .threadFactory(new DaemonThreadFactory(serviceInfo.id + "-worker-"))
                    .build(new Options(serviceInfo.properties, SystemInstance.get().getOptions()));
                logger.info("Thread pool size for '" + serviceInfo.id + "' is (" + threadPoolSize + ")");
View Full Code Here

            final Executor threadPool;
            if (threadPoolSize <= 0) {
                logger.warning("Thread pool for '" + serviceInfo.id + "' is (unbounded), consider setting a size using: " + serviceInfo.id + ".QueueSize=[size]");
                threadPool = Executors.newCachedThreadPool(new DaemonThreadFactory(serviceInfo.id + "-worker-"));
            } else {
                threadPool = new ExecutorBuilder()
                    .size(threadPoolSize)
                    .prefix(serviceInfo.id)
                    .threadFactory(new DaemonThreadFactory(serviceInfo.id + "-worker-"))
                    .build(new Options(serviceInfo.properties, SystemInstance.get().getOptions()));
                logger.info("Thread pool size for '" + serviceInfo.id + "' is (" + threadPoolSize + ")");
View Full Code Here

        this.awaitDuration = awaitDuration;
    }

    public static AsynchronousPool create(final AppContext appContext) {

        final ExecutorBuilder builder = new ExecutorBuilder()
                .prefix("AsynchronousPool")
                .size(3)
                .threadFactory(new DaemonThreadFactory("@Asynchronous", appContext.getId()));

        final Options options = appContext.getOptions();
        final AsynchronousPool asynchronousPool = new AsynchronousPool(
                builder.build(options),
                options.get("AsynchronousPool.ShutdownWaitDuration", new Duration(1, TimeUnit.MINUTES)));
        return asynchronousPool;
    }
View Full Code Here

        final TimerExecutor timerExecutor = SystemInstance.get().getComponent(TimerExecutor.class);

        if (timerExecutor != null) {
            this.executor = timerExecutor.executor;
        } else {
            this.executor = new ExecutorBuilder()
                    .size(3)
                    .prefix("EjbTimerPool")
                    .build(SystemInstance.get().getOptions());

            SystemInstance.get().setComponent(TimerExecutor.class, new TimerExecutor(this.executor));
View Full Code Here

TOP

Related Classes of org.apache.openejb.util.ExecutorBuilder

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.