Executing task after deployment of Java EE application

后端 未结 4 1063
天命终不由人
天命终不由人 2021-02-04 04:52

I have a Java EE application which should start a synchronization process with an external system once after its deployment.

How could I implement this requirement?

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-04 05:17

    Using a ServletContextListener, or a servlet that is initialized at startup, for example. Of course, this becomes much harder if you have multiple deployments of the application in a cluster, and only want this process to be run once.

提交回复
热议问题