Deprecate LiveBeansView
This commit deprecates LiveBeansView and related classes in order to allow a future removal in order to increase the separation of concerns between Spring Framework and Spring Boot, and the consistency between JVM and native. Closes gh-25820
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,12 +23,11 @@ import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.context.support.LiveBeansView;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Servlet variant of {@link LiveBeansView}'s MBean exposure.
|
||||
* Servlet variant of {@link org.springframework.context.support.LiveBeansView}'s MBean exposure.
|
||||
*
|
||||
* <p>Generates a JSON snapshot for current beans and their dependencies in
|
||||
* all ApplicationContexts that live within the current web application.
|
||||
@@ -36,12 +35,14 @@ import org.springframework.util.Assert;
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.2
|
||||
* @see org.springframework.context.support.LiveBeansView#getSnapshotAsJson()
|
||||
* @deprecated as of 5.3, in favor of using Spring Boot actuators for such need.
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("serial")
|
||||
public class LiveBeansViewServlet extends HttpServlet {
|
||||
|
||||
@Nullable
|
||||
private LiveBeansView liveBeansView;
|
||||
private org.springframework.context.support.LiveBeansView liveBeansView;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -49,7 +50,7 @@ public class LiveBeansViewServlet extends HttpServlet {
|
||||
this.liveBeansView = buildLiveBeansView();
|
||||
}
|
||||
|
||||
protected LiveBeansView buildLiveBeansView() {
|
||||
protected org.springframework.context.support.LiveBeansView buildLiveBeansView() {
|
||||
return new ServletContextLiveBeansView(getServletContext());
|
||||
}
|
||||
|
||||
|
||||
@@ -23,17 +23,18 @@ import java.util.Set;
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.support.LiveBeansView;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* {@link LiveBeansView} subclass which looks for all ApplicationContexts
|
||||
* {@link org.springframework.context.support.LiveBeansView} subclass which looks for all ApplicationContexts
|
||||
* in the web application, as exposed in ServletContext attributes.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.2
|
||||
* @deprecated as of 5.3, in favor of using Spring Boot actuators for such need.
|
||||
*/
|
||||
public class ServletContextLiveBeansView extends LiveBeansView {
|
||||
@Deprecated
|
||||
public class ServletContextLiveBeansView extends org.springframework.context.support.LiveBeansView {
|
||||
|
||||
private final ServletContext servletContext;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user