java - Schedule the same task for different time interval -


is possible schedule 1 task different time intervals? here fixed interval example:

timer gtimer = new timer();  calendar startdate = calendar.getinstance();    startdate.set(calendar.hour_of_day, 9);  startdate.set(calendar.minute, 45);  startdate.set(calendar.second, 00);    scheduleclass scheduleclass = new scheduleclass();  gtimer.schedule(scheduleclass, startdate.gettime(), 1000 * 60 * 2); //interval 2 minutes

this snippet of scheduleclass has run function , successful run every 2 minutes. question is: how can set interval every 2, 5 , 7 minutes?

when copy scheduler 3 times throws error:

severe: standardwrapper.throwable

java.lang.illegalstateexception: task scheduled or cancelled`

all suggestions welcome!


Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -