Skip to content

Instantly share code, notes, and snippets.

@os890
Last active December 31, 2015 12:49
Show Gist options
  • Save os890/7989006 to your computer and use it in GitHub Desktop.
Save os890/7989006 to your computer and use it in GitHub Desktop.
@ApplicationScoped
public class SchedulerController
{
@Inject
private Scheduler<Job> jobScheduler;
public void onPause(@Observes PauseJobEvent /*custom event*/ jobEvent)
{
//using it with events is optional
this.jobScheduler.pauseJob(jobEvent.getJobClass());
}
public void onResume(@Observes ResumeJobEvent /*custom event*/ jobEvent)
{
//using it with events is optional
this.jobScheduler.resumeJob(jobEvent.getJobClass());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment