Search in sources :

Example 6 with ThreadPoolTaskScheduler

use of org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler in project gravitee-management-rest-api by gravitee-io.

the class SyncConfiguration method taskScheduler.

@Bean
public TaskScheduler taskScheduler() {
    ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
    scheduler.setThreadNamePrefix("sync-");
    return scheduler;
}
Also used : ThreadPoolTaskScheduler(org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler) Bean(org.springframework.context.annotation.Bean)

Example 7 with ThreadPoolTaskScheduler

use of org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler in project gravitee-management-rest-api by gravitee-io.

the class DynamicPropertiesConfiguration method taskScheduler.

@Bean
public TaskScheduler taskScheduler() {
    ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
    scheduler.setThreadNamePrefix("refresher-");
    return scheduler;
}
Also used : ThreadPoolTaskScheduler(org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler) Bean(org.springframework.context.annotation.Bean)

Example 8 with ThreadPoolTaskScheduler

use of org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler in project micrometer by micrometer-metrics.

the class ExecutorServiceMetricsTest method taskScheduler.

@Test
public void taskScheduler() {
    ThreadPoolTaskScheduler sched = new ThreadPoolTaskScheduler();
    sched.initialize();
    ExecutorServiceMetrics.monitor(registry, sched.getScheduledExecutor(), "sched");
    assertThreadPoolExecutorMetrics("sched");
}
Also used : ThreadPoolTaskScheduler(org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler) Test(org.junit.Test)

Example 9 with ThreadPoolTaskScheduler

use of org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler in project openmeetings by apache.

the class Core method setDeadlockGuard.

public void setDeadlockGuard(RTMPConnection conn) {
    ThreadPoolTaskScheduler deadlockGuard = new ThreadPoolTaskScheduler();
    deadlockGuard.setPoolSize(16);
    deadlockGuard.setDaemon(false);
    deadlockGuard.setWaitForTasksToCompleteOnShutdown(true);
    deadlockGuard.setThreadNamePrefix("DeadlockGuardScheduler-");
    deadlockGuard.afterPropertiesSet();
    conn.setDeadlockGuardScheduler(deadlockGuard);
}
Also used : ThreadPoolTaskScheduler(org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler)

Example 10 with ThreadPoolTaskScheduler

use of org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler in project spring-integration by spring-projects.

the class DelayHandlerTests method setup.

@Before
public void setup() {
    input.setBeanName("input");
    output.setBeanName("output");
    taskScheduler = new ThreadPoolTaskScheduler();
    taskScheduler.afterPropertiesSet();
    delayHandler = new DelayHandler(DELAYER_MESSAGE_GROUP_ID, taskScheduler);
    delayHandler.setOutputChannel(output);
    delayHandler.setBeanFactory(mock(BeanFactory.class));
    input.subscribe(delayHandler);
    output.subscribe(resultHandler);
}
Also used : BeanFactory(org.springframework.beans.factory.BeanFactory) ThreadPoolTaskScheduler(org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler) Before(org.junit.Before)

Aggregations

ThreadPoolTaskScheduler (org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler)122 Test (org.junit.Test)41 Bean (org.springframework.context.annotation.Bean)32 BeanFactory (org.springframework.beans.factory.BeanFactory)31 Test (org.junit.jupiter.api.Test)26 CountDownLatch (java.util.concurrent.CountDownLatch)19 QueueChannel (org.springframework.integration.channel.QueueChannel)19 GenericMessage (org.springframework.messaging.support.GenericMessage)13 AtomicReference (java.util.concurrent.atomic.AtomicReference)12 ExecutorService (java.util.concurrent.ExecutorService)10 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)8 MqttPahoMessageDrivenChannelAdapter (org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter)8 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)7 MqttPahoMessageHandler (org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler)6 JmsTemplate (org.springframework.jms.core.JmsTemplate)6 ArrayList (java.util.ArrayList)5 Log (org.apache.commons.logging.Log)5 MessageChannel (org.springframework.messaging.MessageChannel)5 File (java.io.File)4 ConnectionFactory (javax.jms.ConnectionFactory)4