Saturday, 15 June 2013

java ee - Run code during startup of EAR deployment, not in WAR -



java ee - Run code during startup of EAR deployment, not in WAR -

i need tasks performed on deployment/redeployment of bundle (ear/jar/war) wildfly. there standard way how run code on deployment?

i have found in case of war deployment possible create servlet implement servletcontextlistener , hook required task on it, need more general solution not dependent on war.

thanks help.

i think @startup , @postconstruct way go you.

a method annotated @postconstruct executed in instance of containing class created. ensure class created app deployed, annotate class @startup (and maybe @applicationsoped or @singleton).

java-ee deployment startup ear

No comments:

Post a Comment