I am wondering how it would be possible to ensure the launch of the full application without having problems accessing or launching some components of the application.
I am talking about Java EE 6 / Java EE 7 applications that contain several WAR and EJB components. The EAR application contains message-driven beans (launched without external access control), servlets (launched / accessible without user or interface management systems), and TimerEJB, which themselves run according to a specific schedule.
Imagine that when you start an EAR application, you must make sure that the parts of the application must be initialized. For instance. You run tools such as database migration, which can take several hours. How is it possible in Java EE 6 / Java EE 7 to control that none of the above parts of the application can even be executed until init has passed the correct initialization transfer. And if initialization fails, reject operations on any of the services in Java EE?
I hope I explain my problem correctly. In short: how can I execute the "Init" code before any other code in my application is executed? And how can I avoid executing any other code if my "Init" code fails? Is there a standard way of Java EE 6 / Java EE 7? If not, is there a jboss7 / wildfly way?
hkais source
share