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
Check out the LifecycleListener interface:
http://glassfish.java.net/nonav/docs/v3/api/index.html?com/sun/appserv/server/LifecycleListener.html
http://docs.oracle.com/cd/E18930_01/html/821-2418/beamc.html