java ee - how to set correct scheduler time -


I can open EJB scheduler using XML (or what can I do with @time annotation). For example: [ejb-jar.xml]

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Ejb-jar xmlns = "http://java.sun.com/xml/ns/javaee" version = "3.1" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" Xsi: Schema Location = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"> & Lt; Enterprise-level & gt; & Lt; Session & gt; & Lt; EJB-Name & gt; [Name] & lt; / EJB-name & gt; & Lt; EJB category & gt; [Path] & lt; / EJB category & gt; & Lt; Session Type & gt; Stateless & lt; / Session Type & gt; & Lt; Timer & gt; & Lt; Schedule & gt; & Lt; Minutes & gt; * / 30 & lt; / Min & gt; & Lt; Hours & gt; * & Lt; / Hour & gt; & Lt; Month & gt; * & Lt; / Month & gt; & Lt; Years & gt; * & Lt; / Year & gt; & Lt; / Schedule & gt; & Lt; Timeout method & gt; & Lt; Method-name & gt; [Name of method] & lt; / Method-name & gt; & Lt; / Timeout-method & gt; & Lt; / Timer & gt; & Lt; / Session & gt; & Lt; / Enterprise-beans & gt; & Lt; / EJB-Jar & gt;  

If I need to run this scheduler per day then should I write something like this?

  & lt; Schedule & gt; & Lt; Minutes & gt; * & Lt; / Min & gt; & Lt; Hours & gt; 0 & lt; / Hour & gt; & Lt; Month & gt; * & Lt; / Month & gt; & Lt; Years & gt; * & Lt; / Year & gt; & Lt; / Schedule & gt;  

And if I need 01:00 AM, would that be correct?

  & lt; Schedule & gt; & Lt; Minutes & gt; * & Lt; / Min & gt; & Lt; Hours & gt; 1 & lt; / Hour & gt; & Lt; Month & gt; * & Lt; / Month & gt; & Lt; Years & gt; * & Lt; / Year & gt; & Lt; / Schedule & gt;  

thanks :)

Some:

  & lt; Schedule & gt; & Lt; Minutes & gt; 0 & lt; / Min & gt; & Lt; Hours & gt; 0 & lt; / Hour & gt; & Lt; / Schedule & gt;  

1:00 AM every day:

  & lt; Schedule & gt; & Lt; Minutes & gt; 0 & lt; / Min & gt; & Lt; Hours & gt; 1 & lt; / Hour & gt; & Lt; / Schedule & gt;  

Keep in mind that * is a wildcard which means all possible values ​​for a particular attribute , since I have defaulted Month and year left is * and you can actually leave the minute its default value is 0 .

For every minute of every day:

pre & lt; & Lt; Minutes & gt; * & Lt; / Min & gt; & Lt; Hours & gt; * & Lt; / Hour & gt; & Lt; / Schedule & gt;

For every 10 seconds of each minute of every day:

  & lt; Schedule & gt; & Lt; Second & gt; * / 10 & lt; / Second & gt; & Lt; Minutes & gt; * & Lt; / Min & gt; & Lt; Hours & gt; * & Lt; / Hour & gt; & Lt; / Schedule & gt; Starts with  x , and  * / y  

x / y means every y < / Code> / Code> means every y starts with 0 .

From your examples, something like this:

  & lt; Schedule & gt; & Lt; Minutes & gt; * & Lt; / Min & gt; & Lt; Hours & gt; 0 & lt; / Hour & gt; & Lt; Month & gt; * & Lt; / Month & gt; & Lt; Years & gt; * & Lt; / Year & gt; & Lt; / Schedule & gt;  

For every minute from 12:00 am to 12:59 am, i.e. 12:00, 12:01, 12:02 ...

more For information,


Comments