Example usage for org.springframework.scheduling.concurrent ThreadPoolTaskExecutor setThreadGroupName

List of usage examples for org.springframework.scheduling.concurrent ThreadPoolTaskExecutor setThreadGroupName

Introduction

In this page you can find the example usage for org.springframework.scheduling.concurrent ThreadPoolTaskExecutor setThreadGroupName.

Prototype

public void setThreadGroupName(String name) 

Source Link

Document

Specify the name of the thread group that threads should be created in.

Usage

From source file:com.netflix.genie.common.internal.configs.AwsAutoConfiguration.java

/**
 * Provide an protocol resolver which will allow resources with s3:// prefixes to be resolved by the
 * application {@link org.springframework.core.io.ResourceLoader} provided this bean is eventually added to the
 * context via the//from   w w w  .j  a v a 2  s  .c o  m
 * {@link org.springframework.context.ConfigurableApplicationContext#addProtocolResolver(ProtocolResolver)}
 * method.
 *
 * @param resourceLoaderProperties The {@link AwsS3ResourceLoaderProperties} instance to use
 * @param s3ClientFactory          The {@link S3ClientFactory} instance to use
 * @return A {@link S3ProtocolResolver} instance
 */
@Bean
@ConditionalOnMissingBean(S3ProtocolResolver.class)
public S3ProtocolResolver s3ProtocolResolver(final AwsS3ResourceLoaderProperties resourceLoaderProperties,
        final S3ClientFactory s3ClientFactory) {
    final ThreadPoolTaskExecutor s3TaskExecutor = new ThreadPoolTaskExecutor();
    s3TaskExecutor.setCorePoolSize(resourceLoaderProperties.getCorePoolSize());
    s3TaskExecutor.setMaxPoolSize(resourceLoaderProperties.getMaxPoolSize());
    s3TaskExecutor.setQueueCapacity(resourceLoaderProperties.getQueueCapacity());
    s3TaskExecutor.setThreadGroupName("Genie-S3-Resource-Loader-Thread-Pool");
    s3TaskExecutor.setThreadNamePrefix("S3-resource-loader-thread");
    return new S3ProtocolResolver(s3ClientFactory, s3TaskExecutor);
}