How to run multiple Thread using Scheduler's in 1.5

Hi,

I have a scenario, in which I have to run a Thread at every 15 minutes, If the first Thread is not Finished in 15 min then new Thread has to start.

Currently I implemeted with java 1.5 schedulers, but the problem is if my first Thread is taking more than 15 min, then no new Thread is starting.

Following is my Code:

TestAccountingThread accountingThread = new TestAccountingThread();

ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(10);

scheduler.scheduleAtFixedRate( accountingThread, 0, 60, SECONDS );

Can any one help on this, This is really urgent.

Regards,

Suman

[660 byte] By [suman_tejaa] at [2007-11-27 9:00:26]
# 1

> if my first Thread is taking more than 15 min, then no new Thread is starting

If it takes more than 15 min, manually run a new scheduler with initial-delay=0 and shutdown the current one when the current execution is finished and repeat this logic in a conditional loop.

Could this be what you want?

hiwaa at 2007-7-12 21:29:04 > top of Java-index,Core,Core APIs...