Java Timer.cancel方法代码示例

本文整理汇总了Java中javax.ejb.Timer.cancel方法的典型用法代码示例。如果您正苦于以下问题:Java Timer.cancel方法的具体用法?Java Timer.cancel怎么用?Java Timer.cancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.ejb.Timer的用法示例。


Java Timer.cancel方法代码示例

在下文中一共展示了Timer.cancel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setTimer

import javax.ejb.Timer; //导入方法依赖的package包/类
@PostConstruct
public void setTimer() {
	Collection<Timer> timers = timerService.getTimers();
	for (Timer timerVM : timers) {
		if (VM_TIMER_INFO.equals(timerVM.getInfo())) {
			timerVM.cancel();
		}
	}
	logger.info("Timer for subscription VMs will be created.");
	try {
		String timerIntervalSetting = configService
				.getProxyConfigurationSetting(PlatformConfigurationKey.APP_TIMER_REFRESH_SUBSCRIPTIONS);
		long interval = Long.parseLong(timerIntervalSetting);
		timerService.createTimer(0, interval, VM_TIMER_INFO);
		// timerService.createIntervalTimer(new Date(), interval,
		// new TimerConfig());
	} catch (ConfigurationException e) {
		timerService.createTimer(0, DEFAULT_TIMER_INTERVAL, VM_TIMER_INFO);
		logger.info("Timer interval for refreshing subcription VMs not set, switch to default 10 min.");
	}
} 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:22,代码来源:TimerRefreshSubscriptions.java

示例2: isTimerCreated

import javax.ejb.Timer; //导入方法依赖的package包/类
boolean isTimerCreated(TimerType timerType, TimerService timerService) {
    for (Timer timer : ParameterizedTypes.iterable(
            timerService.getTimers(), Timer.class)) {
        TimerType tType = (TimerType) timer.getInfo();
        if ((TimerType.BILLING_INVOCATION.equals(tType) && TimerType.BILLING_INVOCATION
                .equals(timerType))
                || (TimerType.DISCOUNT_END_CHECK.equals(tType) && TimerType.DISCOUNT_END_CHECK
                        .equals(timerType))) {
            long currentTime = System.currentTimeMillis();
            if (timer.getNextTimeout().getTime() - currentTime > 0) {
                return true;
            } else {
                timer.cancel();
            }
        }
    }
    return false;
} 
开发者ID:servicecatalog,项目名称:oscm,代码行数:19,代码来源:TimerServiceBean.java

示例3: cancelObsoleteTimer

import javax.ejb.Timer; //导入方法依赖的package包/类
/**
 * Determines all currently queued timers and cancel timer with target type.
 * 
 * @param timerService
 *            The timer service.
 * @param timerType
 *            The timer type.
 */
private void cancelObsoleteTimer(TimerService timerService,
        TimerType timerType) {

    for (Timer timer : ParameterizedTypes.iterable(
            timerService.getTimers(), Timer.class)) {
        Serializable info = timer.getInfo();
        if (info != null && info instanceof TimerType && timerType == info) {
            TimerType type = (TimerType) info;
            timer.cancel();
            logger.logInfo(Log4jLogger.SYSTEM_LOG,
                    LogMessageIdentifier.INFO_TIMER_REMOVED,
                    String.valueOf(type));
        }
    }

} 
开发者ID:servicecatalog,项目名称:oscm,代码行数:25,代码来源:TimerServiceBean.java

示例4: stop

import javax.ejb.Timer; //导入方法依赖的package包/类
@PreDestroy
public void stop() {
    log.info("Stop all existing IOCListProtostreamGenerator timers.");
    for (Timer timer : timerService.getTimers()) {
        log.fine("Stop IOCListProtostreamGenerator timer: " + timer.getInfo());
        timer.cancel();
    }
} 
开发者ID:whalebone,项目名称:sinkit-core,代码行数:9,代码来源:IocProtostreamGenerator.java

示例5: cancelTimers

import javax.ejb.Timer; //导入方法依赖的package包/类
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void cancelTimers() {
    Collection<Timer> timers = timerService.getTimers();
    for (Timer th : timers) {
        if (APP_TIMER_INFO.equals(th.getInfo())) {
            th.cancel();
            return;
        }
    }
} 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:11,代码来源:APPTimerServiceBean.java

示例6: cancelAllObsoleteTimer

import javax.ejb.Timer; //导入方法依赖的package包/类
/**
 * Determines all currently queued timers and cancels them.
 */
private void cancelAllObsoleteTimer() {
    for (Timer timer : ParameterizedTypes.iterable(ctx.getTimerService()
            .getTimers(), Timer.class)) {
        Serializable info = timer.getInfo();
        if (info != null && info instanceof TimerType) {
            TimerType type = (TimerType) info;
            timer.cancel();
            logger.logInfo(Log4jLogger.SYSTEM_LOG,
                    LogMessageIdentifier.INFO_TIMER_REMOVED,
                    String.valueOf(type));
        }
    }

} 
开发者ID:servicecatalog,项目名称:oscm,代码行数:18,代码来源:TimerServiceBean.java

示例7: cancelCronJob

import javax.ejb.Timer; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void cancelCronJob() {
	for (Timer timer : (Collection<Timer>) timerService.getTimers()) {
		if (timer.getInfo() instanceof String) {
			if (((String) timer.getInfo())
					.equals(TIME_OUT_INFO)) {
				timer.cancel();
				log.info("Cancel timer: " + timer.toString());
				return;
			}
		}
	}
} 
开发者ID:salimvanak,项目名称:myWMS,代码行数:14,代码来源:ERPQueryInventoryBean.java

示例8: cancelCronJob

import javax.ejb.Timer; //导入方法依赖的package包/类
public void cancelCronJob() {
	TimerService timerService = ctx.getTimerService();
	for (Timer timer : (Collection<Timer>) timerService.getTimers()) {
		if (timer.getInfo() instanceof String) {
			if (((String) timer.getInfo())
					.equals(LocationSanityBusiness.TIME_OUT_INFO)) {
				timer.cancel();
				log.info("Cancel timer: " + timer.toString());
				return;
			}
		}
	}
} 
开发者ID:salimvanak,项目名称:myWMS,代码行数:14,代码来源:LocationSanityBusinessBean.java

示例9: stopTimer

import javax.ejb.Timer; //导入方法依赖的package包/类
@Override
public void stopTimer(String timerName) {
   for (Timer timer : timerService.getTimers()) {
      if (timerName.equals(((SchedulerTimerConfig) timer.getInfo()).getSchedulerName())) {
         timer.cancel();
         log.info("Scheduler EE Timer " + timerName + " stopped");
         return;
      }
   }
} 
开发者ID:Wolfgang-Winter,项目名称:cibet,代码行数:11,代码来源:EESchedulerTask.java

示例10: cancelTimer

import javax.ejb.Timer; //导入方法依赖的package包/类
/**	
 * Cancel an existing timer
 */
   private void cancelTimer() {
	if (timerService.getTimers() != null && timerService.getTimers().size() > 0) {
		System.out.println("Cancelling U-QASAR adapter data update timer ");

		for (Timer timer : timerService.getTimers()) {
			String timerId  = timer.getInfo().toString();
			System.out.println("Existing timers:[TimerID: " +timerId +"]");
			if (timerId.equals(ADAPTERDATA_TIMER)) {
				timer.cancel();
			}
		}
	}
} 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:17,代码来源:AdapterSettingsService.java

示例11: deleteJob

import javax.ejb.Timer; //导入方法依赖的package包/类
public void deleteJob(BatchJobConfiguration batchJobConfiguration) {
    Timer timer = getTimer(batchJobConfiguration);
    if (timer != null) {
        BatchJobConfiguration jobConfig = (BatchJobConfiguration)timer.getInfo();
        logger.debug("Delete Timer " + jobConfig.getType().getDisplayName());
        timer.cancel();
    }
    batchJobConfigurationDAO.delete(batchJobConfiguration.getId());
} 
开发者ID:felixhusse,项目名称:bookery,代码行数:10,代码来源:BatchJobService.java

示例12: cancelTimer

import javax.ejb.Timer; //导入方法依赖的package包/类
/**
 * Cancels the existing timer
 */
   private void cancelTimer() {

	if (timerService.getTimers() != null
			&& timerService.getTimers().size() > 0) {
		logger.info("Cancelling U-QASAR rule timer...");

		for (Timer timer : timerService.getTimers()) {
			if (timer.getInfo().toString().contains(RULES_TIMER_ABBR)) {
				logger.info("Cancelling timer " + timer.getInfo());
				timer.cancel();
			}
		}
	}
} 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:18,代码来源:RulesTimer.java

示例13: stop

import javax.ejb.Timer; //导入方法依赖的package包/类
@PreDestroy
public void stop() {
    log.info("Stop all existing WhitelistProtostreamGenerator timers.");
    for (Timer timer : timerService.getTimers()) {
        log.fine("Stop WhitelistProtostreamGenerator timer: " + timer.getInfo());
        timer.cancel();
    }
} 
开发者ID:whalebone,项目名称:sinkit-core,代码行数:9,代码来源:WhitelistProtostreamGenerator.java

示例14: stop

import javax.ejb.Timer; //导入方法依赖的package包/类
@PreDestroy
public void stop() {
    log.info("Stop all existing IoCWithCustomProtostreamGenerator timers.");
    for (Timer timer : timerService.getTimers()) {
        log.fine("Stop IoCWithCustomProtostreamGenerator timer: " + timer.getInfo());
        timer.cancel();
    }
} 
开发者ID:whalebone,项目名称:sinkit-core,代码行数:9,代码来源:IoCWithCustomProtostreamGenerator.java

示例15: stopTimer

import javax.ejb.Timer; //导入方法依赖的package包/类
@PreDestroy
public void stopTimer() {
	for (Timer timer : timerService.getTimers()) {
		timer.cancel();
	}
} 
开发者ID:victorrentea,项目名称:training,代码行数:7,代码来源:Business.java

本文标签属性:

示例:示例志愿表

代码:代码生成器

java:java自行车

Timer:timer空调上什么意思

cancel:cancel是什么意思

上一篇:Java NetworkService类代码示例
下一篇:C++ ArrayRef::begin方法代码示例

为您推荐