While working on JMXConfigurator, it became apparent that
some components needed to survive resetting of the context. For example, when the JMXConfigrator.reload*() methods are invoked, if the JMXConfigurator instance is unregistered from the MBeans server while the reload*() method is still running, then a NullPointerException is thrown from the JMX server. Thus, JMXConfigurator needs to survive the resetting of the LoggerContext it is attached to. However, when the host application is stopped (or restarted), the JMXConfigrator needs to be unregistered from the MBeans server, otherwise severe memory leaks occur. Consequently, LoggerContext now offers two related but distinct methods, reset() and stop(). The former should be called if you just wish to reset the configuration of the logger context. The former should be called when you wish to completely stop the LoggerContext so that it can not be reused ever again. The LoggerContext.shutdownAndReset method no longer exists. (Simply deprecating in favor of stop() or reset() seemed too error prone.)
parent
8d1672d0
Please register or sign in to comment