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
This is not something that you should do in any app server, unless you have access to managed threads provided by the app server. I am not familiar with Glassfish, but you could do this in Websphere or Weblogic using a commonj WorkManager.
Apparently, the same can be accomplished in Glassfish and JBOSS via a JCA WorkManager (which I am not familiar with).