Skip to content

Instantly share code, notes, and snippets.

@sujaypillai
Created January 13, 2016 13:45
Show Gist options
  • Save sujaypillai/4458356032132577ca5a to your computer and use it in GitHub Desktop.
Save sujaypillai/4458356032132577ca5a to your computer and use it in GitHub Desktop.
TriggerQuartzJob
var ctxt, scheduler;
// get Spring context and Quartz scheduler
ctxt = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
scheduler = ctxt.getBean('schedulerFactory', Packages.org.quartz.Scheduler);
// fire (unless explicitly defined in Job detail Spring bean, scheduler group is always DEFAULT)
scheduler.triggerJob('<insertJobName>', 'DEFAULT');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment