Java Code Examples for java.util.concurrent.ForkJoinPool#ForkJoinWorkerThreadFactory

The following examples show how to use java.util.concurrent.ForkJoinPool#ForkJoinWorkerThreadFactory . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UsingForkJoinFramework.java    From java-concurrency-patterns with MIT License 3 votes vote down vote up
/**
 * Customize ForkJoinPool
 * 
 * Parallelism: Parallelism level, default is Runtime#availableProcessors
 * 
 * ForkJoinWorkerThreadFactory: Factory used for creating threads for the pool.
 * 
 * UncaughtExceptionHandler: handles worker threads that terminates due some
 * "unrecoverable" problem.
 * 
 * True-value AsyncMode: FIFO scheduling mode, used by tasks that are never
 * joined, like event-oriented asynchronous tasks.
 * 
 */
public ForkJoinPool customForkJoinPool(int parallelism, 
		ForkJoinPool.ForkJoinWorkerThreadFactory factory,
		UncaughtExceptionHandler handler, 
		boolean asyncMode) {
	return new ForkJoinPool(parallelism, factory, handler, asyncMode);
}
 
Example 2
Source File: ForkJoinPoolFactoryBean.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Set the factory for creating new ForkJoinWorkerThreads.
 * Default is {@link ForkJoinPool#defaultForkJoinWorkerThreadFactory}.
 */
public void setThreadFactory(ForkJoinPool.ForkJoinWorkerThreadFactory threadFactory) {
	this.threadFactory = threadFactory;
}
 
Example 3
Source File: ForkJoinPoolFactoryBean.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Set the factory for creating new ForkJoinWorkerThreads.
 * Default is {@link ForkJoinPool#defaultForkJoinWorkerThreadFactory}.
 */
public void setThreadFactory(ForkJoinPool.ForkJoinWorkerThreadFactory threadFactory) {
	this.threadFactory = threadFactory;
}
 
Example 4
Source File: ForkJoinPoolFactoryBean.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Set the factory for creating new ForkJoinWorkerThreads.
 * Default is {@link ForkJoinPool#defaultForkJoinWorkerThreadFactory}.
 */
public void setThreadFactory(ForkJoinPool.ForkJoinWorkerThreadFactory threadFactory) {
	this.threadFactory = threadFactory;
}
 
Example 5
Source File: ForkJoinPoolFactoryBean.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * Set the factory for creating new ForkJoinWorkerThreads.
 * Default is {@link ForkJoinPool#defaultForkJoinWorkerThreadFactory}.
 */
public void setThreadFactory(ForkJoinPool.ForkJoinWorkerThreadFactory threadFactory) {
	this.threadFactory = threadFactory;
}