javax.ejb.Schedule.<init>()方法的使用及代码示例

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

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

Schedule.<init>介绍

暂无

代码示例

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

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

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

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

代码示例来源: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: 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: agoncal/agoncal-book-javaee7

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

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

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

代码示例来源: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: org.jboss.pnc/bpm

/**
 * The finished BPM tasks has to be cleaned up regularly
 * Immediate cleanup is not usable because of NCL-2300
 */
@Schedule(hour = "*")
public void bpmTasksCleanup() {
  bpmManager.cleanup();
}

代码示例来源: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);
  
}

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

@Schedule(hour = "*", minute = "*", second = "*/10", info = "Every 10 second timer")
public void printSchedule() {
  logger.info("ProgrammaticTimer Schedule Fired .... ");
  ts.createTimer(5000, null);
}

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

@Schedule(dayOfMonth = "*", dayOfWeek = "*", hour = "*", minute = "*", second = "*/5", persistent = false)
  public void myTimer() {
    sendMessage(new Date().toString());
  }
}

代码示例来源:origin: org.jboss.da/source-code-manager

@Schedule(hour = "*", minute = "*/10")
public void invalidateCache() {
  checkFutureCache();
  Iterator<Map.Entry<SCMSpecifier, DirectoryReference>> it = cache.entrySet().iterator();
  while (it.hasNext()) {
    DirectoryReference ref = it.next().getValue();
    if (!ref.check()) {
      it.remove();
    }
  }
}

代码示例来源:origin: payara/Cloud-Connectors

@Schedule(second = "*/1", hour="*", minute="*", persistent = false)   
public void sendMessage() {
  try (MQTTConnection conn = factory.getConnection()) {
    Logger.getAnonymousLogger().info("Sending Message at " + new Date());
    conn.publish("test", "{\"test\": \"Hello World\"}".getBytes(), 0, false);
  } catch (Exception e) {
    
  }
}

代码示例来源:origin: payara/Cloud-Connectors

@Schedule(second = "*/1", hour="*", minute="*", persistent = false)   
public void sendMessage() {
  try (MQTTConnection conn = factory.getConnection()) {
    conn.publish("test", "{\"test\": \"Hello World\"}".getBytes(), 0, false);
  } catch (Exception e) {
    
  }
}

代码示例来源:origin: astefanutti/metrics-cdi

@Metered(name = "meter")
  @Schedule(hour = "*", minute = "*", second = "*", persistent = false)
  public void scheduledMethod() {
    counter.count();
  }
}

代码示例来源:origin: astefanutti/metrics-cdi

@Timed(name = "schedule")
  @Schedule(hour = "*", minute = "*", second = "*", persistent = false)
  public void scheduledMethod() {
    counter.count();
  }
}

代码示例来源:origin: astefanutti/metrics-cdi

@Counted(name = "count", monotonic = true)
  @Schedule(hour = "*", minute = "*", second = "*", persistent = false)
  public void scheduledMethod() {
    counter.count();
  }
}

代码示例来源:origin: payara/Cloud-Connectors

@Schedule(second = "*/1", hour="*", minute="*")   
  public void myTimer() {
    try (AmazonSQSConnection connection = factory.getConnection()) {
    connection.sendMessage(new SendMessageRequest(System.getenv("queueURL"), "Hello World"));
    } catch (Exception e) {}
  }
}

相关文章