java- how to wait constantly for an event to happen
<p>I am creating an application in which there are multiple stages- for each stage a message is sent to my queue in Amazon Simple Work Flow (SWF)... The app should start a new thread for each message that is received.</p>

<p>How do I implement the waiting part- so that the application constantly scans the queue for new messages and takes action the moment a message is received?</p>
