java: remove current scheduled job in a class that implements IScheduledJob

Posted by ufk on Stack Overflow See other posts from Stack Overflow or by ufk
Published on 2010-05-04T13:22:04Z Indexed on 2010/05/04 14:08 UTC
Read the original article Hit count: 225

Filed under:
|

Hi. In the execution of the scheduled job itself i want to stop it from being executed again and again, how can i do so without having the string that i received when i created the job in the first place ?

public class UfkJob implements IScheduledJob {

 public void execute(ISchedulingService service) {
   if (...) {
   /* here i want to remove the current running job */
  }
}

I executed the job outside by using the commands:

 ISchedulingService service = (ISchedulingService) getScope().getContext().getBean(ISchedulingService.BEAN_NAME);

service.addScheduledJobAfterDelay(5000,new UfkJob(),200);

© Stack Overflow or respective owner

Related posts about java

Related posts about ischedulingservice