Advertisement
dmahapatro

Quartz Job

May 28th, 2013
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.98 KB | None | 0 0
  1. class DemoJob {
  2.     static triggers = {
  3.         cron name: 'testTrigger', cronExpression: "0 0/15 * * * ?"
  4.     }
  5.  
  6.     def execute() {
  7.         log.info "Job Executed"
  8.     }
  9. }
  10.  
  11.  
  12. //Output:-
  13. May 28, 2013 12:52:21 PM org.apache.coyote.AbstractProtocol init
  14. INFO: Initializing ProtocolHandler ["http-bio-8080"]
  15. May 28, 2013 12:52:21 PM org.apache.catalina.core.StandardService startInternal
  16. INFO: Starting service Tomcat
  17. May 28, 2013 12:52:21 PM org.apache.catalina.core.StandardEngine startInternal
  18. INFO: Starting Servlet Engine: Apache Tomcat/7.0.39
  19. May 28, 2013 12:52:21 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
  20. INFO: No global web.xml found
  21. May 28, 2013 12:52:21 PM org.apache.catalina.core.ApplicationContext log
  22. | Server running. Browse to http://localhost:8080/quartzDemoApp
  23. 2013-05-28 13:00:00,079 [quartzScheduler_Worker-1] INFO  quartz.DemoJob  - Job Executed
  24. 2013-05-28 13:15:00,012 [quartzScheduler_Worker-2] INFO  quartz.DemoJob  - Job Executed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement