当前位置: 首页>>代码示例>>Java>>正文


Java ThreadPoolTaskScheduler.afterPropertiesSet方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:24,代码来源:ProxyTaskScheduler.java

示例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);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-binder-redis,代码行数:20,代码来源:RedisTestBinder.java

示例3: batchTaskScheduler

import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
@Bean
public ThreadPoolTaskScheduler batchTaskScheduler() {
	ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
	threadPoolTaskScheduler.setPoolSize(10);
	threadPoolTaskScheduler.afterPropertiesSet();
	return threadPoolTaskScheduler;
}
 
开发者ID:namics,项目名称:spring-batch-support,代码行数:8,代码来源:TaskExecutorBatchConfigurer.java

示例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));
		}
	}
}
 
开发者ID:spring-projects,项目名称:spring-vault,代码行数:28,代码来源:SecretLeaseContainer.java

示例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);

}
 
开发者ID:viniciusccarvalho,项目名称:spring-cloud-stream-binder-pubsub,代码行数:15,代码来源:PubSubTestBinder.java

示例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);
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:10,代码来源:Core.java

示例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());
}
 
开发者ID:ozwillo,项目名称:ozwillo-portal,代码行数:13,代码来源:GeographicalAreaCache.java

示例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);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:24,代码来源:Reactor2TcpStompClientTests.java

示例9: createDefaultTaskScheduler

import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
private TaskScheduler createDefaultTaskScheduler() {
  ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
  taskScheduler.afterPropertiesSet();
  return taskScheduler;
}
 
开发者ID:lfridael,项目名称:spring-file-upload-storage,代码行数:6,代码来源:CleanupExpiredFilesJob.java


注:本文中的org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler.afterPropertiesSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。