java - JSF + Quartz scheduler with sleep function -


i need create scheuler job1 conditions

1) when condition fail in job1 need sleep job time ?

queries

1) how can in jsf quartz 2.1.x or above

  public class schedulerjob implements job {   int  i= 1 ; @override public void execute(jobexecutioncontext context)         throws jobexecutionexception {         dateformat dateformat = new simpledateformat("yyyy/mm/dd hh:mm:ss");        date date = new date();    system.out.println("scheduler wotking jsf , hibernate "+ dateformat.format(date));           i=i+1;         system.out.println(i);            if (i==2)            {                 system.out.println(i);        try {             // 15*60 =900 sec = 15 min                  thread.sleep( 900l * 1000l);                   system.out.println("after 65 sec");                   system.out.println("");                 // executing...             } catch (exception e) {                 e.printstacktrace();             }   }     }    } 

quartz scheduler

<schedule>     <job>         <name>ajob</name>         <group>agroup</group>         <description>print welcome message</description>         <job-class>com.mdis.scheduler.schedulerjob</job-class>     </job>      <trigger>         <cron>             <name>dummytriggername</name>             <job-name>ajob</job-name>             <job-group>agroup</job-group>             <!-- run every 5 seconds -->             <cron-expression>0/5 * * * * ?</cron-expression>         </cron>     </trigger> </schedule> 

this sleep working ... proper way .

  thread.sleep( 900l * 1000l);  


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -