From 8d7ed8c4eee37f4fc6e16ea3dcb92e5cf9ef2812 Mon Sep 17 00:00:00 2001 From: ReaJason Date: Mon, 27 Jan 2025 16:24:27 +0800 Subject: [PATCH] refactor: shell mount type ordered --- .../javaweb/memshell/AbstractShell.java | 11 ++- .../javaweb/memshell/ApusicShell.java | 31 ++++---- .../reajason/javaweb/memshell/BesShell.java | 43 +++++------ .../javaweb/memshell/GlassFishShell.java | 61 +++++++-------- .../javaweb/memshell/InforSuiteShell.java | 61 +++++++-------- .../reajason/javaweb/memshell/JbossShell.java | 43 +++++------ .../reajason/javaweb/memshell/JettyShell.java | 55 +++++++------- .../reajason/javaweb/memshell/NettyShell.java | 26 ------- .../reajason/javaweb/memshell/ResinShell.java | 37 ++++----- .../javaweb/memshell/SpringWebFluxShell.java | 25 ++++--- .../javaweb/memshell/SpringWebMvcShell.java | 43 +++++------ .../javaweb/memshell/TomcatShell.java | 75 ++++++++++--------- .../javaweb/memshell/TongWeb6Shell.java | 62 +++++++-------- .../javaweb/memshell/TongWeb7Shell.java | 61 +++++++-------- .../javaweb/memshell/UndertowShell.java | 55 +++++++------- .../javaweb/memshell/WebLogicShell.java | 45 +++++------ .../javaweb/memshell/WebSphereShell.java | 43 +++++------ .../javaweb/memshell/XxlJobShell.java | 13 ++-- 18 files changed, 391 insertions(+), 399 deletions(-) delete mode 100644 generator/src/main/java/com/reajason/javaweb/memshell/NettyShell.java diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/AbstractShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/AbstractShell.java index 98be07a0..04777c0d 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/AbstractShell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/AbstractShell.java @@ -1,7 +1,10 @@ package com.reajason.javaweb.memshell; import com.reajason.javaweb.memshell.config.*; -import com.reajason.javaweb.memshell.generator.*; +import com.reajason.javaweb.memshell.generator.BehinderGenerator; +import com.reajason.javaweb.memshell.generator.CommandGenerator; +import com.reajason.javaweb.memshell.generator.GodzillaGenerator; +import com.reajason.javaweb.memshell.generator.InjectorGenerator; import org.apache.commons.lang3.tuple.Pair; import java.util.Collections; @@ -21,9 +24,9 @@ public abstract class AbstractShell { */ public List getSupportedShellTypes(ShellTool tool) { return switch (tool) { - case Godzilla -> getGodzillaShellMap().keySet().stream().sorted().toList(); - case Command -> getCommandShellMap().keySet().stream().sorted().toList(); - case Behinder -> getBehinderShellMap().keySet().stream().sorted().toList(); + case Godzilla -> getGodzillaShellMap().keySet().stream().toList(); + case Command -> getCommandShellMap().keySet().stream().toList(); + case Behinder -> getBehinderShellMap().keySet().stream().toList(); default -> Collections.emptyList(); }; } diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/ApusicShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/ApusicShell.java index 80e0ada3..9d98c658 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/ApusicShell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/ApusicShell.java @@ -14,6 +14,7 @@ import com.reajason.javaweb.memshell.shelltool.godzilla.GodzillaFilter; import com.reajason.javaweb.memshell.shelltool.godzilla.GodzillaServlet; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; import static com.reajason.javaweb.memshell.config.Constants.*; @@ -25,28 +26,28 @@ import static com.reajason.javaweb.memshell.config.Constants.*; public class ApusicShell extends AbstractShell { @Override protected Map, Class>> getCommandShellMap() { - return Map.of( - SERVLET, Pair.of(CommandServlet.class, ApusicServletInjector.class), - FILTER, Pair.of(CommandFilter.class, ApusicFilterInjector.class), - LISTENER, Pair.of(CommandListener.class, ApusicListenerInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(CommandServlet.class, ApusicServletInjector.class)); + map.put(FILTER, Pair.of(CommandFilter.class, ApusicFilterInjector.class)); + map.put(LISTENER, Pair.of(CommandListener.class, ApusicListenerInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - SERVLET, Pair.of(GodzillaServlet.class, ApusicServletInjector.class), - FILTER, Pair.of(GodzillaFilter.class, ApusicFilterInjector.class), - LISTENER, Pair.of(GodzillaListener.class, ApusicListenerInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(GodzillaServlet.class, ApusicServletInjector.class)); + map.put(FILTER, Pair.of(GodzillaFilter.class, ApusicFilterInjector.class)); + map.put(LISTENER, Pair.of(GodzillaListener.class, ApusicListenerInjector.class)); + return map; } @Override protected Map, Class>> getBehinderShellMap() { - return Map.of( - SERVLET, Pair.of(BehinderServlet.class, ApusicServletInjector.class), - FILTER, Pair.of(BehinderFilter.class, ApusicFilterInjector.class), - LISTENER, Pair.of(BehinderListener.class, ApusicListenerInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(BehinderServlet.class, ApusicServletInjector.class)); + map.put(FILTER, Pair.of(BehinderFilter.class, ApusicFilterInjector.class)); + map.put(LISTENER, Pair.of(BehinderListener.class, ApusicListenerInjector.class)); + return map; } } diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/BesShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/BesShell.java index 4cdce939..42a75b73 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/BesShell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/BesShell.java @@ -15,6 +15,7 @@ import com.reajason.javaweb.memshell.tomcat.command.CommandListener; import com.reajason.javaweb.memshell.tomcat.godzilla.GodzillaListener; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; import static com.reajason.javaweb.memshell.config.Constants.*; @@ -27,34 +28,34 @@ public class BesShell extends AbstractShell { @Override protected Map, Class>> getCommandShellMap() { - return Map.of( - FILTER, Pair.of(CommandFilter.class, BesFilterInjector.class), - LISTENER, Pair.of(CommandListener.class, BesListenerInjector.class), - VALVE, Pair.of(CommandValve.class, BesValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, BesFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(CommandFilterChainAdvisor.class, BesContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(CommandFilter.class, BesFilterInjector.class)); + map.put(LISTENER, Pair.of(CommandListener.class, BesListenerInjector.class)); + map.put(VALVE, Pair.of(CommandValve.class, BesValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, BesFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(CommandFilterChainAdvisor.class, BesContextValveAgentInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - FILTER, Pair.of(GodzillaFilter.class, BesFilterInjector.class), - LISTENER, Pair.of(GodzillaListener.class, BesListenerInjector.class), - VALVE, Pair.of(GodzillaValve.class, BesValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, BesFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(GodzillaFilterChainAdvisor.class, BesContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(GodzillaFilter.class, BesFilterInjector.class)); + map.put(LISTENER, Pair.of(GodzillaListener.class, BesListenerInjector.class)); + map.put(VALVE, Pair.of(GodzillaValve.class, BesValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, BesFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(GodzillaFilterChainAdvisor.class, BesContextValveAgentInjector.class)); + return map; } @Override protected Map, Class>> getBehinderShellMap() { - return Map.of( - FILTER, Pair.of(BehinderFilter.class, BesFilterInjector.class), - LISTENER, Pair.of(BehinderListener.class, BesListenerInjector.class), - VALVE, Pair.of(BehinderValve.class, BesValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, BesFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(BehinderFilterChainAdvisor.class, BesContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(BehinderFilter.class, BesFilterInjector.class)); + map.put(LISTENER, Pair.of(BehinderListener.class, BesListenerInjector.class)); + map.put(VALVE, Pair.of(BehinderValve.class, BesValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, BesFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(BehinderFilterChainAdvisor.class, BesContextValveAgentInjector.class)); + return map; } } diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/GlassFishShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/GlassFishShell.java index 43e99e1f..71d09c56 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/GlassFishShell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/GlassFishShell.java @@ -19,6 +19,7 @@ import com.reajason.javaweb.memshell.tomcat.injector.TomcatContextValveAgentInje import com.reajason.javaweb.memshell.tomcat.injector.TomcatFilterChainAgentInjector; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; import static com.reajason.javaweb.memshell.config.Constants.*; @@ -31,43 +32,43 @@ public class GlassFishShell extends AbstractShell { @Override protected Map, Class>> getCommandShellMap() { - return Map.of( - FILTER, Pair.of(CommandFilter.class, GlassFishFilterInjector.class), - JAKARTA_FILTER, Pair.of(CommandFilter.class, GlassFishFilterInjector.class), - LISTENER, Pair.of(CommandListener.class, GlassFishListenerInjector.class), - JAKARTA_LISTENER, Pair.of(CommandListener.class, GlassFishListenerInjector.class), - VALVE, Pair.of(CommandValve.class, GlassFishValveInjector.class), - JAKARTA_VALVE, Pair.of(CommandValve.class, GlassFishValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(CommandFilterChainAdvisor.class, TomcatContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(CommandFilter.class, GlassFishFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(CommandFilter.class, GlassFishFilterInjector.class)); + map.put(LISTENER, Pair.of(CommandListener.class, GlassFishListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(CommandListener.class, GlassFishListenerInjector.class)); + map.put(VALVE, Pair.of(CommandValve.class, GlassFishValveInjector.class)); + map.put(JAKARTA_VALVE, Pair.of(CommandValve.class, GlassFishValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(CommandFilterChainAdvisor.class, TomcatContextValveAgentInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - FILTER, Pair.of(GodzillaFilter.class, GlassFishFilterInjector.class), - JAKARTA_FILTER, Pair.of(GodzillaFilter.class, GlassFishFilterInjector.class), - LISTENER, Pair.of(GodzillaListener.class, GlassFishListenerInjector.class), - JAKARTA_LISTENER, Pair.of(GodzillaListener.class, GlassFishListenerInjector.class), - VALVE, Pair.of(GodzillaValve.class, GlassFishValveInjector.class), - JAKARTA_VALVE, Pair.of(GodzillaValve.class, GlassFishValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(GodzillaFilterChainAdvisor.class, TomcatContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(GodzillaFilter.class, GlassFishFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(GodzillaFilter.class, GlassFishFilterInjector.class)); + map.put(LISTENER, Pair.of(GodzillaListener.class, GlassFishListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(GodzillaListener.class, GlassFishListenerInjector.class)); + map.put(VALVE, Pair.of(GodzillaValve.class, GlassFishValveInjector.class)); + map.put(JAKARTA_VALVE, Pair.of(GodzillaValve.class, GlassFishValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(GodzillaFilterChainAdvisor.class, TomcatContextValveAgentInjector.class)); + return map; } @Override protected Map, Class>> getBehinderShellMap() { - return Map.of( - FILTER, Pair.of(BehinderFilter.class, GlassFishFilterInjector.class), - JAKARTA_FILTER, Pair.of(BehinderFilter.class, GlassFishFilterInjector.class), - LISTENER, Pair.of(BehinderListener.class, GlassFishListenerInjector.class), - JAKARTA_LISTENER, Pair.of(BehinderListener.class, GlassFishListenerInjector.class), - VALVE, Pair.of(BehinderValve.class, GlassFishValveInjector.class), - JAKARTA_VALVE, Pair.of(BehinderValve.class, GlassFishValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(BehinderFilterChainAdvisor.class, TomcatContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(BehinderFilter.class, GlassFishFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(BehinderFilter.class, GlassFishFilterInjector.class)); + map.put(LISTENER, Pair.of(BehinderListener.class, GlassFishListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(BehinderListener.class, GlassFishListenerInjector.class)); + map.put(VALVE, Pair.of(BehinderValve.class, GlassFishValveInjector.class)); + map.put(JAKARTA_VALVE, Pair.of(BehinderValve.class, GlassFishValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(BehinderFilterChainAdvisor.class, TomcatContextValveAgentInjector.class)); + return map; } } \ No newline at end of file diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/InforSuiteShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/InforSuiteShell.java index ec747fff..34501288 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/InforSuiteShell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/InforSuiteShell.java @@ -19,6 +19,7 @@ import com.reajason.javaweb.memshell.tomcat.injector.TomcatContextValveAgentInje import com.reajason.javaweb.memshell.tomcat.injector.TomcatFilterChainAgentInjector; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; import static com.reajason.javaweb.memshell.config.Constants.*; @@ -31,43 +32,43 @@ public class InforSuiteShell extends AbstractShell { @Override protected Map, Class>> getCommandShellMap() { - return Map.of( - FILTER, Pair.of(CommandFilter.class, InforSuiteFilterInjector.class), - JAKARTA_FILTER, Pair.of(CommandFilter.class, InforSuiteFilterInjector.class), - LISTENER, Pair.of(CommandListener.class, GlassFishListenerInjector.class), - JAKARTA_LISTENER, Pair.of(CommandListener.class, GlassFishListenerInjector.class), - VALVE, Pair.of(CommandValve.class, GlassFishValveInjector.class), - JAKARTA_VALVE, Pair.of(CommandValve.class, GlassFishValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(CommandFilterChainAdvisor.class, TomcatContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(CommandFilter.class, InforSuiteFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(CommandFilter.class, InforSuiteFilterInjector.class)); + map.put(LISTENER, Pair.of(CommandListener.class, GlassFishListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(CommandListener.class, GlassFishListenerInjector.class)); + map.put(VALVE, Pair.of(CommandValve.class, GlassFishValveInjector.class)); + map.put(JAKARTA_VALVE, Pair.of(CommandValve.class, GlassFishValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(CommandFilterChainAdvisor.class, TomcatContextValveAgentInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - FILTER, Pair.of(GodzillaFilter.class, InforSuiteFilterInjector.class), - JAKARTA_FILTER, Pair.of(GodzillaFilter.class, InforSuiteFilterInjector.class), - LISTENER, Pair.of(GodzillaListener.class, GlassFishListenerInjector.class), - JAKARTA_LISTENER, Pair.of(GodzillaListener.class, GlassFishListenerInjector.class), - VALVE, Pair.of(GodzillaValve.class, GlassFishValveInjector.class), - JAKARTA_VALVE, Pair.of(GodzillaValve.class, GlassFishValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(GodzillaFilterChainAdvisor.class, TomcatContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(GodzillaFilter.class, InforSuiteFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(GodzillaFilter.class, InforSuiteFilterInjector.class)); + map.put(LISTENER, Pair.of(GodzillaListener.class, GlassFishListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(GodzillaListener.class, GlassFishListenerInjector.class)); + map.put(VALVE, Pair.of(GodzillaValve.class, GlassFishValveInjector.class)); + map.put(JAKARTA_VALVE, Pair.of(GodzillaValve.class, GlassFishValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(GodzillaFilterChainAdvisor.class, TomcatContextValveAgentInjector.class)); + return map; } @Override protected Map, Class>> getBehinderShellMap() { - return Map.of( - FILTER, Pair.of(BehinderFilter.class, InforSuiteFilterInjector.class), - JAKARTA_FILTER, Pair.of(BehinderFilter.class, InforSuiteFilterInjector.class), - LISTENER, Pair.of(BehinderListener.class, GlassFishListenerInjector.class), - JAKARTA_LISTENER, Pair.of(BehinderListener.class, GlassFishListenerInjector.class), - VALVE, Pair.of(BehinderValve.class, GlassFishValveInjector.class), - JAKARTA_VALVE, Pair.of(BehinderValve.class, GlassFishValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(BehinderFilterChainAdvisor.class, TomcatContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(BehinderFilter.class, InforSuiteFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(BehinderFilter.class, InforSuiteFilterInjector.class)); + map.put(LISTENER, Pair.of(BehinderListener.class, GlassFishListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(BehinderListener.class, GlassFishListenerInjector.class)); + map.put(VALVE, Pair.of(BehinderValve.class, GlassFishValveInjector.class)); + map.put(JAKARTA_VALVE, Pair.of(BehinderValve.class, GlassFishValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(BehinderFilterChainAdvisor.class, TomcatContextValveAgentInjector.class)); + return map; } } diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/JbossShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/JbossShell.java index c267f96e..30035a39 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/JbossShell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/JbossShell.java @@ -19,6 +19,7 @@ import com.reajason.javaweb.memshell.tomcat.injector.TomcatContextValveAgentInje import com.reajason.javaweb.memshell.tomcat.injector.TomcatFilterChainAgentInjector; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; import static com.reajason.javaweb.memshell.config.Constants.*; @@ -31,34 +32,34 @@ public class JbossShell extends AbstractShell { @Override protected Map, Class>> getCommandShellMap() { - return Map.of( - FILTER, Pair.of(CommandFilter.class, JbossFilterInjector.class), - LISTENER, Pair.of(CommandListener.class, JbossListenerInjector.class), - VALVE, Pair.of(CommandValve.class, JbossValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(CommandFilterChainAdvisor.class, TomcatContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(CommandFilter.class, JbossFilterInjector.class)); + map.put(LISTENER, Pair.of(CommandListener.class, JbossListenerInjector.class)); + map.put(VALVE, Pair.of(CommandValve.class, JbossValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(CommandFilterChainAdvisor.class, TomcatContextValveAgentInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - FILTER, Pair.of(GodzillaFilter.class, JbossFilterInjector.class), - LISTENER, Pair.of(GodzillaListener.class, JbossListenerInjector.class), - VALVE, Pair.of(GodzillaValve.class, JbossValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(GodzillaFilterChainAdvisor.class, TomcatContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(GodzillaFilter.class, JbossFilterInjector.class)); + map.put(LISTENER, Pair.of(GodzillaListener.class, JbossListenerInjector.class)); + map.put(VALVE, Pair.of(GodzillaValve.class, JbossValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(GodzillaFilterChainAdvisor.class, TomcatContextValveAgentInjector.class)); + return map; } @Override protected Map, Class>> getBehinderShellMap() { - return Map.of( - FILTER, Pair.of(BehinderFilter.class, JbossFilterInjector.class), - LISTENER, Pair.of(BehinderListener.class, JbossListenerInjector.class), - VALVE, Pair.of(BehinderValve.class, JbossValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(BehinderFilterChainAdvisor.class, TomcatContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(BehinderFilter.class, JbossFilterInjector.class)); + map.put(LISTENER, Pair.of(BehinderListener.class, JbossListenerInjector.class)); + map.put(VALVE, Pair.of(BehinderValve.class, JbossValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(BehinderFilterChainAdvisor.class, TomcatContextValveAgentInjector.class)); + return map; } } \ No newline at end of file diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/JettyShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/JettyShell.java index 3c55e1c0..36fef8ad 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/JettyShell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/JettyShell.java @@ -18,6 +18,7 @@ import com.reajason.javaweb.memshell.shelltool.godzilla.GodzillaFilter; import com.reajason.javaweb.memshell.shelltool.godzilla.GodzillaServlet; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; import static com.reajason.javaweb.memshell.config.Constants.*; @@ -31,40 +32,40 @@ public class JettyShell extends AbstractShell { @Override protected Map, Class>> getCommandShellMap() { - return Map.of( - SERVLET, Pair.of(CommandServlet.class, JettyServletInjector.class), - JAKARTA_SERVLET, Pair.of(CommandServlet.class, JettyServletInjector.class), - FILTER, Pair.of(CommandFilter.class, JettyFilterInjector.class), - JAKARTA_FILTER, Pair.of(CommandFilter.class, JettyFilterInjector.class), - LISTENER, Pair.of(CommandListener.class, JettyListenerInjector.class), - JAKARTA_LISTENER, Pair.of(CommandListener.class, JettyListenerInjector.class), - AGENT_HANDLER, Pair.of(CommandHandlerAdvisor.class, JettyHandlerAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(CommandServlet.class, JettyServletInjector.class)); + map.put(JAKARTA_SERVLET, Pair.of(CommandServlet.class, JettyServletInjector.class)); + map.put(FILTER, Pair.of(CommandFilter.class, JettyFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(CommandFilter.class, JettyFilterInjector.class)); + map.put(LISTENER, Pair.of(CommandListener.class, JettyListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(CommandListener.class, JettyListenerInjector.class)); + map.put(AGENT_HANDLER, Pair.of(CommandHandlerAdvisor.class, JettyHandlerAgentInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - SERVLET, Pair.of(GodzillaServlet.class, JettyServletInjector.class), - JAKARTA_SERVLET, Pair.of(GodzillaServlet.class, JettyServletInjector.class), - FILTER, Pair.of(GodzillaFilter.class, JettyFilterInjector.class), - JAKARTA_FILTER, Pair.of(GodzillaFilter.class, JettyFilterInjector.class), - LISTENER, Pair.of(GodzillaListener.class, JettyListenerInjector.class), - JAKARTA_LISTENER, Pair.of(GodzillaListener.class, JettyListenerInjector.class), - AGENT_HANDLER, Pair.of(GodzillaHandlerAdvisor.class, JettyHandlerAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(GodzillaServlet.class, JettyServletInjector.class)); + map.put(JAKARTA_SERVLET, Pair.of(GodzillaServlet.class, JettyServletInjector.class)); + map.put(FILTER, Pair.of(GodzillaFilter.class, JettyFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(GodzillaFilter.class, JettyFilterInjector.class)); + map.put(LISTENER, Pair.of(GodzillaListener.class, JettyListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(GodzillaListener.class, JettyListenerInjector.class)); + map.put(AGENT_HANDLER, Pair.of(GodzillaHandlerAdvisor.class, JettyHandlerAgentInjector.class)); + return map; } @Override protected Map, Class>> getBehinderShellMap() { - return Map.of( - SERVLET, Pair.of(BehinderServlet.class, JettyServletInjector.class), - JAKARTA_SERVLET, Pair.of(BehinderServlet.class, JettyServletInjector.class), - FILTER, Pair.of(BehinderFilter.class, JettyFilterInjector.class), - JAKARTA_FILTER, Pair.of(BehinderFilter.class, JettyFilterInjector.class), - LISTENER, Pair.of(BehinderListener.class, JettyListenerInjector.class), - JAKARTA_LISTENER, Pair.of(BehinderListener.class, JettyListenerInjector.class), - AGENT_HANDLER, Pair.of(BehinderHandlerAdvisor.class, JettyHandlerAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(BehinderServlet.class, JettyServletInjector.class)); + map.put(JAKARTA_SERVLET, Pair.of(BehinderServlet.class, JettyServletInjector.class)); + map.put(FILTER, Pair.of(BehinderFilter.class, JettyFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(BehinderFilter.class, JettyFilterInjector.class)); + map.put(LISTENER, Pair.of(BehinderListener.class, JettyListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(BehinderListener.class, JettyListenerInjector.class)); + map.put(AGENT_HANDLER, Pair.of(BehinderHandlerAdvisor.class, JettyHandlerAgentInjector.class)); + return map; } } diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/NettyShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/NettyShell.java deleted file mode 100644 index f9f074f7..00000000 --- a/generator/src/main/java/com/reajason/javaweb/memshell/NettyShell.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.reajason.javaweb.memshell; - -import org.apache.commons.lang3.tuple.Pair; - -import java.util.Map; - -/** - * @author ReaJason - * @since 2024/12/26 - */ -public class NettyShell extends AbstractShell{ - @Override - protected Map, Class>> getBehinderShellMap() { - return super.getBehinderShellMap(); - } - - @Override - protected Map, Class>> getCommandShellMap() { - return super.getCommandShellMap(); - } - - @Override - protected Map, Class>> getGodzillaShellMap() { - return super.getGodzillaShellMap(); - } -} diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/ResinShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/ResinShell.java index f01d99af..aea7a718 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/ResinShell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/ResinShell.java @@ -18,6 +18,7 @@ import com.reajason.javaweb.memshell.shelltool.godzilla.GodzillaFilterChainAdvis import com.reajason.javaweb.memshell.shelltool.godzilla.GodzillaServlet; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; import static com.reajason.javaweb.memshell.config.Constants.*; @@ -31,31 +32,31 @@ public class ResinShell extends AbstractShell { @Override protected Map, Class>> getCommandShellMap() { - return Map.of( - SERVLET, Pair.of(CommandServlet.class, ResinServletInjector.class), - FILTER, Pair.of(CommandFilter.class, ResinFilterInjector.class), - LISTENER, Pair.of(CommandListener.class, ResinListenerInjector.class), - AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, ResinFilterChainAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(CommandServlet.class, ResinServletInjector.class)); + map.put(FILTER, Pair.of(CommandFilter.class, ResinFilterInjector.class)); + map.put(LISTENER, Pair.of(CommandListener.class, ResinListenerInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, ResinFilterChainAgentInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - SERVLET, Pair.of(GodzillaServlet.class, ResinServletInjector.class), - FILTER, Pair.of(GodzillaFilter.class, ResinFilterInjector.class), - LISTENER, Pair.of(GodzillaListener.class, ResinListenerInjector.class), - AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, ResinFilterChainAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(GodzillaServlet.class, ResinServletInjector.class)); + map.put(FILTER, Pair.of(GodzillaFilter.class, ResinFilterInjector.class)); + map.put(LISTENER, Pair.of(GodzillaListener.class, ResinListenerInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, ResinFilterChainAgentInjector.class)); + return map; } @Override protected Map, Class>> getBehinderShellMap() { - return Map.of( - SERVLET, Pair.of(BehinderServlet.class, ResinServletInjector.class), - FILTER, Pair.of(BehinderFilter.class, ResinFilterInjector.class), - LISTENER, Pair.of(BehinderListener.class, ResinListenerInjector.class), - AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, ResinFilterChainAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(BehinderServlet.class, ResinServletInjector.class)); + map.put(FILTER, Pair.of(BehinderFilter.class, ResinFilterInjector.class)); + map.put(LISTENER, Pair.of(BehinderListener.class, ResinListenerInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, ResinFilterChainAgentInjector.class)); + return map; } } diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/SpringWebFluxShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/SpringWebFluxShell.java index db40ee97..189356fa 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/SpringWebFluxShell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/SpringWebFluxShell.java @@ -14,6 +14,7 @@ import com.reajason.javaweb.memshell.springwebflux.injector.SpringWebFluxNettyHa import com.reajason.javaweb.memshell.springwebflux.injector.SpringWebFluxWebFilterInjector; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; /** @@ -28,21 +29,21 @@ public class SpringWebFluxShell extends AbstractShell { @Override protected Map, Class>> getCommandShellMap() { - return Map.of( - WEB_FILTER, Pair.of(CommandWebFilter.class, SpringWebFluxWebFilterInjector.class), - HANDLER_METHOD, Pair.of(CommandHandlerMethod.class, SpringWebFluxHandlerMethodInjector.class), - HANDLER_FUNCTION, Pair.of(CommandHandlerFunction.class, SpringWebFluxHandlerFunctionInjector.class), - NETTY_HANDLER, Pair.of(CommandNettyHandler.class, SpringWebFluxNettyHandlerInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(WEB_FILTER, Pair.of(CommandWebFilter.class, SpringWebFluxWebFilterInjector.class)); + map.put(HANDLER_METHOD, Pair.of(CommandHandlerMethod.class, SpringWebFluxHandlerMethodInjector.class)); + map.put(HANDLER_FUNCTION, Pair.of(CommandHandlerFunction.class, SpringWebFluxHandlerFunctionInjector.class)); + map.put(NETTY_HANDLER, Pair.of(CommandNettyHandler.class, SpringWebFluxNettyHandlerInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - WEB_FILTER, Pair.of(GodzillaWebFilter.class, SpringWebFluxWebFilterInjector.class), - HANDLER_METHOD, Pair.of(GodzillaHandlerMethod.class, SpringWebFluxHandlerMethodInjector.class), - HANDLER_FUNCTION, Pair.of(GodzillaHandlerFunction.class, SpringWebFluxHandlerFunctionInjector.class), - NETTY_HANDLER, Pair.of(GodzillaNettyHandler.class, SpringWebFluxNettyHandlerInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(WEB_FILTER, Pair.of(GodzillaWebFilter.class, SpringWebFluxWebFilterInjector.class)); + map.put(HANDLER_METHOD, Pair.of(GodzillaHandlerMethod.class, SpringWebFluxHandlerMethodInjector.class)); + map.put(HANDLER_FUNCTION, Pair.of(GodzillaHandlerFunction.class, SpringWebFluxHandlerFunctionInjector.class)); + map.put(NETTY_HANDLER, Pair.of(GodzillaNettyHandler.class, SpringWebFluxNettyHandlerInjector.class)); + return map; } } diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/SpringWebMvcShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/SpringWebMvcShell.java index 095a1ce1..a4f51625 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/SpringWebMvcShell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/SpringWebMvcShell.java @@ -14,6 +14,7 @@ import com.reajason.javaweb.memshell.springwebmvc.injector.SpringWebMvcFramework import com.reajason.javaweb.memshell.springwebmvc.injector.SpringWebMvcInterceptorInjector; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; /** @@ -29,34 +30,34 @@ public class SpringWebMvcShell extends AbstractShell { @Override protected Map, Class>> getBehinderShellMap() { - return Map.of( - 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) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(INTERCEPTOR, Pair.of(BehinderInterceptor.class, SpringWebMvcInterceptorInjector.class)); + map.put(JAKARTA_INTERCEPTOR, Pair.of(BehinderInterceptor.class, SpringWebMvcInterceptorInjector.class)); + map.put(CONTROLLER_HANDLER, Pair.of(BehinderControllerHandler.class, SpringWebMvcControllerHandlerInjector.class)); + map.put(JAKARTA_CONTROLLER_HANDLER, Pair.of(BehinderControllerHandler.class, SpringWebMvcControllerHandlerInjector.class)); + map.put(AGENT_FRAMEWORK_SERVLET, Pair.of(BehinderServletAdvisor.class, SpringWebMvcFrameworkServletAgentInjector.class)); + return map; } @Override protected Map, Class>> getCommandShellMap() { - return Map.of( - 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) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(INTERCEPTOR, Pair.of(CommandInterceptor.class, SpringWebMvcInterceptorInjector.class)); + map.put(JAKARTA_INTERCEPTOR, Pair.of(CommandInterceptor.class, SpringWebMvcInterceptorInjector.class)); + map.put(CONTROLLER_HANDLER, Pair.of(CommandControllerHandler.class, SpringWebMvcControllerHandlerInjector.class)); + map.put(JAKARTA_CONTROLLER_HANDLER, Pair.of(CommandControllerHandler.class, SpringWebMvcControllerHandlerInjector.class)); + map.put(AGENT_FRAMEWORK_SERVLET, Pair.of(CommandFilterChainAdvisor.class, SpringWebMvcFrameworkServletAgentInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - 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) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(INTERCEPTOR, Pair.of(GodzillaInterceptor.class, SpringWebMvcInterceptorInjector.class)); + map.put(JAKARTA_INTERCEPTOR, Pair.of(GodzillaInterceptor.class, SpringWebMvcInterceptorInjector.class)); + map.put(CONTROLLER_HANDLER, Pair.of(GodzillaControllerHandler.class, SpringWebMvcControllerHandlerInjector.class)); + map.put(JAKARTA_CONTROLLER_HANDLER, Pair.of(GodzillaControllerHandler.class, SpringWebMvcControllerHandlerInjector.class)); + map.put(AGENT_FRAMEWORK_SERVLET, Pair.of(GodzillaServletAdvisor.class, SpringWebMvcFrameworkServletAgentInjector.class)); + return map; } } \ No newline at end of file diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/TomcatShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/TomcatShell.java index 627eed73..7a237f88 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/TomcatShell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/TomcatShell.java @@ -19,6 +19,7 @@ import com.reajason.javaweb.memshell.tomcat.godzilla.GodzillaListener; import com.reajason.javaweb.memshell.tomcat.injector.*; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; import static com.reajason.javaweb.memshell.config.Constants.*; @@ -34,50 +35,50 @@ public class TomcatShell extends AbstractShell { @Override protected Map, Class>> getCommandShellMap() { - return Map.ofEntries( - Map.entry(SERVLET, Pair.of(CommandServlet.class, TomcatServletInjector.class)), - Map.entry(JAKARTA_SERVLET, Pair.of(CommandServlet.class, TomcatServletInjector.class)), - Map.entry(FILTER, Pair.of(CommandFilter.class, TomcatFilterInjector.class)), - Map.entry(JAKARTA_FILTER, Pair.of(CommandFilter.class, TomcatFilterInjector.class)), - Map.entry(LISTENER, Pair.of(CommandListener.class, TomcatListenerInjector.class)), - Map.entry(JAKARTA_LISTENER, Pair.of(CommandListener.class, TomcatListenerInjector.class)), - Map.entry(VALVE, Pair.of(CommandValve.class, TomcatValveInjector.class)), - Map.entry(JAKARTA_VALVE, Pair.of(CommandValve.class, TomcatValveInjector.class)), - Map.entry(AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class)), - Map.entry(AGENT_CONTEXT_VALVE, Pair.of(CommandFilterChainAdvisor.class, TomcatContextValveAgentInjector.class)), - Map.entry(WEBSOCKET, Pair.of(CommandWebSocket.class, TomcatWebSocketInjector.class)) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(CommandServlet.class, TomcatServletInjector.class)); + map.put(JAKARTA_SERVLET, Pair.of(CommandServlet.class, TomcatServletInjector.class)); + map.put(FILTER, Pair.of(CommandFilter.class, TomcatFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(CommandFilter.class, TomcatFilterInjector.class)); + map.put(LISTENER, Pair.of(CommandListener.class, TomcatListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(CommandListener.class, TomcatListenerInjector.class)); + map.put(VALVE, Pair.of(CommandValve.class, TomcatValveInjector.class)); + map.put(JAKARTA_VALVE, Pair.of(CommandValve.class, TomcatValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(CommandFilterChainAdvisor.class, TomcatContextValveAgentInjector.class)); + map.put(WEBSOCKET, Pair.of(CommandWebSocket.class, TomcatWebSocketInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - SERVLET, Pair.of(GodzillaServlet.class, TomcatServletInjector.class), - JAKARTA_SERVLET, Pair.of(GodzillaServlet.class, TomcatServletInjector.class), - FILTER, Pair.of(GodzillaFilter.class, TomcatFilterInjector.class), - JAKARTA_FILTER, Pair.of(GodzillaFilter.class, TomcatFilterInjector.class), - LISTENER, Pair.of(GodzillaListener.class, TomcatListenerInjector.class), - JAKARTA_LISTENER, Pair.of(GodzillaListener.class, TomcatListenerInjector.class), - VALVE, Pair.of(GodzillaValve.class, TomcatValveInjector.class), - JAKARTA_VALVE, Pair.of(GodzillaValve.class, TomcatValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(GodzillaFilterChainAdvisor.class, TomcatContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(GodzillaServlet.class, TomcatServletInjector.class)); + map.put(JAKARTA_SERVLET, Pair.of(GodzillaServlet.class, TomcatServletInjector.class)); + map.put(FILTER, Pair.of(GodzillaFilter.class, TomcatFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(GodzillaFilter.class, TomcatFilterInjector.class)); + map.put(LISTENER, Pair.of(GodzillaListener.class, TomcatListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(GodzillaListener.class, TomcatListenerInjector.class)); + map.put(VALVE, Pair.of(GodzillaValve.class, TomcatValveInjector.class)); + map.put(JAKARTA_VALVE, Pair.of(GodzillaValve.class, TomcatValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(GodzillaFilterChainAdvisor.class, TomcatContextValveAgentInjector.class)); + return map; } @Override protected Map, Class>> getBehinderShellMap() { - return Map.of( - SERVLET, Pair.of(BehinderServlet.class, TomcatServletInjector.class), - JAKARTA_SERVLET, Pair.of(BehinderServlet.class, TomcatServletInjector.class), - FILTER, Pair.of(BehinderFilter.class, TomcatFilterInjector.class), - JAKARTA_FILTER, Pair.of(BehinderFilter.class, TomcatFilterInjector.class), - LISTENER, Pair.of(BehinderListener.class, TomcatListenerInjector.class), - JAKARTA_LISTENER, Pair.of(BehinderListener.class, TomcatListenerInjector.class), - VALVE, Pair.of(BehinderValve.class, TomcatValveInjector.class), - JAKARTA_VALVE, Pair.of(BehinderValve.class, TomcatValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(BehinderFilterChainAdvisor.class, TomcatContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(BehinderServlet.class, TomcatServletInjector.class)); + map.put(JAKARTA_SERVLET, Pair.of(BehinderServlet.class, TomcatServletInjector.class)); + map.put(FILTER, Pair.of(BehinderFilter.class, TomcatFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(BehinderFilter.class, TomcatFilterInjector.class)); + map.put(LISTENER, Pair.of(BehinderListener.class, TomcatListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(BehinderListener.class, TomcatListenerInjector.class)); + map.put(VALVE, Pair.of(BehinderValve.class, TomcatValveInjector.class)); + map.put(JAKARTA_VALVE, Pair.of(BehinderValve.class, TomcatValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, TomcatFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(BehinderFilterChainAdvisor.class, TomcatContextValveAgentInjector.class)); + return map; } } \ No newline at end of file diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/TongWeb6Shell.java b/generator/src/main/java/com/reajason/javaweb/memshell/TongWeb6Shell.java index 4967181b..d15d4c75 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/TongWeb6Shell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/TongWeb6Shell.java @@ -9,13 +9,13 @@ import com.reajason.javaweb.memshell.shelltool.godzilla.GodzillaFilterChainAdvis import com.reajason.javaweb.memshell.tomcat.behinder.BehinderListener; import com.reajason.javaweb.memshell.tomcat.command.CommandListener; import com.reajason.javaweb.memshell.tomcat.godzilla.GodzillaListener; -import com.reajason.javaweb.memshell.tomcat.injector.TomcatFilterChainAgentInjector; import com.reajason.javaweb.memshell.tongweb.behinder.BehinderValve6; import com.reajason.javaweb.memshell.tongweb.command.CommandValve6; import com.reajason.javaweb.memshell.tongweb.godzilla.GodzillaValve6; import com.reajason.javaweb.memshell.tongweb.injector.*; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; import static com.reajason.javaweb.memshell.config.Constants.*; @@ -28,43 +28,43 @@ public class TongWeb6Shell extends AbstractShell { @Override protected Map, Class>> getCommandShellMap() { - return Map.of( - FILTER, Pair.of(CommandFilter.class, TongWebFilterInjector.class), - JAKARTA_FILTER, Pair.of(CommandFilter.class, TongWebFilterInjector.class), - LISTENER, Pair.of(CommandListener.class, TongWebListenerInjector.class), - JAKARTA_LISTENER, Pair.of(CommandListener.class, TongWebListenerInjector.class), - VALVE, Pair.of(CommandValve6.class, TongWebValveInjector.class), - JAKARTA_VALVE, Pair.of(CommandValve6.class, TongWebValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, TongWebFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(CommandFilterChainAdvisor.class, TongWebContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(CommandFilter.class, TongWebFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(CommandFilter.class, TongWebFilterInjector.class)); + map.put(LISTENER, Pair.of(CommandListener.class, TongWebListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(CommandListener.class, TongWebListenerInjector.class)); + map.put(VALVE, Pair.of(CommandValve6.class, TongWebValveInjector.class)); + map.put(JAKARTA_VALVE, Pair.of(CommandValve6.class, TongWebValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, TongWebFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(CommandFilterChainAdvisor.class, TongWebContextValveAgentInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - FILTER, Pair.of(GodzillaFilter.class, TongWebFilterInjector.class), - JAKARTA_FILTER, Pair.of(GodzillaFilter.class, TongWebFilterInjector.class), - LISTENER, Pair.of(GodzillaListener.class, TongWebListenerInjector.class), - JAKARTA_LISTENER, Pair.of(GodzillaListener.class, TongWebListenerInjector.class), - VALVE, Pair.of(GodzillaValve6.class, TongWebValveInjector.class), - JAKARTA_VALVE, Pair.of(GodzillaValve6.class, TongWebValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, TongWebFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(GodzillaFilterChainAdvisor.class, TongWebContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(GodzillaFilter.class, TongWebFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(GodzillaFilter.class, TongWebFilterInjector.class)); + map.put(LISTENER, Pair.of(GodzillaListener.class, TongWebListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(GodzillaListener.class, TongWebListenerInjector.class)); + map.put(VALVE, Pair.of(GodzillaValve6.class, TongWebValveInjector.class)); + map.put(JAKARTA_VALVE, Pair.of(GodzillaValve6.class, TongWebValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, TongWebFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(GodzillaFilterChainAdvisor.class, TongWebContextValveAgentInjector.class)); + return map; } @Override protected Map, Class>> getBehinderShellMap() { - return Map.of( - FILTER, Pair.of(BehinderFilter.class, TongWebFilterInjector.class), - JAKARTA_FILTER, Pair.of(BehinderFilter.class, TongWebFilterInjector.class), - LISTENER, Pair.of(BehinderListener.class, TongWebListenerInjector.class), - JAKARTA_LISTENER, Pair.of(BehinderListener.class, TongWebListenerInjector.class), - VALVE, Pair.of(BehinderValve6.class, TongWebValveInjector.class), - JAKARTA_VALVE, Pair.of(BehinderValve6.class, TongWebValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, TongWebFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(BehinderFilterChainAdvisor.class, TongWebContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(BehinderFilter.class, TongWebFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(BehinderFilter.class, TongWebFilterInjector.class)); + map.put(LISTENER, Pair.of(BehinderListener.class, TongWebListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(BehinderListener.class, TongWebListenerInjector.class)); + map.put(VALVE, Pair.of(BehinderValve6.class, TongWebValveInjector.class)); + map.put(JAKARTA_VALVE, Pair.of(BehinderValve6.class, TongWebValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, TongWebFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(BehinderFilterChainAdvisor.class, TongWebContextValveAgentInjector.class)); + return map; } } diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/TongWeb7Shell.java b/generator/src/main/java/com/reajason/javaweb/memshell/TongWeb7Shell.java index 60aec08d..6956621a 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/TongWeb7Shell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/TongWeb7Shell.java @@ -15,6 +15,7 @@ import com.reajason.javaweb.memshell.tongweb.godzilla.GodzillaValve7; import com.reajason.javaweb.memshell.tongweb.injector.*; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; import static com.reajason.javaweb.memshell.config.Constants.*; @@ -27,43 +28,43 @@ public class TongWeb7Shell extends AbstractShell { @Override protected Map, Class>> getCommandShellMap() { - return Map.of( - FILTER, Pair.of(CommandFilter.class, TongWebFilterInjector.class), - JAKARTA_FILTER, Pair.of(CommandFilter.class, TongWebFilterInjector.class), - LISTENER, Pair.of(CommandListener.class, TongWebListenerInjector.class), - JAKARTA_LISTENER, Pair.of(CommandListener.class, TongWebListenerInjector.class), - VALVE, Pair.of(CommandValve7.class, TongWebValveInjector.class), - JAKARTA_VALVE, Pair.of(CommandValve7.class, TongWebValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, TongWebFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(CommandFilterChainAdvisor.class, TongWebContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(CommandFilter.class, TongWebFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(CommandFilter.class, TongWebFilterInjector.class)); + map.put(LISTENER, Pair.of(CommandListener.class, TongWebListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(CommandListener.class, TongWebListenerInjector.class)); + map.put(VALVE, Pair.of(CommandValve7.class, TongWebValveInjector.class)); + map.put(JAKARTA_VALVE, Pair.of(CommandValve7.class, TongWebValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(CommandFilterChainAdvisor.class, TongWebFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(CommandFilterChainAdvisor.class, TongWebContextValveAgentInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - FILTER, Pair.of(GodzillaFilter.class, TongWebFilterInjector.class), - JAKARTA_FILTER, Pair.of(GodzillaFilter.class, TongWebFilterInjector.class), - LISTENER, Pair.of(GodzillaListener.class, TongWebListenerInjector.class), - JAKARTA_LISTENER, Pair.of(GodzillaListener.class, TongWebListenerInjector.class), - VALVE, Pair.of(GodzillaValve7.class, TongWebValveInjector.class), - JAKARTA_VALVE, Pair.of(GodzillaValve7.class, TongWebValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, TongWebFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(GodzillaFilterChainAdvisor.class, TongWebContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(GodzillaFilter.class, TongWebFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(GodzillaFilter.class, TongWebFilterInjector.class)); + map.put(LISTENER, Pair.of(GodzillaListener.class, TongWebListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(GodzillaListener.class, TongWebListenerInjector.class)); + map.put(VALVE, Pair.of(GodzillaValve7.class, TongWebValveInjector.class)); + map.put(JAKARTA_VALVE, Pair.of(GodzillaValve7.class, TongWebValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(GodzillaFilterChainAdvisor.class, TongWebFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(GodzillaFilterChainAdvisor.class, TongWebContextValveAgentInjector.class)); + return map; } @Override protected Map, Class>> getBehinderShellMap() { - return Map.of( - FILTER, Pair.of(BehinderFilter.class, TongWebFilterInjector.class), - JAKARTA_FILTER, Pair.of(BehinderFilter.class, TongWebFilterInjector.class), - LISTENER, Pair.of(BehinderListener.class, TongWebListenerInjector.class), - JAKARTA_LISTENER, Pair.of(BehinderListener.class, TongWebListenerInjector.class), - VALVE, Pair.of(BehinderValve7.class, TongWebValveInjector.class), - JAKARTA_VALVE, Pair.of(BehinderValve7.class, TongWebValveInjector.class), - AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, TongWebFilterChainAgentInjector.class), - AGENT_CONTEXT_VALVE, Pair.of(BehinderFilterChainAdvisor.class, TongWebContextValveAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(FILTER, Pair.of(BehinderFilter.class, TongWebFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(BehinderFilter.class, TongWebFilterInjector.class)); + map.put(LISTENER, Pair.of(BehinderListener.class, TongWebListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(BehinderListener.class, TongWebListenerInjector.class)); + map.put(VALVE, Pair.of(BehinderValve7.class, TongWebValveInjector.class)); + map.put(JAKARTA_VALVE, Pair.of(BehinderValve7.class, TongWebValveInjector.class)); + map.put(AGENT_FILTER_CHAIN, Pair.of(BehinderFilterChainAdvisor.class, TongWebFilterChainAgentInjector.class)); + map.put(AGENT_CONTEXT_VALVE, Pair.of(BehinderFilterChainAdvisor.class, TongWebContextValveAgentInjector.class)); + return map; } } diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/UndertowShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/UndertowShell.java index c561a73d..f04f05e0 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/UndertowShell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/UndertowShell.java @@ -18,6 +18,7 @@ import com.reajason.javaweb.memshell.undertow.injector.UndertowServletInitialHan import com.reajason.javaweb.memshell.undertow.injector.UndertowServletInjector; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; import static com.reajason.javaweb.memshell.config.Constants.*; @@ -31,40 +32,40 @@ public class UndertowShell extends AbstractShell { @Override protected Map, Class>> getCommandShellMap() { - return Map.of( - SERVLET, Pair.of(CommandServlet.class, UndertowServletInjector.class), - JAKARTA_SERVLET, Pair.of(CommandServlet.class, UndertowServletInjector.class), - FILTER, Pair.of(CommandFilter.class, UndertowFilterInjector.class), - JAKARTA_FILTER, Pair.of(CommandFilter.class, UndertowFilterInjector.class), - LISTENER, Pair.of(CommandListener.class, UndertowListenerInjector.class), - JAKARTA_LISTENER, Pair.of(CommandListener.class, UndertowListenerInjector.class), - AGENT_SERVLET_HANDLER, Pair.of(CommandServletInitialHandlerAdvisor.class, UndertowServletInitialHandlerAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(CommandServlet.class, UndertowServletInjector.class)); + map.put(JAKARTA_SERVLET, Pair.of(CommandServlet.class, UndertowServletInjector.class)); + map.put(FILTER, Pair.of(CommandFilter.class, UndertowFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(CommandFilter.class, UndertowFilterInjector.class)); + map.put(LISTENER, Pair.of(CommandListener.class, UndertowListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(CommandListener.class, UndertowListenerInjector.class)); + map.put(AGENT_SERVLET_HANDLER, Pair.of(CommandServletInitialHandlerAdvisor.class, UndertowServletInitialHandlerAgentInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - SERVLET, Pair.of(GodzillaServlet.class, UndertowServletInjector.class), - JAKARTA_SERVLET, Pair.of(GodzillaServlet.class, UndertowServletInjector.class), - FILTER, Pair.of(GodzillaFilter.class, UndertowFilterInjector.class), - JAKARTA_FILTER, Pair.of(GodzillaFilter.class, UndertowFilterInjector.class), - LISTENER, Pair.of(GodzillaListener.class, UndertowListenerInjector.class), - JAKARTA_LISTENER, Pair.of(GodzillaListener.class, UndertowListenerInjector.class), - AGENT_SERVLET_HANDLER, Pair.of(GodzillaServletInitialHandlerAdvisor.class, UndertowServletInitialHandlerAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(GodzillaServlet.class, UndertowServletInjector.class)); + map.put(JAKARTA_SERVLET, Pair.of(GodzillaServlet.class, UndertowServletInjector.class)); + map.put(FILTER, Pair.of(GodzillaFilter.class, UndertowFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(GodzillaFilter.class, UndertowFilterInjector.class)); + map.put(LISTENER, Pair.of(GodzillaListener.class, UndertowListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(GodzillaListener.class, UndertowListenerInjector.class)); + map.put(AGENT_SERVLET_HANDLER, Pair.of(GodzillaServletInitialHandlerAdvisor.class, UndertowServletInitialHandlerAgentInjector.class)); + return map; } @Override protected Map, Class>> getBehinderShellMap() { - return Map.of( - SERVLET, Pair.of(BehinderServlet.class, UndertowServletInjector.class), - JAKARTA_SERVLET, Pair.of(BehinderServlet.class, UndertowServletInjector.class), - FILTER, Pair.of(BehinderFilter.class, UndertowFilterInjector.class), - JAKARTA_FILTER, Pair.of(BehinderFilter.class, UndertowFilterInjector.class), - LISTENER, Pair.of(BehinderListener.class, UndertowListenerInjector.class), - JAKARTA_LISTENER, Pair.of(BehinderListener.class, UndertowListenerInjector.class), - AGENT_SERVLET_HANDLER, Pair.of(BehinderServletInitialHandlerAdvisor.class, UndertowServletInitialHandlerAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(BehinderServlet.class, UndertowServletInjector.class)); + map.put(JAKARTA_SERVLET, Pair.of(BehinderServlet.class, UndertowServletInjector.class)); + map.put(FILTER, Pair.of(BehinderFilter.class, UndertowFilterInjector.class)); + map.put(JAKARTA_FILTER, Pair.of(BehinderFilter.class, UndertowFilterInjector.class)); + map.put(LISTENER, Pair.of(BehinderListener.class, UndertowListenerInjector.class)); + map.put(JAKARTA_LISTENER, Pair.of(BehinderListener.class, UndertowListenerInjector.class)); + map.put(AGENT_SERVLET_HANDLER, Pair.of(BehinderServletInitialHandlerAdvisor.class, UndertowServletInitialHandlerAgentInjector.class)); + return map; } } diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/WebLogicShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/WebLogicShell.java index 47f07903..90361534 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/WebLogicShell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/WebLogicShell.java @@ -1,23 +1,24 @@ package com.reajason.javaweb.memshell; -import com.reajason.javaweb.memshell.shelltool.behinder.BehinderFilterChainAdvisor; -import com.reajason.javaweb.memshell.shelltool.command.CommandFilterChainAdvisor; -import com.reajason.javaweb.memshell.shelltool.godzilla.GodzillaFilterChainAdvisor; import com.reajason.javaweb.memshell.shelltool.behinder.BehinderFilter; +import com.reajason.javaweb.memshell.shelltool.behinder.BehinderFilterChainAdvisor; import com.reajason.javaweb.memshell.shelltool.behinder.BehinderServlet; import com.reajason.javaweb.memshell.shelltool.command.CommandFilter; +import com.reajason.javaweb.memshell.shelltool.command.CommandFilterChainAdvisor; import com.reajason.javaweb.memshell.shelltool.command.CommandServlet; import com.reajason.javaweb.memshell.shelltool.godzilla.GodzillaFilter; +import com.reajason.javaweb.memshell.shelltool.godzilla.GodzillaFilterChainAdvisor; import com.reajason.javaweb.memshell.shelltool.godzilla.GodzillaServlet; import com.reajason.javaweb.memshell.weblogic.behinder.BehinderListener; import com.reajason.javaweb.memshell.weblogic.command.CommandListener; import com.reajason.javaweb.memshell.weblogic.godzilla.GodzillaListener; import com.reajason.javaweb.memshell.weblogic.injector.WebLogicFilterInjector; import com.reajason.javaweb.memshell.weblogic.injector.WebLogicListenerInjector; -import com.reajason.javaweb.memshell.weblogic.injector.WebLogicServletInjector; import com.reajason.javaweb.memshell.weblogic.injector.WebLogicServletContextAgentInjector; +import com.reajason.javaweb.memshell.weblogic.injector.WebLogicServletInjector; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; import static com.reajason.javaweb.memshell.config.Constants.*; @@ -31,31 +32,31 @@ public class WebLogicShell extends AbstractShell { @Override protected Map, Class>> getBehinderShellMap() { - return Map.of( - SERVLET, Pair.of(BehinderServlet.class, WebLogicServletInjector.class), - FILTER, Pair.of(BehinderFilter.class, WebLogicFilterInjector.class), - LISTENER, Pair.of(BehinderListener.class, WebLogicListenerInjector.class), - AGENT_SERVLET_CONTEXT, Pair.of(BehinderFilterChainAdvisor.class, WebLogicServletContextAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(BehinderServlet.class, WebLogicServletInjector.class)); + map.put(FILTER, Pair.of(BehinderFilter.class, WebLogicFilterInjector.class)); + map.put(LISTENER, Pair.of(BehinderListener.class, WebLogicListenerInjector.class)); + map.put(AGENT_SERVLET_CONTEXT, Pair.of(BehinderFilterChainAdvisor.class, WebLogicServletContextAgentInjector.class)); + return map; } @Override protected Map, Class>> getCommandShellMap() { - return Map.of( - SERVLET, Pair.of(CommandServlet.class, WebLogicServletInjector.class), - FILTER, Pair.of(CommandFilter.class, WebLogicFilterInjector.class), - LISTENER, Pair.of(CommandListener.class, WebLogicListenerInjector.class), - AGENT_SERVLET_CONTEXT, Pair.of(CommandFilterChainAdvisor.class, WebLogicServletContextAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(CommandServlet.class, WebLogicServletInjector.class)); + map.put(FILTER, Pair.of(CommandFilter.class, WebLogicFilterInjector.class)); + map.put(LISTENER, Pair.of(CommandListener.class, WebLogicListenerInjector.class)); + map.put(AGENT_SERVLET_CONTEXT, Pair.of(CommandFilterChainAdvisor.class, WebLogicServletContextAgentInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - SERVLET, Pair.of(GodzillaServlet.class, WebLogicServletInjector.class), - FILTER, Pair.of(GodzillaFilter.class, WebLogicFilterInjector.class), - LISTENER, Pair.of(GodzillaListener.class, WebLogicListenerInjector.class), - AGENT_SERVLET_CONTEXT, Pair.of(GodzillaFilterChainAdvisor.class, WebLogicServletContextAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(GodzillaServlet.class, WebLogicServletInjector.class)); + map.put(FILTER, Pair.of(GodzillaFilter.class, WebLogicFilterInjector.class)); + map.put(LISTENER, Pair.of(GodzillaListener.class, WebLogicListenerInjector.class)); + map.put(AGENT_SERVLET_CONTEXT, Pair.of(GodzillaFilterChainAdvisor.class, WebLogicServletContextAgentInjector.class)); + return map; } } diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/WebSphereShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/WebSphereShell.java index a08b4d95..19cbf089 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/WebSphereShell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/WebSphereShell.java @@ -1,13 +1,13 @@ package com.reajason.javaweb.memshell; -import com.reajason.javaweb.memshell.shelltool.behinder.BehinderFilterChainAdvisor; -import com.reajason.javaweb.memshell.shelltool.command.CommandFilterChainAdvisor; -import com.reajason.javaweb.memshell.shelltool.godzilla.GodzillaFilterChainAdvisor; import com.reajason.javaweb.memshell.shelltool.behinder.BehinderFilter; +import com.reajason.javaweb.memshell.shelltool.behinder.BehinderFilterChainAdvisor; import com.reajason.javaweb.memshell.shelltool.behinder.BehinderServlet; import com.reajason.javaweb.memshell.shelltool.command.CommandFilter; +import com.reajason.javaweb.memshell.shelltool.command.CommandFilterChainAdvisor; import com.reajason.javaweb.memshell.shelltool.command.CommandServlet; import com.reajason.javaweb.memshell.shelltool.godzilla.GodzillaFilter; +import com.reajason.javaweb.memshell.shelltool.godzilla.GodzillaFilterChainAdvisor; import com.reajason.javaweb.memshell.shelltool.godzilla.GodzillaServlet; import com.reajason.javaweb.memshell.websphere.behinder.BehinderListener; import com.reajason.javaweb.memshell.websphere.command.CommandListener; @@ -18,6 +18,7 @@ import com.reajason.javaweb.memshell.websphere.injector.WebSphereListenerInjecto import com.reajason.javaweb.memshell.websphere.injector.WebSphereServletInjector; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; import static com.reajason.javaweb.memshell.config.Constants.*; @@ -31,31 +32,31 @@ public class WebSphereShell extends AbstractShell { @Override protected Map, Class>> getCommandShellMap() { - return Map.of( - SERVLET, Pair.of(CommandServlet.class, WebSphereServletInjector.class), - FILTER, Pair.of(CommandFilter.class, WebSphereFilterInjector.class), - LISTENER, Pair.of(CommandListener.class, WebSphereListenerInjector.class), - AGENT_FILTER_MANAGER, Pair.of(CommandFilterChainAdvisor.class, WebSphereFilterChainAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(CommandServlet.class, WebSphereServletInjector.class)); + map.put(FILTER, Pair.of(CommandFilter.class, WebSphereFilterInjector.class)); + map.put(LISTENER, Pair.of(CommandListener.class, WebSphereListenerInjector.class)); + map.put(AGENT_FILTER_MANAGER, Pair.of(CommandFilterChainAdvisor.class, WebSphereFilterChainAgentInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - SERVLET, Pair.of(GodzillaServlet.class, WebSphereServletInjector.class), - FILTER, Pair.of(GodzillaFilter.class, WebSphereFilterInjector.class), - LISTENER, Pair.of(GodzillaListener.class, WebSphereListenerInjector.class), - AGENT_FILTER_MANAGER, Pair.of(GodzillaFilterChainAdvisor.class, WebSphereFilterChainAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(GodzillaServlet.class, WebSphereServletInjector.class)); + map.put(FILTER, Pair.of(GodzillaFilter.class, WebSphereFilterInjector.class)); + map.put(LISTENER, Pair.of(GodzillaListener.class, WebSphereListenerInjector.class)); + map.put(AGENT_FILTER_MANAGER, Pair.of(GodzillaFilterChainAdvisor.class, WebSphereFilterChainAgentInjector.class)); + return map; } @Override protected Map, Class>> getBehinderShellMap() { - return Map.of( - SERVLET, Pair.of(BehinderServlet.class, WebSphereServletInjector.class), - FILTER, Pair.of(BehinderFilter.class, WebSphereFilterInjector.class), - LISTENER, Pair.of(BehinderListener.class, WebSphereListenerInjector.class), - AGENT_FILTER_MANAGER, Pair.of(BehinderFilterChainAdvisor.class, WebSphereFilterChainAgentInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(SERVLET, Pair.of(BehinderServlet.class, WebSphereServletInjector.class)); + map.put(FILTER, Pair.of(BehinderFilter.class, WebSphereFilterInjector.class)); + map.put(LISTENER, Pair.of(BehinderListener.class, WebSphereListenerInjector.class)); + map.put(AGENT_FILTER_MANAGER, Pair.of(BehinderFilterChainAdvisor.class, WebSphereFilterChainAgentInjector.class)); + return map; } } diff --git a/generator/src/main/java/com/reajason/javaweb/memshell/XxlJobShell.java b/generator/src/main/java/com/reajason/javaweb/memshell/XxlJobShell.java index 678d9b04..6c96928d 100644 --- a/generator/src/main/java/com/reajason/javaweb/memshell/XxlJobShell.java +++ b/generator/src/main/java/com/reajason/javaweb/memshell/XxlJobShell.java @@ -5,6 +5,7 @@ import com.reajason.javaweb.memshell.springwebflux.godzilla.GodzillaNettyHandler import com.reajason.javaweb.memshell.xxljob.injector.XxlJobNettyHandlerInjector; import org.apache.commons.lang3.tuple.Pair; +import java.util.LinkedHashMap; import java.util.Map; /** @@ -16,15 +17,15 @@ public class XxlJobShell extends AbstractShell { @Override protected Map, Class>> getCommandShellMap() { - return Map.of( - NETTY_HANDLER, Pair.of(CommandNettyHandler.class, XxlJobNettyHandlerInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(NETTY_HANDLER, Pair.of(CommandNettyHandler.class, XxlJobNettyHandlerInjector.class)); + return map; } @Override protected Map, Class>> getGodzillaShellMap() { - return Map.of( - NETTY_HANDLER, Pair.of(GodzillaNettyHandler.class, XxlJobNettyHandlerInjector.class) - ); + Map, Class>> map = new LinkedHashMap<>(); + map.put(NETTY_HANDLER, Pair.of(GodzillaNettyHandler.class, XxlJobNettyHandlerInjector.class)); + return map; } }