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);
I just realized I think I answered the wrong question initially, I will leave it below for the sake of posterity. Again an assumption I am looking at the right API. Add a field to UFkJob:
and then when you schedule the job:
or you could always have the job schedule itself:
----- My original answer below, I believe for the wrong question ----
I'm not sure if I am looking at the API docs for the right library, however your method call:
is defined as:
The key being "periodic execution". It sounds like what you are looking for is:
So your call would be:
Which would execute the UfkJob a single time 5 seconds after the method call.