views:

6

answers:

0

I have a Java app runs on Win7, it does something at start and goes to sleep for an hour, then wakes up to do more things after the hour, but Win7 goes into sleep mode after 15 minutes of inactivity, so I wonder if I can register a task with the Windows task scheduler in my Java app before it goes into thread sleep, so that Win7 will wake up 59 minutes after the Java app goes into sleep, then 1 minute after windows wake up, my Java app will wake up to do its thing.

So is registering a task with the Windows task scheduler doable in Java ? I only care about running it in Win7. Not Unix or Mac. If so any sample code ?