-
- Thread shutdownHook = new Thread("SLC agent shutdown hook") {
- public void run() {
- applicationContext.stop();
- applicationContext.close();
- log.info("Closed agent application context.");
- }
- };
- Runtime.getRuntime().addShutdownHook(shutdownHook);
-
- while (applicationContext.isActive()) {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- // silent
- }
- }