Package org.apache.camel.spi

Examples of org.apache.camel.spi.ExecutorServiceManager.newDefaultThreadPool()


            when = onWhen.getExpression().createPredicate(routeContext);
        }

        String ref = this.executorServiceRef != null ? this.executorServiceRef : "OnCompletion";
        ExecutorServiceManager manager = routeContext.getCamelContext().getExecutorServiceManager();
        executorService = manager.newDefaultThreadPool(this, ref);

        // should be false by default
        boolean original = getUseOriginalMessagePolicy() != null ? getUseOriginalMessagePolicy() : false;
        OnCompletionProcessor answer = new OnCompletionProcessor(routeContext.getCamelContext(), childProcessor,
                executorService, isOnCompleteOnly(), isOnFailureOnly(), when, original);
View Full Code Here


            if (answer == null) {
                throw new IllegalArgumentException("ExecutorServiceRef " + definition.getExecutorServiceRef() + " not found in registry or as a thread pool profile.");
            }
            return answer;
        } else if (useDefault) {
            return manager.newDefaultThreadPool(definition, name);
        }

        return null;
    }
View Full Code Here

        Processor childProcessor = this.createChildProcessor(routeContext, true);
        aggregationStrategy = createAggregationStrategy(routeContext);
        if (isParallelProcessing() && executorService == null) {
            String ref = this.executorServiceRef != null ? this.executorServiceRef : "Split";
            ExecutorServiceManager manager = routeContext.getCamelContext().getExecutorServiceManager();
            executorService = manager.newDefaultThreadPool(this, ref);
        }

        long timeout = getTimeout() != null ? getTimeout() : 0;
        if (timeout > 0 && !isParallelProcessing()) {
            throw new IllegalArgumentException("Timeout is used but ParallelProcessing has not been enabled.");
View Full Code Here

        executorService = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, "Aggregator", this);
        if (executorService == null) {
            // executor service is mandatory for the Aggregator
            ExecutorServiceManager executorServiceManager = routeContext.getCamelContext().getExecutorServiceManager();
            if (isParallelProcessing()) {
                executorService = executorServiceManager.newDefaultThreadPool(this, "Aggregator");
            } else {
                // we do not run in parallel mode, but use a synchronous executor, so we run in current thread
                executorService = new SynchronousExecutorService();
            }
        }
View Full Code Here

            if (answer == null) {
                throw new IllegalArgumentException("ExecutorServiceRef " + definition.getExecutorServiceRef() + " not found in registry or as a thread pool profile.");
            }
            return answer;
        } else if (useDefault) {
            return manager.newDefaultThreadPool(definition, name);
        }

        return null;
    }
View Full Code Here

            if (answer == null) {
                throw new IllegalArgumentException("ExecutorServiceRef " + definition.getExecutorServiceRef() + " not found in registry or as a thread pool profile.");
            }
            return answer;
        } else if (useDefault) {
            return manager.newDefaultThreadPool(definition, name);
        }

        return null;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.