1
1
/*
2
- * Copyright 2012-2019 the original author or authors.
2
+ * Copyright 2012-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -54,10 +54,6 @@ public enum WebApplicationType {
54
54
55
55
private static final String JERSEY_INDICATOR_CLASS = "org.glassfish.jersey.servlet.ServletContainer" ;
56
56
57
- private static final String SERVLET_APPLICATION_CONTEXT_CLASS = "org.springframework.web.context.WebApplicationContext" ;
58
-
59
- private static final String REACTIVE_APPLICATION_CONTEXT_CLASS = "org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext" ;
60
-
61
57
static WebApplicationType deduceFromClasspath () {
62
58
if (ClassUtils .isPresent (WEBFLUX_INDICATOR_CLASS , null ) && !ClassUtils .isPresent (WEBMVC_INDICATOR_CLASS , null )
63
59
&& !ClassUtils .isPresent (JERSEY_INDICATOR_CLASS , null )) {
@@ -71,23 +67,4 @@ static WebApplicationType deduceFromClasspath() {
71
67
return WebApplicationType .SERVLET ;
72
68
}
73
69
74
- static WebApplicationType deduceFromApplicationContext (Class <?> applicationContextClass ) {
75
- if (isAssignable (SERVLET_APPLICATION_CONTEXT_CLASS , applicationContextClass )) {
76
- return WebApplicationType .SERVLET ;
77
- }
78
- if (isAssignable (REACTIVE_APPLICATION_CONTEXT_CLASS , applicationContextClass )) {
79
- return WebApplicationType .REACTIVE ;
80
- }
81
- return WebApplicationType .NONE ;
82
- }
83
-
84
- private static boolean isAssignable (String target , Class <?> type ) {
85
- try {
86
- return ClassUtils .resolveClassName (target , null ).isAssignableFrom (type );
87
- }
88
- catch (Throwable ex ) {
89
- return false ;
90
- }
91
- }
92
-
93
70
}
0 commit comments