本文整理汇总了Java中org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler.afterPropertiesSet方法的典型用法代码示例。如果您正苦于以下问题:Java ThreadPoolTaskScheduler.afterPropertiesSet方法的具体用法?Java ThreadPoolTaskScheduler.afterPropertiesSet怎么用?Java ThreadPoolTaskScheduler.afterPropertiesSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
的用法示例。
在下文中一共展示了ThreadPoolTaskScheduler.afterPropertiesSet方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: afterPropertiesSet
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
public void afterPropertiesSet() {
if (properties != null) {
for (Map.Entry<Object, Object> entry : properties.entrySet()) {
String key = (String) entry.getKey();
String value = (String) entry.getValue();
if ("scheduler.enabled".equals(key)) {
continue;
}
if (key.startsWith(prefix)) {
String name = key.substring(prefix.length());
skipMap.put(name, Boolean.valueOf(value));
logger.info("{} : {}", name, skipMap.get(name));
}
}
}
if (enabled) {
instance = new ThreadPoolTaskScheduler();
instance.afterPropertiesSet();
}
}
示例2: RedisTestBinder
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
public RedisTestBinder(RedisConnectionFactory connectionFactory) {
RedisMessageChannelBinder binder = new RedisMessageChannelBinder(connectionFactory);
GenericApplicationContext context = new GenericApplicationContext();
context.getBeanFactory().registerSingleton(IntegrationUtils.INTEGRATION_MESSAGE_BUILDER_FACTORY_BEAN_NAME,
new DefaultMessageBuilderFactory());
DefaultHeaderChannelRegistry channelRegistry = new DefaultHeaderChannelRegistry();
channelRegistry.setReaperDelay(Long.MAX_VALUE);
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
taskScheduler.afterPropertiesSet();
channelRegistry.setTaskScheduler(taskScheduler);
context.getBeanFactory().registerSingleton(
IntegrationContextUtils.INTEGRATION_HEADER_CHANNEL_REGISTRY_BEAN_NAME,
channelRegistry);
context.refresh();
binder.setApplicationContext(context);
binder.setCodec(new PojoCodec());
setBinder(binder);
template = new StringRedisTemplate(connectionFactory);
}
示例3: batchTaskScheduler
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
@Bean
public ThreadPoolTaskScheduler batchTaskScheduler() {
ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
threadPoolTaskScheduler.setPoolSize(10);
threadPoolTaskScheduler.afterPropertiesSet();
return threadPoolTaskScheduler;
}
示例4: afterPropertiesSet
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet() throws Exception {
if (!this.initialized) {
super.afterPropertiesSet();
this.initialized = true;
if (this.taskScheduler == null) {
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
scheduler.setDaemon(true);
scheduler.setThreadNamePrefix(String.format("%s-%d-", getClass()
.getSimpleName(), poolId.incrementAndGet()));
scheduler.afterPropertiesSet();
this.taskScheduler = scheduler;
this.manageTaskScheduler = true;
}
for (RequestedSecret requestedSecret : requestedSecrets) {
this.renewals.put(requestedSecret, new LeaseRenewalScheduler(
this.taskScheduler));
}
}
}
示例5: PubSubTestBinder
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
public PubSubTestBinder(PubSub pubSub){
this.pubSub = pubSub;
PubSubMessageChannelBinder binder = new PubSubMessageChannelBinder(new PubSubResourceManager(pubSub));
GenericApplicationContext context = new GenericApplicationContext();
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
scheduler.setPoolSize(1);
scheduler.afterPropertiesSet();
context.getBeanFactory().registerSingleton(IntegrationContextUtils.TASK_SCHEDULER_BEAN_NAME, scheduler);
context.refresh();
binder.setApplicationContext(context);
binder.setCodec(new PojoCodec());
this.setBinder(binder);
}
示例6: setDeadlockGuard
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
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);
}
示例7: initGeoCache
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
@PostConstruct
public void initGeoCache() {
ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
threadPoolTaskScheduler.setPoolSize(1);
threadPoolTaskScheduler.afterPropertiesSet();
threadPoolTaskScheduler.schedule(() -> {
if (mongoTemplate.getCollection("geographical_area").count() == 0) {
logger.info("Geo area cache is empty, initializing it");
replicate();
}
}, new Date());
}
示例8: setUp
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
logger.debug("Setting up before '" + this.testName.getMethodName() + "'");
int port = SocketUtils.findAvailableTcpPort(61613);
this.activeMQBroker = new BrokerService();
this.activeMQBroker.addConnector("stomp://127.0.0.1:" + port);
this.activeMQBroker.setStartAsync(false);
this.activeMQBroker.setPersistent(false);
this.activeMQBroker.setUseJmx(false);
this.activeMQBroker.getSystemUsage().getMemoryUsage().setLimit(1024 * 1024 * 5);
this.activeMQBroker.getSystemUsage().getTempUsage().setLimit(1024 * 1024 * 5);
this.activeMQBroker.start();
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
taskScheduler.afterPropertiesSet();
this.client = new Reactor2TcpStompClient("127.0.0.1", port);
this.client.setMessageConverter(new StringMessageConverter());
this.client.setTaskScheduler(taskScheduler);
}
示例9: createDefaultTaskScheduler
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
private TaskScheduler createDefaultTaskScheduler() {
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
taskScheduler.afterPropertiesSet();
return taskScheduler;
}