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


Java PeriodicTrigger类代码示例

本文整理汇总了Java中org.springframework.scheduling.support.PeriodicTrigger的典型用法代码示例。如果您正苦于以下问题:Java PeriodicTrigger类的具体用法?Java PeriodicTrigger怎么用?Java PeriodicTrigger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PeriodicTrigger类属于org.springframework.scheduling.support包,在下文中一共展示了PeriodicTrigger类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: periodicTrigger

import org.springframework.scheduling.support.PeriodicTrigger; //导入依赖的package包/类
@Bean(name = TriggerConstants.TRIGGER_BEAN_NAME)
@Conditional(PeriodicTriggerCondition.class)
public Trigger periodicTrigger() {
	PeriodicTrigger trigger = new PeriodicTrigger(triggerProperties.getFixedDelay(),
			triggerProperties.getTimeUnit());
	trigger.setInitialDelay(triggerProperties.getInitialDelay());
	return trigger;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-app-starters,代码行数:9,代码来源:TriggerConfiguration.java

示例2: defaultStreamSpanReporterPoller

import org.springframework.scheduling.support.PeriodicTrigger; //导入依赖的package包/类
@Bean(name = StreamSpanReporter.POLLER)
@ConditionalOnMissingBean(name = StreamSpanReporter.POLLER)
public PollerMetadata defaultStreamSpanReporterPoller(SleuthStreamProperties sleuth) {
	PollerMetadata poller = new PollerMetadata();
	poller.setTrigger(new PeriodicTrigger(sleuth.getPoller().getFixedDelay()));
	poller.setMaxMessagesPerPoll(sleuth.getPoller().getMaxMessagesPerPoll());
	return poller;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-sleuth,代码行数:9,代码来源:SleuthStreamAutoConfiguration.java

示例3: assertPollerConfiguration

import org.springframework.scheduling.support.PeriodicTrigger; //导入依赖的package包/类
private void assertPollerConfiguration(PollerMetadata poller,
		long expectedMaxMessages, long expectedFixedDelay) {
	assertThat(poller.getMaxMessagesPerPoll()).isEqualTo(expectedMaxMessages);
	Trigger trigger = poller.getTrigger();
	assertThat(trigger).isInstanceOf(PeriodicTrigger.class);
	TriggerContext triggerContext = new SimpleTriggerContext(LAST_SCHEDULED_DATE,
			LAST_EXECUTED_DATE, LAST_COMPLETED_DATE);
	Date nextExecution = trigger.nextExecutionTime(triggerContext);
	assertThat(nextExecution.getTime())
			.isEqualTo(LAST_COMPLETED_DATE.getTime() + expectedFixedDelay);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-sleuth,代码行数:12,代码来源:SleuthStreamAutoConfigurationTest.java

示例4: customPoller

import org.springframework.scheduling.support.PeriodicTrigger; //导入依赖的package包/类
@Bean(name = StreamSpanReporter.POLLER)
PollerMetadata customPoller() {
	PollerMetadata poller = new PollerMetadata();
	poller.setMaxMessagesPerPoll(500);
	poller.setTrigger(new PeriodicTrigger(5000L));
	return poller;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-sleuth,代码行数:8,代码来源:SleuthStreamAutoConfigurationTest.java

示例5: xmlFilePoller

import org.springframework.scheduling.support.PeriodicTrigger; //导入依赖的package包/类
@Bean
public PollerMetadata xmlFilePoller() {
	PollerMetadata poller = new PollerMetadata();

	poller.setMaxMessagesPerPoll(config.getXmlFilesPerPoll());
	PeriodicTrigger trigger = new PeriodicTrigger(config.getXmlFilesPollInterval());
	trigger.setFixedRate(false);
	poller.setTrigger(trigger);

	return poller;
}
 
开发者ID:djarosz,项目名称:fopator,代码行数:12,代码来源:Fopator.java

示例6: defaultPoller

import org.springframework.scheduling.support.PeriodicTrigger; //导入依赖的package包/类
@Bean(name = PollerMetadata.DEFAULT_POLLER)
public PollerMetadata defaultPoller() {
	PollerMetadata pollerMetadata = new PollerMetadata();
	pollerMetadata.setTrigger(new PeriodicTrigger(10));
	return pollerMetadata;
}
 
开发者ID:mminella,项目名称:java-remote-partitioning,代码行数:7,代码来源:JobConfiguration.java

示例7: createPeriodicTrigger

import org.springframework.scheduling.support.PeriodicTrigger; //导入依赖的package包/类
private PeriodicTrigger createPeriodicTrigger(int timeout) {
  PeriodicTrigger trigger = new PeriodicTrigger(timeout, TimeUnit.MINUTES);
  trigger.setInitialDelay(timeout);
  return trigger;
}
 
开发者ID:Invizible,项目名称:Catdogtion,代码行数:6,代码来源:AuctionScheduler.java

示例8: defaultPoller

import org.springframework.scheduling.support.PeriodicTrigger; //导入依赖的package包/类
@Bean(name = PollerMetadata.DEFAULT_POLLER)
public PollerMetadata defaultPoller() {
    final PollerMetadata pollerMetadata = new PollerMetadata();
    pollerMetadata.setTrigger(new PeriodicTrigger(10));
    return pollerMetadata;
}
 
开发者ID:create1st,项目名称:spring-batch,代码行数:7,代码来源:IntegrationConfiguration.java

示例9: getPollerMetadata

import org.springframework.scheduling.support.PeriodicTrigger; //导入依赖的package包/类
public PollerMetadata getPollerMetadata() {
	PollerMetadata pollerMetadata = new PollerMetadata();
	pollerMetadata.setTrigger(new PeriodicTrigger(this.fixedDelay));
	pollerMetadata.setMaxMessagesPerPoll(this.maxMessagesPerPoll);
	return pollerMetadata;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream,代码行数:7,代码来源:DefaultPollerProperties.java

示例10: fixedDelay

import org.springframework.scheduling.support.PeriodicTrigger; //导入依赖的package包/类
/**
 * Create a schedule with fixed delay between job executions.
 *
 * @param fixedDelayMs Fixed delay in millis
 * @param initialDelayMs Initial delay in millis
 * @return Schedule
 * @since 0.24
 * @see ScheduledJobFuture#scheduleWithFixedDelay(long, long)
 */
public static Schedule fixedDelay(long fixedDelayMs, long initialDelayMs) {
    PeriodicTrigger pt = new PeriodicTrigger(fixedDelayMs);
    pt.setFixedRate(false);
    pt.setInitialDelay(initialDelayMs);
    return new Schedule(pt, "fixedDelayMs: " + fixedDelayMs);
}
 
开发者ID:bootique,项目名称:bootique-job,代码行数:16,代码来源:Schedule.java

示例11: fixedRate

import org.springframework.scheduling.support.PeriodicTrigger; //导入依赖的package包/类
/**
 * Create a schedule with fixed rate of launching job executions.
 *
 * @param fixedRateMs Fixed rate in millis
 * @param initialDelayMs Initial delay in millis
 * @return Schedule
 * @since 0.24
 * @see ScheduledJobFuture#scheduleAtFixedRate(long, long)
 */
public static Schedule fixedRate(long fixedRateMs, long initialDelayMs) {
    PeriodicTrigger pt = new PeriodicTrigger(fixedRateMs);
    pt.setFixedRate(true);
    pt.setInitialDelay(initialDelayMs);
    return new Schedule(pt, "fixedRateMs: " + fixedRateMs);
}
 
开发者ID:bootique,项目名称:bootique-job,代码行数:16,代码来源:Schedule.java


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