refactor: rename springwebmvc

This commit is contained in:
ReaJason
2025-01-18 18:28:46 +08:00
parent 113b174837
commit fe1a443c0d
18 changed files with 104 additions and 105 deletions
@@ -1,17 +1,17 @@
package com.reajason.javaweb.memshell;
import com.reajason.javaweb.memshell.shelltool.command.CommandFilterChainAdvisor;
import com.reajason.javaweb.memshell.springmvc.behinder.BehinderControllerHandler;
import com.reajason.javaweb.memshell.springmvc.behinder.BehinderInterceptor;
import com.reajason.javaweb.memshell.springmvc.behinder.BehinderServletAdvisor;
import com.reajason.javaweb.memshell.springmvc.command.CommandControllerHandler;
import com.reajason.javaweb.memshell.springmvc.command.CommandInterceptor;
import com.reajason.javaweb.memshell.springmvc.godzilla.GodzillaControllerHandler;
import com.reajason.javaweb.memshell.springmvc.godzilla.GodzillaInterceptor;
import com.reajason.javaweb.memshell.springmvc.godzilla.GodzillaServletAdvisor;
import com.reajason.javaweb.memshell.springmvc.injector.SpringControllerHandlerInjector;
import com.reajason.javaweb.memshell.springmvc.injector.SpringFrameworkServletAgentInjector;
import com.reajason.javaweb.memshell.springmvc.injector.SpringInterceptorInjector;
import com.reajason.javaweb.memshell.springwebmvc.behinder.BehinderControllerHandler;
import com.reajason.javaweb.memshell.springwebmvc.behinder.BehinderInterceptor;
import com.reajason.javaweb.memshell.springwebmvc.behinder.BehinderServletAdvisor;
import com.reajason.javaweb.memshell.springwebmvc.command.CommandControllerHandler;
import com.reajason.javaweb.memshell.springwebmvc.command.CommandInterceptor;
import com.reajason.javaweb.memshell.springwebmvc.godzilla.GodzillaControllerHandler;
import com.reajason.javaweb.memshell.springwebmvc.godzilla.GodzillaInterceptor;
import com.reajason.javaweb.memshell.springwebmvc.godzilla.GodzillaServletAdvisor;
import com.reajason.javaweb.memshell.springwebmvc.injector.SpringWebMvcControllerHandlerInjector;
import com.reajason.javaweb.memshell.springwebmvc.injector.SpringWebMvcFrameworkServletAgentInjector;
import com.reajason.javaweb.memshell.springwebmvc.injector.SpringWebMvcInterceptorInjector;
import org.apache.commons.lang3.tuple.Pair;
import java.util.Map;
@@ -20,7 +20,7 @@ import java.util.Map;
* @author ReaJason
* @since 2024/12/22
*/
public class SpringMVCShell extends AbstractShell {
public class SpringWebMvcShell extends AbstractShell {
public static final String INTERCEPTOR = "Interceptor";
public static final String JAKARTA_INTERCEPTOR = "JakartaInterceptor";
public static final String CONTROLLER_HANDLER = "ControllerHandler";
@@ -30,33 +30,33 @@ public class SpringMVCShell extends AbstractShell {
@Override
protected Map<String, Pair<Class<?>, Class<?>>> getBehinderShellMap() {
return Map.of(
INTERCEPTOR, Pair.of(BehinderInterceptor.class, SpringInterceptorInjector.class),
JAKARTA_INTERCEPTOR, Pair.of(BehinderInterceptor.class, SpringInterceptorInjector.class),
CONTROLLER_HANDLER, Pair.of(BehinderControllerHandler.class, SpringControllerHandlerInjector.class),
JAKARTA_CONTROLLER_HANDLER, Pair.of(BehinderControllerHandler.class, SpringControllerHandlerInjector.class),
AGENT_FRAMEWORK_SERVLET, Pair.of(BehinderServletAdvisor.class, SpringFrameworkServletAgentInjector.class)
INTERCEPTOR, Pair.of(BehinderInterceptor.class, SpringWebMvcInterceptorInjector.class),
JAKARTA_INTERCEPTOR, Pair.of(BehinderInterceptor.class, SpringWebMvcInterceptorInjector.class),
CONTROLLER_HANDLER, Pair.of(BehinderControllerHandler.class, SpringWebMvcControllerHandlerInjector.class),
JAKARTA_CONTROLLER_HANDLER, Pair.of(BehinderControllerHandler.class, SpringWebMvcControllerHandlerInjector.class),
AGENT_FRAMEWORK_SERVLET, Pair.of(BehinderServletAdvisor.class, SpringWebMvcFrameworkServletAgentInjector.class)
);
}
@Override
protected Map<String, Pair<Class<?>, Class<?>>> getCommandShellMap() {
return Map.of(
INTERCEPTOR, Pair.of(CommandInterceptor.class, SpringInterceptorInjector.class),
JAKARTA_INTERCEPTOR, Pair.of(CommandInterceptor.class, SpringInterceptorInjector.class),
CONTROLLER_HANDLER, Pair.of(CommandControllerHandler.class, SpringControllerHandlerInjector.class),
JAKARTA_CONTROLLER_HANDLER, Pair.of(CommandControllerHandler.class, SpringControllerHandlerInjector.class),
AGENT_FRAMEWORK_SERVLET, Pair.of(CommandFilterChainAdvisor.class, SpringFrameworkServletAgentInjector.class)
INTERCEPTOR, Pair.of(CommandInterceptor.class, SpringWebMvcInterceptorInjector.class),
JAKARTA_INTERCEPTOR, Pair.of(CommandInterceptor.class, SpringWebMvcInterceptorInjector.class),
CONTROLLER_HANDLER, Pair.of(CommandControllerHandler.class, SpringWebMvcControllerHandlerInjector.class),
JAKARTA_CONTROLLER_HANDLER, Pair.of(CommandControllerHandler.class, SpringWebMvcControllerHandlerInjector.class),
AGENT_FRAMEWORK_SERVLET, Pair.of(CommandFilterChainAdvisor.class, SpringWebMvcFrameworkServletAgentInjector.class)
);
}
@Override
protected Map<String, Pair<Class<?>, Class<?>>> getGodzillaShellMap() {
return Map.of(
INTERCEPTOR, Pair.of(GodzillaInterceptor.class, SpringInterceptorInjector.class),
JAKARTA_INTERCEPTOR, Pair.of(GodzillaInterceptor.class, SpringInterceptorInjector.class),
CONTROLLER_HANDLER, Pair.of(GodzillaControllerHandler.class, SpringControllerHandlerInjector.class),
JAKARTA_CONTROLLER_HANDLER, Pair.of(GodzillaControllerHandler.class, SpringControllerHandlerInjector.class),
AGENT_FRAMEWORK_SERVLET, Pair.of(GodzillaServletAdvisor.class, SpringFrameworkServletAgentInjector.class)
INTERCEPTOR, Pair.of(GodzillaInterceptor.class, SpringWebMvcInterceptorInjector.class),
JAKARTA_INTERCEPTOR, Pair.of(GodzillaInterceptor.class, SpringWebMvcInterceptorInjector.class),
CONTROLLER_HANDLER, Pair.of(GodzillaControllerHandler.class, SpringWebMvcControllerHandlerInjector.class),
JAKARTA_CONTROLLER_HANDLER, Pair.of(GodzillaControllerHandler.class, SpringWebMvcControllerHandlerInjector.class),
AGENT_FRAMEWORK_SERVLET, Pair.of(GodzillaServletAdvisor.class, SpringWebMvcFrameworkServletAgentInjector.class)
);
}
}
@@ -33,7 +33,7 @@ public enum Server {
/**
* SpringMVC 框架
*/
SpringMVC(new SpringMVCShell()),
SpringWebMvc(new SpringWebMvcShell()),
/**
* Spring Webflux 框架
@@ -70,7 +70,7 @@ public class CommonUtil {
String packageName = switch (server) {
case Jetty -> "org.eclipse.jetty.servlet.handlers";
case Undertow, JBossEAP7, WildFly -> "io.undertow.servlet.handlers";
case SpringMVC -> "org.springframework.boot.mvc.handlers";
case SpringWebMvc -> "org.springframework.boot.mvc.handlers";
case SpringWebflux -> "org.springframework.boot.webflux.handlers";
case WebSphere -> "com.ibm.ws.webcontainer.handlers";
case WebLogic -> "weblogic.servlet.internal.handlers";