javax.ejb.Schedule类的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中javax.ejb.Schedule类的一些代码示例,展示了Schedule类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Schedule类的具体详情如下:
包路径:javax.ejb.Schedule
类名称:Schedule

Schedule介绍

暂无

代码示例

代码示例来源:origin: javaee-samples/javaee7-samples

@Schedule(hour = "*", minute = "*", second = "*/5", info = "Every 5 second timer")
public void fastAutomaticallyScheduled(Timer timer) {
  fireEvent(timer);
}

代码示例来源:origin: com.caucho/resin

= new CronExpression(schedule.second(),
            schedule.minute(),
            schedule.hour(), 
            schedule.dayOfWeek(),
            schedule.dayOfMonth(), 
            schedule.month(),
            schedule.year());
if (! schedule.timezone().trim().equals("")) {
 timezone = TimeZone.getTimeZone(schedule.timezone());
         cronExpression, trigger, schedule.info());

代码示例来源:origin: org.glassfish.main.ejb/ejb-container

sd.setSecond(sch.second());
sd.setMinute(sch.minute());
sd.setHour(sch.hour());
sd.setDayOfMonth(sch.dayOfMonth());
sd.setMonth(sch.month());
sd.setDayOfWeek(sch.dayOfWeek());
sd.setYear(sch.year());
sd.setTimezone(sch.timezone());
sd.setPersistent(sch.persistent());
sd.setInfo(sch.info());
sd.setTimeoutMethod(new MethodDescriptor(annMethod));

代码示例来源:origin: javaee-samples/javaee7-samples

@Schedule(hour = "*", minute = "*", second = "*/10", info = "Every 10 second timer")
public void slowlyAutomaticallyScheduled(Timer timer) {
  fireEvent(timer);
}

代码示例来源:origin: org.apache.openejb/openejb-core

timer.setPersistent(schedule.persistent());
timer.setInfo(schedule.info() == null || schedule.info().isEmpty() ? null : schedule.info());
timer.setTimezone(schedule.timezone() == null || schedule.timezone().isEmpty() ? null : schedule.timezone());
timerSchedule.setSecond(schedule.second());
timerSchedule.setMinute(schedule.minute());
timerSchedule.setHour(schedule.hour());
timerSchedule.setDayOfWeek(schedule.dayOfWeek());
timerSchedule.setDayOfMonth(schedule.dayOfMonth());
timerSchedule.setMonth(schedule.month());
timerSchedule.setYear(schedule.year());
timer.setSchedule(timerSchedule);

代码示例来源:origin: javaee-samples/javaee7-samples

@Schedule(hour = "*", minute = "0", second = "0", persistent = false)
public void myJob() {
  executedBatchs.add(BatchRuntime.getJobOperator().start("myJob", new Properties()));
  afterRun();
}

代码示例来源:origin: org.apache.tomee/openejb-core

timer.setPersistent(schedule.persistent());
timer.setInfo(schedule.info() == null || schedule.info().isEmpty() ? null : schedule.info());
timer.setTimezone(schedule.timezone() == null || schedule.timezone().isEmpty() ? null : schedule.timezone());
timerSchedule.setSecond(schedule.second());
timerSchedule.setMinute(schedule.minute());
timerSchedule.setHour(schedule.hour());
timerSchedule.setDayOfWeek(schedule.dayOfWeek());
timerSchedule.setDayOfMonth(schedule.dayOfMonth());
timerSchedule.setMonth(schedule.month());
timerSchedule.setYear(schedule.year());
timer.setSchedule(timerSchedule);

代码示例来源:origin: javaee-samples/javaee7-samples

@Schedule(hour = "*", minute = "*", second = "*/5", info = "Every 5 second timer")
public void printDate() {
  Collection<Timer> timers = ctx.getTimerService().getAllTimers();
  for (Timer t : timers) {
    pingEvent.fire(new Ping(t.getInfo().toString()));
  }
}

代码示例来源:origin: org.glassfish.ejb/ejb-container

sd.setSecond(sch.second());
sd.setMinute(sch.minute());
sd.setHour(sch.hour());
sd.setDayOfMonth(sch.dayOfMonth());
sd.setMonth(sch.month());
sd.setDayOfWeek(sch.dayOfWeek());
sd.setYear(sch.year());
sd.setTimezone(sch.timezone());
sd.setPersistent(sch.persistent());
sd.setInfo(sch.info());
sd.setTimeoutMethod(new MethodDescriptor(annMethod));

代码示例来源:origin: agoncal/agoncal-book-javaee7

@Schedule(minute = "*/10", hour = "*", persistent = false)
 public void refreshCache() {
  // ...
 }
}

代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core

for (javax.ejb.Schedule schedule : list) {
  Schedule s = new Schedule();
  s.setSecond(schedule.second());
  s.setMinute(schedule.minute());
  s.setHour(schedule.hour());
  s.setDayOfWeek(schedule.dayOfWeek());
  s.setDayOfMonth(schedule.dayOfMonth());
  s.setMonth(schedule.month());
  s.setYear(schedule.year());
  s.setPersistent(schedule.persistent());
  s.setInfo(schedule.info());
  methodSchedule.getSchedule().add(s);

代码示例来源:origin: liimaorg/liima

@Schedule(hour = "*", minute = "*/20", persistent = false)
public void forceReloadingOfLists() {
  reloadDeployableRoleList = true;
  reloadRolesAndPermissionsList = true;
  reloadUserRestrictionsList = true;
}

代码示例来源:origin: agoncal/agoncal-book-javaee7

@Schedule(dayOfMonth = "1", hour = "5", minute = "30")
public void statisticsItemsSold() {
 // ...
}

代码示例来源:origin: payara/Payara-Examples

@Schedule(hour = "*", minute = "*", second = "*/5", info = "Every 5 second timer", timezone = "UTC")
public void printSchedule() {
  logger.info("SimpleTimerBean Schedule Fired .... ");
}

代码示例来源:origin: agoncal/agoncal-book-javaee7

@Schedules({
    @Schedule(hour = "2"),
    @Schedule(hour = "14", dayOfWeek = "Wed")
})
public void generateReport() {
 // ...
}

代码示例来源:origin: akquinet/jbosscc-as7-examples

@Schedule(second="*/1", minute="*",hour="*", persistent=false)
public void schedule(){
  LOG.info("invoke schedule method {}", new Date());
}

代码示例来源:origin: org.ow2.sirocco.cloudmanager/sirocco-cloudmanager-core-manager

@Schedule(minute = "*/1", persistent = false)
public void cleanupWatchers() {
  ResourceWatcherManager.logger.info("Cleaning up resource watchers...");
  for (Iterator<Future<Void>> it = this.watchers.iterator(); it.hasNext();) {
    Future<Void> watcher = it.next();
    if (watcher.isDone()) {
      it.remove();
    }
  }
  ResourceWatcherManager.logger.info(this.watchers.size() + " resource watchers in progress");
}

代码示例来源:origin: payara/Payara-Examples

@Schedule(hour = "*", minute = "*", second = "*/5", info = "Every 5 second timer", timezone = "UTC", persistent = false)
public void myTimer() {
  try (Connection conn = factory.createConnection()){
    Session sess = conn.createSession(true,Session.AUTO_ACKNOWLEDGE);
    sess.createProducer(queue).send(sess.createTextMessage("This is a test at " + new Date()));
  } catch (JMSException ex) {
    Logger.getLogger(SendJMSMessage.class.getName()).log(Level.SEVERE, null, ex);
  }
}

代码示例来源:origin: aerogear/aerogear-unifiedpush-server

/**
   * Job that triggers a delete of outdated metric information from the Server.
   *
   * Note: Occurring every day at midnight in the default time zone associated with the container
   * in which the application is executing. These are the default values from the @Schedule annotation.
   */
  @Schedule
  public void deleteOutdatedFlatMetrics(){
    logger.trace("scheduled deletion for outdated push info data");
    service.deleteOutdatedFlatPushInformationData();
  }
}

代码示例来源:origin: payara/Payara-Examples

@Schedule(hour = "*", minute="*", second = "*/1", persistent = false)
public void generatePrice() {
  
  String symbol = "PAYARA";
  Stock stock = new Stock(symbol,"",(Math.random()*100.0) + 10.0);
  System.out.println(stock);
  stockEvents.fire(stock);
  
}

相关文章