• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Schedule类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createScheduleContext

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
public void createScheduleContext(Schedule schedule)
{
	synchronized (scheduleContextQueue)
	{
		if(scheduleIdToScheduleContextMap.containsKey(schedule.getId())) {
			// not intended to be an error
			logger.info("schedule context " + schedule.getId() + " '" + schedule.getName() + "' already exists.");
		} else {
			// build a new schedule context
			ScheduleContext scheduleContext = new ScheduleContext(schedule);

			// store a mapping of schedule id to schedule context
			scheduleIdToScheduleContextMap.put(schedule.getId(), scheduleContext);

			// enqueue the context
			scheduleContextQueue.add(scheduleContext);
			logger.info("created schedule context " + scheduleContext.getInfo()
					+ " initial start time " + scheduleContext.getNextTime().toString());
		}
	}
}
 
开发者ID:edgexfoundry,项目名称:device-modbus,代码行数:22,代码来源:Scheduler.java


示例2: updateScheduleContext

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
public void updateScheduleContext(Schedule schedule)
{
	synchronized (scheduleContextQueue)
	{
		if(!scheduleIdToScheduleContextMap.containsKey(schedule.getId())) {
			// not intended to be an error
			logger.error("failed to find schedule for " + schedule.getId() + " " + schedule.getName());
		} else {
			// remove the schedule context from the queue
			scheduleContextQueue.remove(scheduleIdToScheduleContextMap.get(schedule.getId()));

			// update the schedule
			scheduleIdToScheduleContextMap.get(schedule.getId()).reset(schedule);
			
			// enqueue the context
			ScheduleContext scheduleContext = scheduleIdToScheduleContextMap.get(schedule.getId());
			scheduleContextQueue.add(scheduleContext);
			logger.info("updated schedule " + scheduleContext.getInfo()
					+ " initial start time " + scheduleContext.getNextTime().toString());
		}
	}
}
 
开发者ID:edgexfoundry,项目名称:device-modbus,代码行数:23,代码来源:Scheduler.java


示例3: addScheduleEventToScheduleContext

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
public void addScheduleEventToScheduleContext(ScheduleEvent scheduleEvent)
{
	synchronized (scheduleContextQueue)
	{
		// get the schedule for the event
		Schedule schedule = scheduleClient.scheduleForName(scheduleEvent.getSchedule());
		if(schedule == null) {
			logger.error("failed to add schedule event " + scheduleEvent.getId() + " '" + scheduleEvent.getName() + "' " + 
					"schedule '" + scheduleEvent.getSchedule() + "' not found");
		} else {
			// ensure a schedule context exists
			createScheduleContext(schedule);
			
			// add the schedule event to the context
			scheduleIdToScheduleContextMap.get(schedule.getId()).addScheduleEvent(scheduleEvent);

			// add to the schedule event id to schedule id map
			scheduleEventIdToScheduleIdMap.put(scheduleEvent.getId(), schedule.getId());
		}
	}
}
 
开发者ID:edgexfoundry,项目名称:device-modbus,代码行数:22,代码来源:Scheduler.java


示例4: addDefaultSchedules

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
public void addDefaultSchedules() {		
	
	for (int i = 0; i < defaultSchedules.getSize(); i++) {
		String name = defaultSchedules.getName()[i];
		String start = defaultSchedules.getStart()[i];
		String end = defaultSchedules.getEnd()[i];
		String frequency = defaultSchedules.getFrequency()[i];
		String cron = defaultSchedules.getCron()[i];
		Boolean runOnce = Boolean.valueOf(defaultSchedules.getRunOnce()[i]);
		
		Schedule schedule = new Schedule(name, start, end, frequency, cron, runOnce);
			
		try {
			scheduleClient.add(schedule);
		} catch (ClientErrorException e) {
			// Ignore if the schedule is already present
			// schedule.setId(scheduleClient.scheduleForName(name).getId());
			// scheduleClient.update(schedule);
		}
	}
	
}
 
开发者ID:edgexfoundry,项目名称:device-modbus,代码行数:23,代码来源:Scheduler.java


示例5: parseTime

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
private ZonedDateTime parseTime(String time) {
  // TODO : may support more than one format at some point
  DateTimeFormatter dtf =
      DateTimeFormatter.ofPattern(Schedule.DATETIME_FORMATS[0]).withZone(ZoneId.systemDefault());
  ZonedDateTime zdt = null;

  try {
    zdt = ZonedDateTime.parse(time, dtf);
  } catch (DateTimeParseException e) {
    logger.debug("parseTime() failed to parse '" + time + "'");
    // throw an exception
    // mark as complete (via max iterations?)
  }

  return zdt;
}
 
开发者ID:mgjeong,项目名称:device-opcua-java,代码行数:17,代码来源:ScheduleContext.java


示例6: createScheduleContext

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
public void createScheduleContext(Schedule schedule) {
  synchronized (scheduleContextQueue) {
    if (scheduleIdToScheduleContextMap.containsKey(schedule.getId())) {
      // not intended to be an error
      logger.info("schedule context " + schedule.getId() + " '" + schedule.getName()
          + "' already exists.");
    } else {
      // build a new schedule context
      ScheduleContext scheduleContext = new ScheduleContext(schedule);

      // store a mapping of schedule id to schedule context
      scheduleIdToScheduleContextMap.put(schedule.getId(), scheduleContext);

      // enqueue the context
      scheduleContextQueue.add(scheduleContext);
      logger.info("created schedule context " + scheduleContext.getInfo() + " initial start time "
          + scheduleContext.getNextTime().toString());
    }
  }
}
 
开发者ID:mgjeong,项目名称:device-opcua-java,代码行数:21,代码来源:Scheduler.java


示例7: updateScheduleContext

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
public void updateScheduleContext(Schedule schedule) {
  synchronized (scheduleContextQueue) {
    if (!scheduleIdToScheduleContextMap.containsKey(schedule.getId())) {
      // not intended to be an error
      logger.error("failed to find schedule for " + schedule.getId() + " " + schedule.getName());
    } else {
      // remove the schedule context from the queue
      scheduleContextQueue.remove(scheduleIdToScheduleContextMap.get(schedule.getId()));

      // update the schedule
      scheduleIdToScheduleContextMap.get(schedule.getId()).reset(schedule);

      // enqueue the context
      ScheduleContext scheduleContext = scheduleIdToScheduleContextMap.get(schedule.getId());
      scheduleContextQueue.add(scheduleContext);
      logger.info("updated schedule " + scheduleContext.getInfo() + " initial start time "
          + scheduleContext.getNextTime().toString());
    }
  }
}
 
开发者ID:mgjeong,项目名称:device-opcua-java,代码行数:21,代码来源:Scheduler.java


示例8: addScheduleEventToScheduleContext

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
public void addScheduleEventToScheduleContext(ScheduleEvent scheduleEvent) {
  synchronized (scheduleContextQueue) {
    // get the schedule for the event
    Schedule schedule = scheduleClient.scheduleForName(scheduleEvent.getSchedule());
    if (schedule == null) {
      logger.error(
          "failed to add schedule event " + scheduleEvent.getId() + " '" + scheduleEvent.getName()
              + "' " + "schedule '" + scheduleEvent.getSchedule() + "' not found");
    } else {
      // ensure a schedule context exists
      createScheduleContext(schedule);

      // add the schedule event to the context
      scheduleIdToScheduleContextMap.get(schedule.getId()).addScheduleEvent(scheduleEvent);

      // add to the schedule event id to schedule id map
      scheduleEventIdToScheduleIdMap.put(scheduleEvent.getId(), schedule.getId());
    }
  }
}
 
开发者ID:mgjeong,项目名称:device-opcua-java,代码行数:21,代码来源:Scheduler.java


示例9: addDefaultSchedules

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
public void addDefaultSchedules() {

    for (int i = 0; i < defaultSchedules.getSize(); i++) {
      String name = defaultSchedules.getName()[i];
      String start = defaultSchedules.getStart()[i];
      String end = defaultSchedules.getEnd()[i];
      String frequency = defaultSchedules.getFrequency()[i];
      String cron = defaultSchedules.getCron()[i];
      Boolean runOnce = Boolean.valueOf(defaultSchedules.getRunOnce()[i]);
      Schedule schedule = new Schedule(name, start, end, frequency, cron, runOnce);

      try {
        scheduleClient.add(schedule);
      } catch (ClientErrorException e) {
        // Ignore if the schedule is already present
        // schedule.setId(scheduleClient.scheduleForName(name).getId());
        // scheduleClient.update(schedule);
      }
    }

  }
 
开发者ID:mgjeong,项目名称:device-opcua-java,代码行数:22,代码来源:Scheduler.java


示例10: addDefaultSchedules

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
public void addDefaultSchedules() {

    for (int i = 0; i < defaultSchedules.getSize(); i++) {
      String name = defaultSchedules.getName()[i];
      String start = defaultSchedules.getStart()[i];
      String end = defaultSchedules.getEnd()[i];
      String frequency = defaultSchedules.getFrequency()[i];
      String cron = defaultSchedules.getCron()[i];
      Boolean runOnce = Boolean.valueOf(defaultSchedules.getRunOnce()[i]);

      Schedule schedule = new Schedule(name, start, end, frequency, cron, runOnce);

      try {
        scheduleClient.add(schedule);
      } catch (ClientErrorException e) {
        // Ignore if the schedule is already present
        // schedule.setId(scheduleClient.scheduleForName(name).getId());
        // scheduleClient.update(schedule);
      }
    }

  }
 
开发者ID:edgexfoundry,项目名称:device-bacnet,代码行数:23,代码来源:Scheduler.java


示例11: parseTime

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
private ZonedDateTime parseTime(String time) {
  // TODO : may support more than one format at some point
  DateTimeFormatter dtf = DateTimeFormatter.ofPattern(Schedule.DATETIME_FORMATS[0])
      .withZone(ZoneId.systemDefault());
  ZonedDateTime zdt = null;

  try {
    zdt = ZonedDateTime.parse(time, dtf);
  } catch (DateTimeParseException e) {
    logger.debug("parseTime() failed to parse '" + time + "'");
    // throw an exception
    // mark as complete (via max iterations?)
  }

  return zdt;
}
 
开发者ID:edgexfoundry,项目名称:device-bluetooth,代码行数:17,代码来源:ScheduleContext.java


示例12: parseTime

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
private ZonedDateTime parseTime(String time) {
	// TODO : may support more than one format at some point
	DateTimeFormatter dtf = DateTimeFormatter.ofPattern(Schedule.DATETIME_FORMATS[0]).withZone(ZoneId.systemDefault());
	ZonedDateTime zdt = null;
	try {
		zdt = ZonedDateTime.parse(time, dtf);
	} catch (DateTimeParseException e) {
		logger.debug("parseTime() failed to parse '" + time + "'");
		// throw an exception
		// mark as complete (via max iterations?)
	}
	return zdt;
}
 
开发者ID:edgexfoundry,项目名称:device-modbus,代码行数:14,代码来源:ScheduleContext.java


示例13: updateScheduleEventInScheduleContext

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
public void updateScheduleEventInScheduleContext(ScheduleEvent scheduleEvent)
{
	synchronized (scheduleContextQueue)
	{
		// get the schedule for the event
		String scheduleId = scheduleEventIdToScheduleIdMap.get(scheduleEvent.getId());
		if(scheduleId == null) {
			logger.error("failed to update schedule event " + scheduleEvent.getName() + 
					" current schedule " + scheduleEvent.getId() + " not found");
		} else {
			Schedule schedule = scheduleClient.scheduleForName(scheduleEvent.getSchedule());
			if(schedule == null) {
				logger.error("failed to update schedule event " + scheduleEvent.getName() + 
						" schedule " + scheduleEvent.getSchedule() + " not found");
			} else {
				// see if the event switched schedules
				if(scheduleId != schedule.getId()) {
					if(!scheduleIdToScheduleContextMap.containsKey(scheduleId)) {
						logger.error("failed to switch schedule event " + scheduleEvent.getId() + ", schedule " + scheduleId + " not found");
					} else {
						// remove the schedule event from the old schedule
						removeScheduleEventById(scheduleEvent.getId());
						// add the schedule event to the new schedule
						addScheduleEventToScheduleContext(scheduleEvent);
					}
				} else {
					// update the schedule event in place
					if(!scheduleIdToScheduleContextMap.containsKey(schedule.getId())) {
						logger.error("failed to update schedule event " + scheduleEvent.getId() + ", schedule " + schedule.getId() + " not found");
					} else {
						// update the schedule event in the context
						scheduleIdToScheduleContextMap.get(schedule.getId()).updateScheduleEvent(scheduleEvent);
					}
				}
			}
		}
	}
}
 
开发者ID:edgexfoundry,项目名称:device-modbus,代码行数:39,代码来源:Scheduler.java


示例14: updateScheduleEventInScheduleContext

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
public void updateScheduleEventInScheduleContext(ScheduleEvent scheduleEvent) {
  synchronized (scheduleContextQueue) {
    // get the schedule for the event
    String scheduleId = scheduleEventIdToScheduleIdMap.get(scheduleEvent.getId());
    if (scheduleId == null) {
      logger.error("failed to update schedule event " + scheduleEvent.getName()
          + " current schedule " + scheduleEvent.getId() + " not found");
    } else {
      Schedule schedule = scheduleClient.scheduleForName(scheduleEvent.getSchedule());
      if (schedule == null) {
        logger.error("failed to update schedule event " + scheduleEvent.getName() + " schedule "
            + scheduleEvent.getSchedule() + " not found");
      } else {
        // see if the event switched schedules
        if (scheduleId != schedule.getId()) {
          if (!scheduleIdToScheduleContextMap.containsKey(scheduleId)) {
            logger.error("failed to switch schedule event " + scheduleEvent.getId()
                + ", schedule " + scheduleId + " not found");
          } else {
            // remove the schedule event from the old schedule
            removeScheduleEventById(scheduleEvent.getId());
            // add the schedule event to the new schedule
            addScheduleEventToScheduleContext(scheduleEvent);
          }
        } else {
          // update the schedule event in place
          if (!scheduleIdToScheduleContextMap.containsKey(schedule.getId())) {
            logger.error("failed to update schedule event " + scheduleEvent.getId()
                + ", schedule " + schedule.getId() + " not found");
          } else {
            // update the schedule event in the context
            scheduleIdToScheduleContextMap.get(schedule.getId())
                .updateScheduleEvent(scheduleEvent);
          }
        }
      }
    }
  }
}
 
开发者ID:mgjeong,项目名称:device-opcua-java,代码行数:40,代码来源:Scheduler.java


示例15: ScheduleContext

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
public ScheduleContext(Schedule schedule) {
	scheduleEvents = new LinkedHashMap<String, ScheduleEvent>();
	reset(schedule);
}
 
开发者ID:edgexfoundry,项目名称:device-modbus,代码行数:5,代码来源:ScheduleContext.java


示例16: ScheduleContext

import org.edgexfoundry.domain.meta.Schedule; //导入依赖的package包/类
public ScheduleContext(Schedule schedule) {
  scheduleEvents = new LinkedHashMap<String, ScheduleEvent>();
  reset(schedule);
}
 
开发者ID:mgjeong,项目名称:device-opcua-java,代码行数:5,代码来源:ScheduleContext.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SimException类代码示例发布时间:2022-05-22
下一篇:
Java DeferredFileOutputStream类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap