Is there any Java EE standard (application server cross-compatible) way how to stop the Java EE application during initialization i.e. during running of @PostConstruct anotated method of @Singleton @Startup class?
@Singleton
@Startup
public class Initializer {
@PostConstruct
public void checkConfiguration() {
// stop application here
}
}
I search for soft way to stop just the application, to whole application server, nothing like System#exit
.
checkConfiguration
? That should stop your deployment in it's tracks. – EntrepreneurRuntimeException
works. Would you like to post it as a regular answer so I can accept it? – Pass