Instead of creating a Java application, you could just create a simple LiveCycle process that uses a combination of EmailReceiver, Wait, and invoking a subprocess, and then loops, to receive the incoming email.
It's just a little simpler to implement and manage than a custom Java application, although it achieves a similar result.
Howard
http://www.avoka.com