Browse Source

Avoid using LiveBeansView in GraalVM native images

Closes gh-25344
pull/25349/head
Sébastien Deleuze 4 years ago
parent
commit
9d37794ebc
  1. 4
      spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java

4
spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java

@ -916,8 +916,10 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader @@ -916,8 +916,10 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
publishEvent(new ContextRefreshedEvent(this));
// Participate in LiveBeansView MBean, if active.
if (!IN_NATIVE_IMAGE) {
LiveBeansView.registerApplicationContext(this);
}
}
/**
* Cancel this context's refresh attempt, resetting the {@code active} flag
@ -1024,7 +1026,9 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader @@ -1024,7 +1026,9 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
logger.debug("Closing " + this);
}
if (!IN_NATIVE_IMAGE) {
LiveBeansView.unregisterApplicationContext(this);
}
try {
// Publish shutdown event.

Loading…
Cancel
Save