當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。