Threading in an Application Server

前端 未结 6 1298
礼貌的吻别
礼貌的吻别 2021-02-19 21:41

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

6条回答
  •  借酒劲吻你
    2021-02-19 22:01

    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.

提交回复
热议问题