Firstly, please don't move to serverfault. It is indeed a programming question :-)
We are developing occasionally connected applications. These applications reside on laptop and handhelds. In my case, the application runs on a small servlet container (like jetty).
The requirement is that if the system is idle, the application should suspend itself. If the lid of the laptop is closed, then the application and the servlet container are in a suspend mode.
Are such things a feature of the OS itself or can such power awareness be built into the application? If it can be built into the application, how ?