React on ContextClosedEvent only if originating from "our" context (not another like a child)

This commit is contained in:
Bertrand Renuart
2017-07-03 15:52:01 +02:00
parent 8e11514e7c
commit 8ad15399d6

View File

@@ -122,8 +122,9 @@ public class EurekaAutoServiceRegistration implements AutoServiceRegistration, S
@EventListener(ContextClosedEvent.class)
public void onApplicationEvent(ContextClosedEvent event) {
// register in case meta data changed
stop();
if( event.getApplicationContext() == context ) {
stop();
}
}
}