Howdy!
I'm playing around with the ScheduledExecutorService scheduler. In the code i first init the scheduler with a fixed
thread pool size and then pass it a simple task which keeps refreshing a shared list with new data, periodically. At random, the task might throw a runtime exception, in which case the scheduler should start a new thread, but i don't see it doing that. So, how do i simulate this scenario? I'm running this code on a single CPU m/c, using JDK 1.5.
I just get the following log messages and then nothing happens:
[18:41:45,150] Using a pool size of: 1
[18:41:45,160] Original list... [33, 39, 4, 82, 22]
[18:41:45,160] Starting scheduler...
[18:41:45,160] Setting shutdown hook to cleanup thread pools...
[18:41:49,156] pool-1-thread-1 > Refreshing list with new data: [25, 42, 73, 17, 17]
[18:41:49,166] pool-1-thread-1 > zzzZZZ, gotta sleep before updating...
[18:41:51,169] Oops, gotta throw an exception
Thanks.