org.springframework.util.CustomizableThreadCreator Java Examples

The following examples show how to use org.springframework.util.CustomizableThreadCreator. 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: LazyTraceThreadPoolTaskScheduler.java    From spring-cloud-sleuth with Apache License 2.0 6 votes vote down vote up
LazyTraceThreadPoolTaskScheduler(BeanFactory beanFactory,
		ThreadPoolTaskScheduler delegate) {
	this.beanFactory = beanFactory;
	this.delegate = delegate;
	this.initializeExecutor = ReflectionUtils
			.findMethod(ThreadPoolTaskScheduler.class, "initializeExecutor", null);
	makeAccessibleIfNotNull(this.initializeExecutor);
	this.createExecutor = ReflectionUtils.findMethod(ThreadPoolTaskScheduler.class,
			"createExecutor", null);
	makeAccessibleIfNotNull(this.createExecutor);
	this.cancelRemainingTask = ReflectionUtils
			.findMethod(ThreadPoolTaskScheduler.class, "cancelRemainingTask", null);
	makeAccessibleIfNotNull(this.cancelRemainingTask);
	this.nextThreadName = ReflectionUtils.findMethod(ThreadPoolTaskScheduler.class,
			"nextThreadName", null);
	makeAccessibleIfNotNull(this.nextThreadName);
	this.getDefaultThreadNamePrefix = ReflectionUtils.findMethod(
			CustomizableThreadCreator.class, "getDefaultThreadNamePrefix", null);
	makeAccessibleIfNotNull(this.getDefaultThreadNamePrefix);
}
 
Example #2
Source File: LazyTraceThreadPoolTaskScheduler.java    From elasticactors with Apache License 2.0 6 votes vote down vote up
LazyTraceThreadPoolTaskScheduler(ThreadPoolTaskScheduler delegate) {
    this.delegate = delegate;
    this.initializeExecutor = ReflectionUtils
            .findMethod(ThreadPoolTaskScheduler.class, "initializeExecutor", null);
    makeAccessibleIfNotNull(this.initializeExecutor);
    this.createExecutor = ReflectionUtils.findMethod(ThreadPoolTaskScheduler.class,
            "createExecutor", null);
    makeAccessibleIfNotNull(this.createExecutor);
    this.cancelRemainingTask = ReflectionUtils
            .findMethod(ThreadPoolTaskScheduler.class, "cancelRemainingTask", null);
    makeAccessibleIfNotNull(this.cancelRemainingTask);
    this.nextThreadName = ReflectionUtils.findMethod(ThreadPoolTaskScheduler.class,
            "nextThreadName", null);
    makeAccessibleIfNotNull(this.nextThreadName);
    this.getDefaultThreadNamePrefix = ReflectionUtils.findMethod(
            CustomizableThreadCreator.class, "getDefaultThreadNamePrefix", null);
    makeAccessibleIfNotNull(this.getDefaultThreadNamePrefix);
}
 
Example #3
Source File: ExecutorBeanDefinitionParserTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Test
public void threadNamePrefix() {
	CustomizableThreadCreator executor = this.context.getBean("default", CustomizableThreadCreator.class);
	assertEquals("default-", executor.getThreadNamePrefix());
}
 
Example #4
Source File: ExecutorBeanDefinitionParserTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Test
public void threadNamePrefix() {
	CustomizableThreadCreator executor = this.context.getBean("default", CustomizableThreadCreator.class);
	assertEquals("default-", executor.getThreadNamePrefix());
}
 
Example #5
Source File: ExecutorBeanDefinitionParserTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Test
public void threadNamePrefix() {
	CustomizableThreadCreator executor = this.context.getBean("default", CustomizableThreadCreator.class);
	assertEquals("default-", executor.getThreadNamePrefix());
}