I have a Java program/thread that I want to deploy into an Application Server (GlassFish). The thread should run as a \"service\" that starts when the Application Server starts
I start a timed object with the timer service and only one single expiration. Then, in the timeout, I do what I wanted to do with the thread.
http://onjava.com/pub/a/onjava/2004/10/13/j2ee-timers.html
For me it worked since it uses J2EE components and is a different thread.