> SPRING_BOOT_CONFIG_LIST = Collections.synchronizedSet(new HashSet<>());
-
- private static final long MAX_CACHE_TIME = 30L * 60L * 1000L; // half an hour.
-
- private static final int MAX_CACHE_SIZE = 1000;
-
- private static long PROPERTIES_LOAD_TIME;
-
- public static Properties SPRING_PROPERTIES = null;
-
- private SpringBootConfigInitializer() {
-
- }
-
- public static boolean isSpringPropertiesEmpty() {
- return SPRING_PROPERTIES == null || SPRING_PROPERTIES.isEmpty();
- }
-
- public static synchronized void initializeConfig(SpringBootConfigNode springBootConfig) {
- if (SPRING_PROPERTIES != null) {
- try {
- LOG.info("initialize Spring Config Class {}.", springBootConfig.root());
- ConfigInitializer.initialize(SPRING_PROPERTIES, springBootConfig.root(), true);
- } catch (Throwable e) {
- LOG.error(e, "Failed to set the agent settings {} to Config={} ", SPRING_PROPERTIES, springBootConfig.root());
- }
- }
- boolean isStarting = PROPERTIES_LOAD_TIME == 0L;
- boolean overtime = System.currentTimeMillis() - PROPERTIES_LOAD_TIME > MAX_CACHE_TIME;
- boolean oversize = SPRING_BOOT_CONFIG_LIST.size() > MAX_CACHE_SIZE;
- // avoid memory leak.
- if (isStarting || (!oversize && !overtime)) {
- SPRING_BOOT_CONFIG_LIST.add(springBootConfig.root());
- } else {
- LOG.warn("spirng Config Class is skipped {}.", springBootConfig.root());
- }
- }
-
- public static synchronized void setSpringProperties(Properties properties) {
- if (properties != null && (SPRING_PROPERTIES == null || properties.size() > SPRING_PROPERTIES.size())) {
- LOG.info("set Spring Config Properties before : {}.", SPRING_PROPERTIES);
- SPRING_PROPERTIES = properties;
- LOG.info("set Spring Config Properties after : {}.", SPRING_PROPERTIES);
- PROPERTIES_LOAD_TIME = System.currentTimeMillis();
- }
- for (Class> clazz : SPRING_BOOT_CONFIG_LIST) {
- try {
- LOG.info("initialize Spring Config Class in loop {}.", clazz);
- ConfigInitializer.initialize(SPRING_PROPERTIES, clazz);
- } catch (Throwable e) {
- LOG.error(e, "Failed to set the agent Config={} from settings {}", clazz, properties);
- }
- }
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/boot/SpringBootConfigNode.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/boot/SpringBootConfigNode.java
deleted file mode 100644
index 01350ca2..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/boot/SpringBootConfigNode.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.boot;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface SpringBootConfigNode {
-
- /**
- * @return Class as the root to do config initialization.
- */
- Class> root();
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/Constants.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/Constants.java
deleted file mode 100644
index 25f3d7bb..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/Constants.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.conf;
-
-public class Constants {
-
- public static String PATH_SEPARATOR = System.getProperty("file.separator", "/");
-
- public static String LINE_SEPARATOR = System.getProperty("line.separator", "\n");
-
- public static String EMPTY_STRING = "";
-
- public static char SERVICE_NAME_PART_CONNECTOR = '|';
-
- // The name of the layer that represents agent-installed services,
- // which is defined at
- // https://github.com/apache/skywalking/blob/85ce1645be53e46286f36c0ea206c60db2d1a716/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Layer.java#L30
- public static String EVENT_LAYER_NAME = "GENERAL";
-
- public static int NULL_VALUE = 0;
-
- public static String SPRING_BOOT_CONFIG_PREFIX = "spring.dynamic.thread-pool";
-
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/SnifferConfigInitializer.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/SnifferConfigInitializer.java
deleted file mode 100644
index b8f8f4d0..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/SnifferConfigInitializer.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.conf;
-
-import cn.hippo4j.agent.core.boot.AgentPackagePath;
-import cn.hippo4j.agent.core.util.PropertyPlaceholderHelper;
-import cn.hippo4j.agent.core.util.StringUtil;
-import cn.hippo4j.common.boot.AgentPackageNotFoundException;
-import cn.hippo4j.common.conf.Config;
-import cn.hippo4j.common.conf.ConfigNotFoundException;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.common.logging.core.JsonLogResolver;
-import cn.hippo4j.common.logging.core.PatternLogResolver;
-import cn.hippo4j.common.toolkit.agent.ConfigInitializer;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStreamReader;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import static cn.hippo4j.common.conf.Constants.SERVICE_NAME_PART_CONNECTOR;
-
-/**
- * The SnifferConfigInitializer initializes all configs in several way.
- */
-public class SnifferConfigInitializer {
-
- private static ILog LOGGER = LogManager.getLogger(SnifferConfigInitializer.class);
- private static final String SPECIFIED_CONFIG_PATH = "hippo4j_config";
- private static final String DEFAULT_CONFIG_FILE_NAME = "/config/agent.config";
- private static final String ENV_KEY_PREFIX = "hippo4j.";
- private static Properties AGENT_SETTINGS;
- private static boolean IS_INIT_COMPLETED = false;
-
- /**
- * If the specified agent config path is set, the agent will try to locate the specified agent config. If the
- * specified agent config path is not set , the agent will try to locate `agent.config`, which should be in the
- * /config directory of agent package.
- *
- * Also try to override the config by system.properties. All the keys in this place should start with {@link
- * #ENV_KEY_PREFIX}. e.g. in env `hippo4j.agent.service_name=yourAppName` to override `agent.service_name` in
- * config file.
- *
- * At the end, `agent.service_name` and `collector.servers` must not be blank.
- */
- public static void initializeCoreConfig(String agentOptions) {
- AGENT_SETTINGS = new Properties();
- try (final InputStreamReader configFileStream = loadConfig()) {
- AGENT_SETTINGS.load(configFileStream);
- for (String key : AGENT_SETTINGS.stringPropertyNames()) {
- String value = (String) AGENT_SETTINGS.get(key);
- AGENT_SETTINGS.put(key, PropertyPlaceholderHelper.INSTANCE.replacePlaceholders(value, AGENT_SETTINGS));
- }
-
- } catch (Exception e) {
- LOGGER.error(e, "Failed to read the config file, hippo4j is going to run in default config.");
- }
-
- try {
- overrideConfigBySystemProp();
- } catch (Exception e) {
- LOGGER.error(e, "Failed to read the system properties.");
- }
-
- agentOptions = StringUtil.trim(agentOptions, ',');
- if (!StringUtil.isEmpty(agentOptions)) {
- try {
- agentOptions = agentOptions.trim();
- LOGGER.info("Agent options is {}.", agentOptions);
-
- overrideConfigByAgentOptions(agentOptions);
- } catch (Exception e) {
- LOGGER.error(e, "Failed to parse the agent options, val is {}.", agentOptions);
- }
- }
-
- initializeConfig(Config.class);
- // reconfigure logger after config initialization
- configureLogger();
- LOGGER = LogManager.getLogger(SnifferConfigInitializer.class);
-
- if (StringUtil.isEmpty(Config.Agent.SERVICE_NAME)) {
- throw new ExceptionInInitializerError("`agent.service_name` is missing.");
- } else {
- if (StringUtil.isNotEmpty(Config.Agent.NAMESPACE) || StringUtil.isNotEmpty(Config.Agent.CLUSTER)) {
- Config.Agent.SERVICE_NAME = StringUtil.join(
- SERVICE_NAME_PART_CONNECTOR,
- Config.Agent.SERVICE_NAME,
- Config.Agent.NAMESPACE,
- Config.Agent.CLUSTER);
- }
- }
- // if (StringUtil.isEmpty(Config.Collector.BACKEND_SERVICE)) {
- // throw new ExceptionInInitializerError("`collector.backend_service` is missing.");
- // }
- if (Config.Plugin.PEER_MAX_LENGTH <= 3) {
- LOGGER.warn(
- "PEER_MAX_LENGTH configuration:{} error, the default value of 200 will be used.",
- Config.Plugin.PEER_MAX_LENGTH);
- Config.Plugin.PEER_MAX_LENGTH = 200;
- }
-
- IS_INIT_COMPLETED = true;
- }
-
- /**
- * Initialize field values of any given config class.
- *
- * @param configClass to host the settings for code access.
- */
- public static void initializeConfig(Class configClass) {
- if (AGENT_SETTINGS == null) {
- LOGGER.error("Plugin configs have to be initialized after core config initialization.");
- return;
- }
- try {
- ConfigInitializer.initialize(AGENT_SETTINGS, configClass);
- } catch (IllegalAccessException e) {
- LOGGER.error(e,
- "Failed to set the agent settings {}"
- + " to Config={} ",
- AGENT_SETTINGS, configClass);
- }
- }
-
- private static void overrideConfigByAgentOptions(String agentOptions) throws IllegalArgumentException {
- for (List terms : parseAgentOptions(agentOptions)) {
- if (terms.size() != 2) {
- throw new IllegalArgumentException("[" + terms + "] is not a key-value pair.");
- }
- AGENT_SETTINGS.put(terms.get(0), terms.get(1));
- }
- }
-
- private static List> parseAgentOptions(String agentOptions) {
- List> options = new ArrayList<>();
- List terms = new ArrayList<>();
- boolean isInQuotes = false;
- StringBuilder currentTerm = new StringBuilder();
- for (char c : agentOptions.toCharArray()) {
- if (c == '\'' || c == '"') {
- isInQuotes = !isInQuotes;
- } else if (c == '=' && !isInQuotes) { // key-value pair uses '=' as separator
- terms.add(currentTerm.toString());
- currentTerm = new StringBuilder();
- } else if (c == ',' && !isInQuotes) { // multiple options use ',' as separator
- terms.add(currentTerm.toString());
- currentTerm = new StringBuilder();
-
- options.add(terms);
- terms = new ArrayList<>();
- } else {
- currentTerm.append(c);
- }
- }
- // add the last term and option without separator
- terms.add(currentTerm.toString());
- options.add(terms);
- return options;
- }
-
- public static boolean isInitCompleted() {
- return IS_INIT_COMPLETED;
- }
-
- /**
- * Override the config by system properties. The property key must start with `hippo4j`, the result should be as
- * same as in `agent.config`
- *
- * such as: Property key of `agent.service_name` should be `hippo4j.agent.service_name`
- */
- private static void overrideConfigBySystemProp() {
- Properties systemProperties = System.getProperties();
- for (final Map.Entry prop : systemProperties.entrySet()) {
- String key = prop.getKey().toString();
- if (key.startsWith(ENV_KEY_PREFIX)) {
- String realKey = key.substring(ENV_KEY_PREFIX.length());
- AGENT_SETTINGS.put(realKey, prop.getValue());
- }
- }
- }
-
- /**
- * Load the specified config file or default config file
- *
- * @return the config file {@link InputStream}, or null if not needEnhance.
- */
- private static InputStreamReader loadConfig() throws AgentPackageNotFoundException, cn.hippo4j.common.conf.ConfigNotFoundException {
- String specifiedConfigPath = System.getProperty(SPECIFIED_CONFIG_PATH);
- File configFile = StringUtil.isEmpty(specifiedConfigPath) ? new File(
- AgentPackagePath.getPath(), DEFAULT_CONFIG_FILE_NAME) : new File(specifiedConfigPath);
-
- if (configFile.exists() && configFile.isFile()) {
- try {
- LOGGER.info("Config file found in {}.", configFile);
-
- return new InputStreamReader(new FileInputStream(configFile), StandardCharsets.UTF_8);
- } catch (FileNotFoundException e) {
- throw new ConfigNotFoundException("Failed to load agent.config", e);
- }
- }
- throw new ConfigNotFoundException("Failed to load agent.config.");
- }
-
- static void configureLogger() {
- switch (Config.Logging.RESOLVER) {
- case JSON:
- LogManager.setLogResolver(new JsonLogResolver());
- break;
- case PATTERN:
- default:
- LogManager.setLogResolver(new PatternLogResolver());
- }
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/dynamic/AgentConfigChangeWatcher.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/dynamic/AgentConfigChangeWatcher.java
deleted file mode 100644
index e896584d..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/conf/dynamic/AgentConfigChangeWatcher.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.conf.dynamic;
-
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-
-@Getter
-public abstract class AgentConfigChangeWatcher {
-
- // Config key, should match KEY in the Table of Agent Configuration Properties.
- private final String propertyKey;
-
- public AgentConfigChangeWatcher(String propertyKey) {
- this.propertyKey = propertyKey;
- }
-
- /**
- * Notify the watcher, the new value received.
- *
- * @param value of new.
- */
- public abstract void notify(ConfigChangeEvent value);
-
- /**
- * @return current value of current config.
- */
- public abstract String value();
-
- @Override
- public String toString() {
- return "AgentConfigChangeWatcher{"
- + "propertyKey='" + propertyKey + '\''
- + '}';
- }
-
- @Getter
- @RequiredArgsConstructor
- public static class ConfigChangeEvent {
-
- private final String newValue;
- private final EventType eventType;
- }
-
- public enum EventType {
- ADD, MODIFY, DELETE
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/jvm/LoadedLibraryCollector.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/jvm/LoadedLibraryCollector.java
deleted file mode 100644
index aebec1f0..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/jvm/LoadedLibraryCollector.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.jvm;
-
-import cn.hippo4j.agent.core.util.CollectionUtil;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-
-import java.io.File;
-import java.lang.management.ManagementFactory;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-public class LoadedLibraryCollector {
-
- private static final ILog LOGGER = LogManager.getLogger(LoadedLibraryCollector.class);
- private static final String JAR_SEPARATOR = "!";
- private static Set CURRENT_URL_CLASSLOADER_SET = new HashSet<>();
- private static final Gson GSON = new GsonBuilder().disableHtmlEscaping().create();
- /**
- * Prevent OOM in special scenes
- */
- private static int CURRENT_URL_CLASSLOADER_SET_MAX_SIZE = 50;
-
- public static void registerURLClassLoader(ClassLoader classLoader) {
- if (CURRENT_URL_CLASSLOADER_SET.size() < CURRENT_URL_CLASSLOADER_SET_MAX_SIZE && classLoader instanceof URLClassLoader) {
- CURRENT_URL_CLASSLOADER_SET.add(classLoader);
- }
- }
-
- private static String getVmStartTime() {
- long startTime = ManagementFactory.getRuntimeMXBean().getStartTime();
- return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(startTime));
- }
-
- private static List getVmArgs() {
- List vmArgs = ManagementFactory.getRuntimeMXBean().getInputArguments();
- List sortedVmArgs = new ArrayList<>(vmArgs);
- Collections.sort(sortedVmArgs);
- return sortedVmArgs;
- }
-
- private static List getLibJarNames() {
- List classLoaderUrls = loadClassLoaderUrls();
- return extractLibJarNamesFromURLs(classLoaderUrls);
- }
-
- private static List loadClassLoaderUrls() {
- List classLoaderUrls = new ArrayList<>();
- for (ClassLoader classLoader : CURRENT_URL_CLASSLOADER_SET) {
- try {
- URLClassLoader webappClassLoader = (URLClassLoader) classLoader;
- URL[] urls = webappClassLoader.getURLs();
- classLoaderUrls.addAll(Arrays.asList(urls));
- } catch (Exception e) {
- LOGGER.warn("Load classloader urls exception: {}", e.getMessage());
- }
- }
- return classLoaderUrls;
- }
-
- private static List extractLibJarNamesFromURLs(List urls) {
- Set libJarNames = new HashSet<>();
- for (URL url : urls) {
- try {
- String libJarName = extractLibJarName(url);
- if (libJarName.endsWith(".jar")) {
- libJarNames.add(libJarName);
- }
- } catch (Exception e) {
- LOGGER.warn("Extracting library name exception: {}", e.getMessage());
- }
- }
- List sortedLibJarNames = new ArrayList<>(libJarNames.size());
- if (!CollectionUtil.isEmpty(libJarNames)) {
- sortedLibJarNames.addAll(libJarNames);
- Collections.sort(sortedLibJarNames);
- }
- return sortedLibJarNames;
- }
-
- private static String extractLibJarName(URL url) {
- String protocol = url.getProtocol();
- if (protocol.equals("file")) {
- return extractNameFromFile(url.toString());
- } else if (protocol.equals("jar")) {
- return extractNameFromJar(url.toString());
- } else {
- return "";
- }
- }
-
- private static String extractNameFromFile(String fileUri) {
- int lastIndexOfSeparator = fileUri.lastIndexOf(File.separator);
- if (lastIndexOfSeparator < 0) {
- return fileUri;
- } else {
- return fileUri.substring(lastIndexOfSeparator + 1);
- }
- }
-
- private static String extractNameFromJar(String jarUri) {
- String uri = jarUri.substring(0, jarUri.lastIndexOf(JAR_SEPARATOR));
- return extractNameFromFile(uri);
- }
-
-}
\ No newline at end of file
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/os/OSUtil.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/os/OSUtil.java
deleted file mode 100644
index c3040fff..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/os/OSUtil.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.os;
-
-import java.lang.management.ManagementFactory;
-import java.net.Inet4Address;
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-import java.net.SocketException;
-import java.net.UnknownHostException;
-import java.util.Enumeration;
-import java.util.LinkedList;
-import java.util.List;
-
-public class OSUtil {
-
- private static volatile String OS_NAME;
- private static volatile String HOST_NAME;
- private static volatile List IPV4_LIST;
- private static volatile int PROCESS_NO = 0;
-
- public static String getOsName() {
- if (OS_NAME == null) {
- OS_NAME = System.getProperty("os.name");
- }
- return OS_NAME;
- }
-
- public static String getHostName() {
- if (HOST_NAME == null) {
- try {
- InetAddress host = InetAddress.getLocalHost();
- HOST_NAME = host.getHostName();
- } catch (UnknownHostException e) {
- HOST_NAME = "unknown";
- }
- }
- return HOST_NAME;
- }
-
- public static List getAllIPV4() {
- if (IPV4_LIST == null) {
- IPV4_LIST = new LinkedList<>();
- try {
- Enumeration interfs = NetworkInterface.getNetworkInterfaces();
- while (interfs.hasMoreElements()) {
- NetworkInterface networkInterface = interfs.nextElement();
- Enumeration inetAddresses = networkInterface.getInetAddresses();
- while (inetAddresses.hasMoreElements()) {
- InetAddress address = inetAddresses.nextElement();
- if (address instanceof Inet4Address) {
- String addressStr = address.getHostAddress();
- if ("127.0.0.1".equals(addressStr)) {
- continue;
- } else if ("localhost".equals(addressStr)) {
- continue;
- }
- IPV4_LIST.add(addressStr);
- }
- }
- }
- } catch (SocketException e) {
-
- }
- }
- return IPV4_LIST;
- }
-
- public static String getIPV4() {
- final List allIPV4 = getAllIPV4();
- if (allIPV4.size() > 0) {
- return allIPV4.get(0);
- } else {
- return "no-hostname";
- }
- }
-
- public static int getProcessNo() {
- if (PROCESS_NO == 0) {
- try {
- PROCESS_NO = Integer.parseInt(ManagementFactory.getRuntimeMXBean().getName().split("@")[0]);
- } catch (Exception e) {
- PROCESS_NO = -1;
- }
- }
- return PROCESS_NO;
- }
-
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/os/ProcessorUtil.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/os/ProcessorUtil.java
deleted file mode 100644
index 30abb493..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/os/ProcessorUtil.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.os;
-
-import java.lang.management.ManagementFactory;
-
-public class ProcessorUtil {
-
- public static int getNumberOfProcessors() {
- return ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors();
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/AbstractClassEnhancePluginDefine.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/AbstractClassEnhancePluginDefine.java
deleted file mode 100644
index 82278a6a..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/AbstractClassEnhancePluginDefine.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.StaticMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.ClassEnhancePluginDefine;
-import cn.hippo4j.agent.core.plugin.interceptor.v2.InstanceMethodsInterceptV2Point;
-import cn.hippo4j.agent.core.plugin.interceptor.v2.StaticMethodsInterceptV2Point;
-import cn.hippo4j.agent.core.plugin.match.ClassMatch;
-import cn.hippo4j.agent.core.util.CollectionUtil;
-import cn.hippo4j.agent.core.util.StringUtil;
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.dynamic.DynamicType;
-
-import java.util.List;
-
-/**
- * Basic abstract class of all sky-walking auto-instrumentation plugins.
- *
- * It provides the outline of enhancing the target class. If you want to know more about enhancing, you should go to see
- * {@link ClassEnhancePluginDefine}
- */
-public abstract class AbstractClassEnhancePluginDefine {
-
- private static final ILog LOGGER = LogManager.getLogger(AbstractClassEnhancePluginDefine.class);
-
- /**
- * New field name.
- */
- public static final String CONTEXT_ATTR_NAME = "_$EnhancedClassField_ws";
-
- /**
- * Main entrance of enhancing the class.
- *
- * @param typeDescription target class description.
- * @param builder byte-buddy's builder to manipulate target class's bytecode.
- * @param classLoader load the given transformClass
- * @return the new builder, or null if not be enhanced.
- * @throws PluginException when set builder failure.
- */
- public DynamicType.Builder> define(TypeDescription typeDescription, DynamicType.Builder> builder,
- ClassLoader classLoader, EnhanceContext context) throws PluginException {
- String interceptorDefineClassName = this.getClass().getName();
- String transformClassName = typeDescription.getTypeName();
- if (StringUtil.isEmpty(transformClassName)) {
- LOGGER.warn("classname of being intercepted is not defined by {}.", interceptorDefineClassName);
- return null;
- }
-
- LOGGER.debug("prepare to enhance class {} by {}.", transformClassName, interceptorDefineClassName);
- WitnessFinder finder = WitnessFinder.INSTANCE;
- /**
- * find witness classes for enhance class
- */
- String[] witnessClasses = witnessClasses();
- if (witnessClasses != null) {
- for (String witnessClass : witnessClasses) {
- if (!finder.exist(witnessClass, classLoader)) {
- LOGGER.warn("enhance class {} by plugin {} is not activated. Witness class {} does not exist.", transformClassName, interceptorDefineClassName, witnessClass);
- return null;
- }
- }
- }
- List witnessMethods = witnessMethods();
- if (!CollectionUtil.isEmpty(witnessMethods)) {
- for (WitnessMethod witnessMethod : witnessMethods) {
- if (!finder.exist(witnessMethod, classLoader)) {
- LOGGER.warn("enhance class {} by plugin {} is not activated. Witness method {} does not exist.", transformClassName, interceptorDefineClassName, witnessMethod);
- return null;
- }
- }
- }
-
- /**
- * find origin class source code for interceptor
- */
- DynamicType.Builder> newClassBuilder = this.enhance(typeDescription, builder, classLoader, context);
-
- context.initializationStageCompleted();
- LOGGER.debug("enhance class {} by {} completely.", transformClassName, interceptorDefineClassName);
-
- return newClassBuilder;
- }
-
- /**
- * Begin to define how to enhance class. After invoke this method, only means definition is finished.
- *
- * @param typeDescription target class description
- * @param newClassBuilder byte-buddy's builder to manipulate class bytecode.
- * @return new byte-buddy's builder for further manipulation.
- */
- protected DynamicType.Builder> enhance(TypeDescription typeDescription, DynamicType.Builder> newClassBuilder,
- ClassLoader classLoader, EnhanceContext context) throws PluginException {
- newClassBuilder = this.enhanceClass(typeDescription, newClassBuilder, classLoader);
-
- newClassBuilder = this.enhanceInstance(typeDescription, newClassBuilder, classLoader, context);
-
- return newClassBuilder;
- }
-
- /**
- * Enhance a class to intercept constructors and class instance methods.
- *
- * @param typeDescription target class description
- * @param newClassBuilder byte-buddy's builder to manipulate class bytecode.
- * @return new byte-buddy's builder for further manipulation.
- */
- protected abstract DynamicType.Builder> enhanceInstance(TypeDescription typeDescription,
- DynamicType.Builder> newClassBuilder, ClassLoader classLoader,
- EnhanceContext context) throws PluginException;
-
- /**
- * Enhance a class to intercept class static methods.
- *
- * @param typeDescription target class description
- * @param newClassBuilder byte-buddy's builder to manipulate class bytecode.
- * @return new byte-buddy's builder for further manipulation.
- */
- protected abstract DynamicType.Builder> enhanceClass(TypeDescription typeDescription, DynamicType.Builder> newClassBuilder,
- ClassLoader classLoader) throws PluginException;
-
- /**
- * Define the {@link ClassMatch} for filtering class.
- *
- * @return {@link ClassMatch}
- */
- protected abstract ClassMatch enhanceClass();
-
- /**
- * Witness classname list. Why need witness classname? Let's see like this: A library existed two released versions
- * (like 1.0, 2.0), which include the same target classes, but because of version iterator, they may have the same
- * name, but different methods, or different method arguments list. So, if I want to target the particular version
- * (let's say 1.0 for example), version number is obvious not an option, this is the moment you need "Witness
- * classes". You can add any classes only in this particular release version ( something like class
- * com.company.1.x.A, only in 1.0 ), and you can achieve the goal.
- */
- protected String[] witnessClasses() {
- return new String[]{};
- }
-
- protected List witnessMethods() {
- return null;
- }
-
- public boolean isBootstrapInstrumentation() {
- return false;
- }
-
- /**
- * Constructor methods intercept point. See {@link ConstructorInterceptPoint}
- *
- * @return collections of {@link ConstructorInterceptPoint}
- */
- public abstract ConstructorInterceptPoint[] getConstructorsInterceptPoints();
-
- /**
- * Instance methods intercept point. See {@link InstanceMethodsInterceptPoint}
- *
- * @return collections of {@link InstanceMethodsInterceptPoint}
- */
- public abstract InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints();
-
- /**
- * Instance methods intercept v2 point. See {@link InstanceMethodsInterceptV2Point}
- *
- * @return collections of {@link InstanceMethodsInterceptV2Point}
- */
- public abstract InstanceMethodsInterceptV2Point[] getInstanceMethodsInterceptV2Points();
-
- /**
- * Static methods intercept point. See {@link StaticMethodsInterceptPoint}
- *
- * @return collections of {@link StaticMethodsInterceptPoint}
- */
- public abstract StaticMethodsInterceptPoint[] getStaticMethodsInterceptPoints();
-
- /**
- * Instance methods intercept v2 point. See {@link InstanceMethodsInterceptV2Point}
- *
- * @return collections of {@link InstanceMethodsInterceptV2Point}
- */
- public abstract StaticMethodsInterceptV2Point[] getStaticMethodsInterceptV2Points();
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/ByteBuddyCoreClasses.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/ByteBuddyCoreClasses.java
deleted file mode 100644
index 95c5ef9f..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/ByteBuddyCoreClasses.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin;
-
-/**
- * All ByteBuddy core classes required to expose, including open edge for JDK 9+ module, or Bootstrap instrumentation.
- */
-public class ByteBuddyCoreClasses {
-
- private static final String SHADE_PACKAGE = "cn.hippo4j.agent.dependencies.";
-
- public static final String[] CLASSES = {
- SHADE_PACKAGE + "net.bytebuddy.implementation.bind.annotation.RuntimeType",
- SHADE_PACKAGE + "net.bytebuddy.implementation.bind.annotation.This",
- SHADE_PACKAGE + "net.bytebuddy.implementation.bind.annotation.AllArguments",
- SHADE_PACKAGE + "net.bytebuddy.implementation.bind.annotation.AllArguments$Assignment",
- SHADE_PACKAGE + "net.bytebuddy.implementation.bind.annotation.SuperCall",
- SHADE_PACKAGE + "net.bytebuddy.implementation.bind.annotation.Origin",
- SHADE_PACKAGE + "net.bytebuddy.implementation.bind.annotation.Morph",
- };
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/DynamicPluginLoader.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/DynamicPluginLoader.java
deleted file mode 100755
index 30ff5a94..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/DynamicPluginLoader.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin;
-
-import cn.hippo4j.agent.core.plugin.loader.AgentClassLoader;
-import cn.hippo4j.agent.core.plugin.loader.InstrumentationLoader;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ServiceLoader;
-
-/**
- * The plugin can be inserted into the kernel by implementing this spi return PluginDefine list.
- */
-
-public enum DynamicPluginLoader {
-
- INSTANCE;
-
- public List load(AgentClassLoader classLoader) {
- List all = new ArrayList();
- for (InstrumentationLoader instrumentationLoader : ServiceLoader.load(InstrumentationLoader.class, classLoader)) {
- List plugins = instrumentationLoader.load(classLoader);
- if (plugins != null && !plugins.isEmpty()) {
- all.addAll(plugins);
- }
- }
- return all;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/EnhanceContext.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/EnhanceContext.java
deleted file mode 100644
index c903ce86..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/EnhanceContext.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin;
-
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.ClassEnhancePluginDefine;
-
-/**
- * The EnhanceContext represents the context or status for processing a class.
- *
- * Based on this context, the plugin core {@link ClassEnhancePluginDefine} knows how to process the specific steps for
- * every particular plugin.
- */
-public class EnhanceContext {
-
- private boolean isEnhanced = false;
- /**
- * The object has already been enhanced or extended. e.g. added the new field, or implemented the new interface
- */
- private boolean objectExtended = false;
-
- public boolean isEnhanced() {
- return isEnhanced;
- }
-
- public void initializationStageCompleted() {
- isEnhanced = true;
- }
-
- public boolean isObjectExtended() {
- return objectExtended;
- }
-
- public void extendObjectCompleted() {
- objectExtended = true;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/InstrumentDebuggingClass.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/InstrumentDebuggingClass.java
deleted file mode 100644
index 02a900cc..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/InstrumentDebuggingClass.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin;
-
-import cn.hippo4j.agent.core.boot.AgentPackagePath;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.common.boot.AgentPackageNotFoundException;
-import cn.hippo4j.common.conf.Config;
-import net.bytebuddy.dynamic.DynamicType;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * The manipulated class output. Write the dynamic classes to the `debugging` folder, when we need to do some debug and
- * recheck.
- */
-public enum InstrumentDebuggingClass {
-
- INSTANCE;
-
- private static final ILog LOGGER = LogManager.getLogger(InstrumentDebuggingClass.class);
- private File debuggingClassesRootPath;
-
- public void log(DynamicType dynamicType) {
- if (!Config.Agent.IS_OPEN_DEBUGGING_CLASS) {
- return;
- }
-
- /**
- * try to do I/O things in synchronized way, to avoid unexpected situations.
- */
- synchronized (INSTANCE) {
- try {
- if (debuggingClassesRootPath == null) {
- try {
- debuggingClassesRootPath = new File(AgentPackagePath.getPath(), "/debugging");
- if (!debuggingClassesRootPath.exists()) {
- debuggingClassesRootPath.mkdir();
- }
- } catch (AgentPackageNotFoundException e) {
- LOGGER.error(e, "Can't find the root path for creating /debugging folder.");
- }
- }
-
- try {
- dynamicType.saveIn(debuggingClassesRootPath);
- } catch (IOException e) {
- LOGGER.error(e, "Can't save class {} to file." + dynamicType.getTypeDescription().getActualName());
- }
- } catch (Throwable t) {
- LOGGER.error(t, "Save debugging classes fail.");
- }
- }
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginBootstrap.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginBootstrap.java
deleted file mode 100644
index f76fe19d..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginBootstrap.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin;
-
-import cn.hippo4j.agent.core.plugin.loader.AgentClassLoader;
-import cn.hippo4j.common.boot.AgentPackageNotFoundException;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Plugins finder. Use {@link PluginResourcesResolver} to find all plugins, and ask {@link PluginCfg} to load all plugin
- * definitions.
- */
-public class PluginBootstrap {
-
- private static final ILog LOGGER = LogManager.getLogger(PluginBootstrap.class);
-
- /**
- * load all plugins.
- *
- * @return plugin definition list.
- */
- public List loadPlugins() throws AgentPackageNotFoundException {
- AgentClassLoader.initDefaultLoader();
-
- PluginResourcesResolver resolver = new PluginResourcesResolver();
- List resources = resolver.getResources();
-
- if (resources == null || resources.size() == 0) {
- LOGGER.info("no plugin files (hippo4j-plugin.def) found, continue to start application.");
- return new ArrayList();
- }
-
- for (URL pluginUrl : resources) {
- try {
- PluginCfg.INSTANCE.load(pluginUrl.openStream());
- } catch (Throwable t) {
- LOGGER.error(t, "plugin file [{}] init failure.", pluginUrl);
- }
- }
-
- List pluginClassList = PluginCfg.INSTANCE.getPluginClassList();
-
- List plugins = new ArrayList();
- for (PluginDefine pluginDefine : pluginClassList) {
- try {
- LOGGER.debug("loading plugin class {}.", pluginDefine.getDefineClass());
- AbstractClassEnhancePluginDefine plugin = (AbstractClassEnhancePluginDefine) Class.forName(pluginDefine.getDefineClass(), true, AgentClassLoader
- .getDefault()).newInstance();
- plugins.add(plugin);
- } catch (Throwable t) {
- LOGGER.error(t, "load plugin [{}] failure.", pluginDefine.getDefineClass());
- }
- }
-
- plugins.addAll(DynamicPluginLoader.INSTANCE.load(AgentClassLoader.getDefault()));
-
- return plugins;
-
- }
-
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginCfg.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginCfg.java
deleted file mode 100644
index fe707c9c..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginCfg.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.agent.core.plugin.exception.IllegalPluginDefineException;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-
-public enum PluginCfg {
-
- INSTANCE;
-
- private static final ILog LOGGER = LogManager.getLogger(PluginCfg.class);
-
- private List pluginClassList = new ArrayList();
- private PluginSelector pluginSelector = new PluginSelector();
-
- void load(InputStream input) throws IOException {
- try {
- BufferedReader reader = new BufferedReader(new InputStreamReader(input));
- String pluginDefine;
- while ((pluginDefine = reader.readLine()) != null) {
- try {
- if (pluginDefine.trim().length() == 0 || pluginDefine.startsWith("#")) {
- continue;
- }
- PluginDefine plugin = PluginDefine.build(pluginDefine);
- pluginClassList.add(plugin);
- } catch (IllegalPluginDefineException e) {
- LOGGER.error(e, "Failed to format plugin({}) define.", pluginDefine);
- }
- }
- pluginClassList = pluginSelector.select(pluginClassList);
- } finally {
- input.close();
- }
- }
-
- public List getPluginClassList() {
- return pluginClassList;
- }
-
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginDefine.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginDefine.java
deleted file mode 100644
index 79501e09..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginDefine.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin;
-
-import cn.hippo4j.agent.core.plugin.exception.IllegalPluginDefineException;
-import cn.hippo4j.agent.core.util.StringUtil;
-
-public class PluginDefine {
-
- /**
- * Plugin name.
- */
- private String name;
-
- /**
- * The class name of plugin defined.
- */
- private String defineClass;
-
- private PluginDefine(String name, String defineClass) {
- this.name = name;
- this.defineClass = defineClass;
- }
-
- public static PluginDefine build(String define) throws IllegalPluginDefineException {
- if (StringUtil.isEmpty(define)) {
- throw new IllegalPluginDefineException(define);
- }
-
- String[] pluginDefine = define.split("=");
- if (pluginDefine.length != 2) {
- throw new IllegalPluginDefineException(define);
- }
-
- String pluginName = pluginDefine[0];
- String defineClass = pluginDefine[1];
- return new PluginDefine(pluginName, defineClass);
- }
-
- public String getDefineClass() {
- return defineClass;
- }
-
- public String getName() {
- return name;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginException.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginException.java
deleted file mode 100644
index 6b69a009..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin;
-
-public class PluginException extends RuntimeException {
-
- private static final long serialVersionUID = -6020188711867490724L;
-
- public PluginException(String message) {
- super(message);
- }
-
- public PluginException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginFinder.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginFinder.java
deleted file mode 100644
index 588d4f5f..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginFinder.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin;
-
-import cn.hippo4j.agent.core.plugin.bytebuddy.AbstractJunction;
-import cn.hippo4j.agent.core.plugin.match.ClassMatch;
-import cn.hippo4j.agent.core.plugin.match.IndirectMatch;
-import cn.hippo4j.agent.core.plugin.match.NameMatch;
-import cn.hippo4j.agent.core.plugin.match.ProtectiveShieldMatcher;
-import net.bytebuddy.description.NamedElement;
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import static net.bytebuddy.matcher.ElementMatchers.isInterface;
-import static net.bytebuddy.matcher.ElementMatchers.not;
-
-/**
- * The PluginFinder represents a finder , which assist to find the one from the given {@link
- * AbstractClassEnhancePluginDefine} list.
- */
-public class PluginFinder {
-
- private final Map> nameMatchDefine = new HashMap>();
- private final List signatureMatchDefine = new ArrayList();
- private final List bootstrapClassMatchDefine = new ArrayList();
- private static boolean IS_PLUGIN_INIT_COMPLETED = false;
-
- public PluginFinder(List plugins) {
- for (AbstractClassEnhancePluginDefine plugin : plugins) {
- ClassMatch match = plugin.enhanceClass();
-
- if (match == null) {
- continue;
- }
-
- if (match instanceof NameMatch) {
- NameMatch nameMatch = (NameMatch) match;
- LinkedList pluginDefines = nameMatchDefine.get(nameMatch.getClassName());
- if (pluginDefines == null) {
- pluginDefines = new LinkedList();
- nameMatchDefine.put(nameMatch.getClassName(), pluginDefines);
- }
- pluginDefines.add(plugin);
- } else {
- signatureMatchDefine.add(plugin);
- }
-
- if (plugin.isBootstrapInstrumentation()) {
- bootstrapClassMatchDefine.add(plugin);
- }
- }
- }
-
- public List find(TypeDescription typeDescription) {
- List matchedPlugins = new LinkedList();
- String typeName = typeDescription.getTypeName();
- if (nameMatchDefine.containsKey(typeName)) {
- matchedPlugins.addAll(nameMatchDefine.get(typeName));
- }
-
- for (AbstractClassEnhancePluginDefine pluginDefine : signatureMatchDefine) {
- IndirectMatch match = (IndirectMatch) pluginDefine.enhanceClass();
- if (match.isMatch(typeDescription)) {
- matchedPlugins.add(pluginDefine);
- }
- }
-
- return matchedPlugins;
- }
-
- public ElementMatcher super TypeDescription> buildMatch() {
- ElementMatcher.Junction judge = new AbstractJunction() {
-
- @Override
- public boolean matches(NamedElement target) {
- return nameMatchDefine.containsKey(target.getActualName());
- }
- };
- judge = judge.and(not(isInterface()));
- for (AbstractClassEnhancePluginDefine define : signatureMatchDefine) {
- ClassMatch match = define.enhanceClass();
- if (match instanceof IndirectMatch) {
- judge = judge.or(((IndirectMatch) match).buildJunction());
- }
- }
- return new ProtectiveShieldMatcher(judge);
- }
-
- public List getBootstrapClassMatchDefine() {
- return bootstrapClassMatchDefine;
- }
-
- public static void pluginInitCompleted() {
- IS_PLUGIN_INIT_COMPLETED = true;
- }
-
- public static boolean isPluginInitCompleted() {
- return IS_PLUGIN_INIT_COMPLETED;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginResourcesResolver.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginResourcesResolver.java
deleted file mode 100644
index 861995ee..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginResourcesResolver.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.agent.core.plugin.loader.AgentClassLoader;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-
-/**
- * Use the current classloader to read all plugin define file. The file must be named 'hippo4j-plugin.def'
- */
-public class PluginResourcesResolver {
-
- private static final ILog LOGGER = LogManager.getLogger(PluginResourcesResolver.class);
-
- public List getResources() {
- List cfgUrlPaths = new ArrayList();
- Enumeration urls;
- try {
- urls = AgentClassLoader.getDefault().getResources("hippo4j-plugin.def");
-
- while (urls.hasMoreElements()) {
- URL pluginUrl = urls.nextElement();
- cfgUrlPaths.add(pluginUrl);
- LOGGER.info("find hippo4j plugin define in {}", pluginUrl);
- }
-
- return cfgUrlPaths;
- } catch (IOException e) {
- LOGGER.error("read resources failure.", e);
- }
- return null;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginSelector.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginSelector.java
deleted file mode 100644
index 4859909e..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/PluginSelector.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import static cn.hippo4j.common.conf.Config.Plugin.EXCLUDE_PLUGINS;
-
-/**
- * Select some plugins in activated plugins
- */
-public class PluginSelector {
-
- /**
- * Exclude activated plugins
- *
- * @param pluginDefines the pluginDefines is loaded from activations directory or plugins directory
- * @return real activate plugins
- * @see Config.Plugin#EXCLUDE_PLUGINS
- */
- public List select(List pluginDefines) {
- if (!EXCLUDE_PLUGINS.isEmpty()) {
- List excludes = Arrays.asList(EXCLUDE_PLUGINS.toLowerCase().split(","));
- return pluginDefines.stream()
- .filter(item -> !excludes.contains(item.getName().toLowerCase()))
- .collect(Collectors.toList());
- }
- return pluginDefines;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/WitnessFinder.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/WitnessFinder.java
deleted file mode 100644
index a7d30be2..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/WitnessFinder.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin;
-
-import net.bytebuddy.pool.TypePool;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The WitnessFinder represents a pool of {@link TypePool}s, each {@link TypePool} matches a {@link
- * ClassLoader}, which helps to find the class declaration existed or not.
- */
-public enum WitnessFinder {
-
- INSTANCE;
-
- private final Map poolMap = new HashMap();
-
- /**
- * @param classLoader for finding the witnessClass
- * @return true, if the given witnessClass exists, through the given classLoader.
- */
- public boolean exist(String witnessClass, ClassLoader classLoader) {
- return getResolution(witnessClass, classLoader)
- .isResolved();
- }
-
- /**
- * get TypePool.Resolution of the witness class
- * @param witnessClass class name
- * @param classLoader classLoader for finding the witnessClass
- * @return TypePool.Resolution
- */
- private TypePool.Resolution getResolution(String witnessClass, ClassLoader classLoader) {
- ClassLoader mappingKey = classLoader == null ? NullClassLoader.INSTANCE : classLoader;
- if (!poolMap.containsKey(mappingKey)) {
- synchronized (poolMap) {
- if (!poolMap.containsKey(mappingKey)) {
- TypePool classTypePool = classLoader == null ? TypePool.Default.ofBootLoader() : TypePool.Default.of(classLoader);
- poolMap.put(mappingKey, classTypePool);
- }
- }
- }
- TypePool typePool = poolMap.get(mappingKey);
- return typePool.describe(witnessClass);
- }
-
- /**
- * @param classLoader for finding the witness method
- * @return true, if the given witness method exists, through the given classLoader.
- */
- public boolean exist(WitnessMethod witnessMethod, ClassLoader classLoader) {
- TypePool.Resolution resolution = getResolution(witnessMethod.getDeclaringClassName(), classLoader);
- if (!resolution.isResolved()) {
- return false;
- }
- return !resolution.resolve()
- .getDeclaredMethods()
- .filter(witnessMethod.getElementMatcher())
- .isEmpty();
- }
-
-}
-
-final class NullClassLoader extends ClassLoader {
-
- static NullClassLoader INSTANCE = new NullClassLoader();
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/WitnessMethod.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/WitnessMethod.java
deleted file mode 100644
index 46c62d2b..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/WitnessMethod.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin;
-
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-import lombok.ToString;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-/**
- * Witness Method for plugin activation
- */
-@ToString
-@RequiredArgsConstructor
-public class WitnessMethod {
-
- /**
- * the class or interface name where the witness method is declared.
- */
- @Getter
- private final String declaringClassName;
- /**
- * matcher to match the witness method
- */
- @Getter
- private final ElementMatcher super MethodDescription.InDefinedShape> elementMatcher;
-
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/BootstrapInstrumentBoost.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/BootstrapInstrumentBoost.java
deleted file mode 100644
index 7138ea85..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/BootstrapInstrumentBoost.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bootstrap;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.agent.core.plugin.AbstractClassEnhancePluginDefine;
-import cn.hippo4j.agent.core.plugin.ByteBuddyCoreClasses;
-import cn.hippo4j.agent.core.plugin.InstrumentDebuggingClass;
-import cn.hippo4j.agent.core.plugin.PluginException;
-import cn.hippo4j.agent.core.plugin.PluginFinder;
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.StaticMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.v2.InstanceMethodsInterceptV2Point;
-import cn.hippo4j.agent.core.plugin.interceptor.v2.StaticMethodsInterceptV2Point;
-import cn.hippo4j.agent.core.plugin.jdk9module.JDK9ModuleExporter;
-import cn.hippo4j.agent.core.plugin.loader.AgentClassLoader;
-import net.bytebuddy.ByteBuddy;
-import net.bytebuddy.agent.builder.AgentBuilder;
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.dynamic.ClassFileLocator;
-import net.bytebuddy.dynamic.DynamicType;
-import net.bytebuddy.dynamic.loading.ClassInjector;
-import net.bytebuddy.pool.TypePool;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.instrument.Instrumentation;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-
-import static net.bytebuddy.matcher.ElementMatchers.named;
-
-/**
- * If there is Bootstrap instrumentation plugin declared in plugin list, BootstrapInstrumentBoost inject the necessary
- * classes into bootstrap class loader, including generated dynamic delegate classes.
- */
-public class BootstrapInstrumentBoost {
-
- private static final ILog LOGGER = LogManager.getLogger(BootstrapInstrumentBoost.class);
-
- private static final String[] HIGH_PRIORITY_CLASSES = {
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.BootstrapInterRuntimeAssist",
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor",
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor",
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.StaticMethodsAroundInterceptor",
- "cn.hippo4j.agent.core.plugin.bootstrap.IBootstrapLog",
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance",
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.OverrideCallable",
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.MethodInterceptResult",
-
- // interceptor v2
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.v2.InstanceMethodsAroundInterceptorV2",
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.v2.StaticMethodsAroundInterceptorV2",
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.v2.MethodInvocationContext",
- };
-
- private static String INSTANCE_METHOD_DELEGATE_TEMPLATE = "cn.hippo4j.agent.core.plugin.bootstrap.template.InstanceMethodInterTemplate";
- private static String INSTANCE_METHOD_WITH_OVERRIDE_ARGS_DELEGATE_TEMPLATE = "cn.hippo4j.agent.core.plugin.bootstrap.template.InstanceMethodInterWithOverrideArgsTemplate";
- private static String CONSTRUCTOR_DELEGATE_TEMPLATE = "cn.hippo4j.agent.core.plugin.bootstrap.template.ConstructorInterTemplate";
- private static String STATIC_METHOD_DELEGATE_TEMPLATE = "cn.hippo4j.agent.core.plugin.bootstrap.template.StaticMethodInterTemplate";
- private static String STATIC_METHOD_WITH_OVERRIDE_ARGS_DELEGATE_TEMPLATE = "cn.hippo4j.agent.core.plugin.bootstrap.template.StaticMethodInterWithOverrideArgsTemplate";
-
- private static String INSTANCE_METHOD_V2_DELEGATE_TEMPLATE = "cn.hippo4j.agent.core.plugin.bootstrap.template.v2.InstanceMethodInterV2Template";
- private static String INSTANCE_METHOD_V2_WITH_OVERRIDE_ARGS_DELEGATE_TEMPLATE = "cn.hippo4j.agent.core.plugin.bootstrap.template.v2.InstanceMethodInterV2WithOverrideArgsTemplate";
- private static String STATIC_METHOD_V2_DELEGATE_TEMPLATE = "cn.hippo4j.agent.core.plugin.bootstrap.template.v2.StaticMethodInterV2Template";
- private static String STATIC_METHOD_V2_WITH_OVERRIDE_ARGS_DELEGATE_TEMPLATE = "cn.hippo4j.agent.core.plugin.bootstrap.template.v2.StaticMethodInterV2WithOverrideArgsTemplate";
-
- public static AgentBuilder inject(PluginFinder pluginFinder, Instrumentation instrumentation,
- AgentBuilder agentBuilder, JDK9ModuleExporter.EdgeClasses edgeClasses) throws PluginException {
- Map classesTypeMap = new LinkedHashMap<>();
-
- if (!prepareJREInstrumentation(pluginFinder, classesTypeMap)) {
- return agentBuilder;
- }
-
- if (!prepareJREInstrumentationV2(pluginFinder, classesTypeMap)) {
- return agentBuilder;
- }
-
- for (String highPriorityClass : HIGH_PRIORITY_CLASSES) {
- loadHighPriorityClass(classesTypeMap, highPriorityClass);
- }
- for (String highPriorityClass : ByteBuddyCoreClasses.CLASSES) {
- loadHighPriorityClass(classesTypeMap, highPriorityClass);
- }
-
- /**
- * Prepare to open edge of necessary classes.
- */
- for (String generatedClass : classesTypeMap.keySet()) {
- edgeClasses.add(generatedClass);
- }
-
- /**
- * Inject the classes into bootstrap class loader by using Unsafe Strategy.
- * ByteBuddy adapts the sun.misc.Unsafe and jdk.internal.misc.Unsafe automatically.
- */
- ClassInjector.UsingUnsafe.Factory factory = ClassInjector.UsingUnsafe.Factory.resolve(instrumentation);
- factory.make(null, null).injectRaw(classesTypeMap);
- agentBuilder = agentBuilder.with(new AgentBuilder.InjectionStrategy.UsingUnsafe.OfFactory(factory));
-
- return agentBuilder;
- }
-
- /**
- * Get the delegate class name.
- *
- * @param methodsInterceptor of original interceptor in the plugin
- * @return generated delegate class name
- */
- public static String internalDelegate(String methodsInterceptor) {
- return methodsInterceptor + "_internal";
- }
-
- /**
- * Load the delegate class from current class loader, mostly should be AppClassLoader.
- *
- * @param methodsInterceptor of original interceptor in the plugin
- * @return generated delegate class
- */
- public static Class forInternalDelegateClass(String methodsInterceptor) {
- try {
- return Class.forName(internalDelegate(methodsInterceptor));
- } catch (ClassNotFoundException e) {
- throw new PluginException(e.getMessage(), e);
- }
- }
-
- /**
- * Generate dynamic delegate for ByteBuddy
- *
- * @param pluginFinder gets the whole plugin list.
- * @param classesTypeMap hosts the class binary.
- * @return true if have JRE instrumentation requirement.
- * @throws PluginException when generate failure.
- */
- private static boolean prepareJREInstrumentation(PluginFinder pluginFinder,
- Map classesTypeMap) throws PluginException {
- TypePool typePool = TypePool.Default.of(BootstrapInstrumentBoost.class.getClassLoader());
- List bootstrapClassMatchDefines = pluginFinder.getBootstrapClassMatchDefine();
- for (AbstractClassEnhancePluginDefine define : bootstrapClassMatchDefines) {
- if (Objects.nonNull(define.getInstanceMethodsInterceptPoints())) {
- for (InstanceMethodsInterceptPoint point : define.getInstanceMethodsInterceptPoints()) {
- if (point.isOverrideArgs()) {
- generateDelegator(
- classesTypeMap, typePool, INSTANCE_METHOD_WITH_OVERRIDE_ARGS_DELEGATE_TEMPLATE, point
- .getMethodsInterceptor());
- } else {
- generateDelegator(
- classesTypeMap, typePool, INSTANCE_METHOD_DELEGATE_TEMPLATE, point.getMethodsInterceptor());
- }
- }
- }
-
- if (Objects.nonNull(define.getConstructorsInterceptPoints())) {
- for (ConstructorInterceptPoint point : define.getConstructorsInterceptPoints()) {
- generateDelegator(
- classesTypeMap, typePool, CONSTRUCTOR_DELEGATE_TEMPLATE, point.getConstructorInterceptor());
- }
- }
-
- if (Objects.nonNull(define.getStaticMethodsInterceptPoints())) {
- for (StaticMethodsInterceptPoint point : define.getStaticMethodsInterceptPoints()) {
- if (point.isOverrideArgs()) {
- generateDelegator(
- classesTypeMap, typePool, STATIC_METHOD_WITH_OVERRIDE_ARGS_DELEGATE_TEMPLATE, point
- .getMethodsInterceptor());
- } else {
- generateDelegator(
- classesTypeMap, typePool, STATIC_METHOD_DELEGATE_TEMPLATE, point.getMethodsInterceptor());
- }
- }
- }
- }
- return bootstrapClassMatchDefines.size() > 0;
- }
-
- private static boolean prepareJREInstrumentationV2(PluginFinder pluginFinder,
- Map classesTypeMap) throws PluginException {
- TypePool typePool = TypePool.Default.of(BootstrapInstrumentBoost.class.getClassLoader());
- List bootstrapClassMatchDefines = pluginFinder.getBootstrapClassMatchDefine();
- for (AbstractClassEnhancePluginDefine define : bootstrapClassMatchDefines) {
- if (Objects.nonNull(define.getInstanceMethodsInterceptV2Points())) {
- for (InstanceMethodsInterceptV2Point point : define.getInstanceMethodsInterceptV2Points()) {
- if (point.isOverrideArgs()) {
- generateDelegator(classesTypeMap, typePool,
- INSTANCE_METHOD_V2_WITH_OVERRIDE_ARGS_DELEGATE_TEMPLATE,
- point.getMethodsInterceptorV2());
- } else {
- generateDelegator(
- classesTypeMap, typePool, INSTANCE_METHOD_V2_DELEGATE_TEMPLATE,
- point.getMethodsInterceptorV2());
- }
- }
- }
-
- if (Objects.nonNull(define.getStaticMethodsInterceptV2Points())) {
- for (StaticMethodsInterceptV2Point point : define.getStaticMethodsInterceptV2Points()) {
- if (point.isOverrideArgs()) {
- generateDelegator(classesTypeMap, typePool,
- STATIC_METHOD_V2_WITH_OVERRIDE_ARGS_DELEGATE_TEMPLATE,
- point.getMethodsInterceptorV2());
- } else {
- generateDelegator(
- classesTypeMap, typePool, STATIC_METHOD_V2_DELEGATE_TEMPLATE,
- point.getMethodsInterceptorV2());
- }
- }
- }
- }
- return bootstrapClassMatchDefines.size() > 0;
- }
-
- /**
- * Generate the delegator class based on given template class. This is preparation stage level code generation.
- *
- * One key step to avoid class confliction between AppClassLoader and BootstrapClassLoader
- *
- * @param classesTypeMap hosts injected binary of generated class
- * @param typePool to generate new class
- * @param templateClassName represents the class as template in this generation process. The templates are
- * pre-defined in Hippo4j agent core.
- */
- private static void generateDelegator(Map classesTypeMap, TypePool typePool,
- String templateClassName, String methodsInterceptor) {
- String internalInterceptorName = internalDelegate(methodsInterceptor);
- try {
- TypeDescription templateTypeDescription = typePool.describe(templateClassName).resolve();
-
- DynamicType.Unloaded interceptorType = new ByteBuddy().redefine(templateTypeDescription, ClassFileLocator.ForClassLoader
- .of(BootstrapInstrumentBoost.class.getClassLoader()))
- .name(internalInterceptorName)
- .field(named("TARGET_INTERCEPTOR"))
- .value(methodsInterceptor)
- .make();
-
- classesTypeMap.put(internalInterceptorName, interceptorType.getBytes());
-
- InstrumentDebuggingClass.INSTANCE.log(interceptorType);
- } catch (Exception e) {
- throw new PluginException("Generate Dynamic plugin failure", e);
- }
- }
-
- /**
- * The class loaded by this method means it only should be loaded once in Bootstrap classloader, when bootstrap
- * instrumentation active by any plugin
- *
- * @param loadedTypeMap hosts all injected class
- * @param className to load
- */
- private static void loadHighPriorityClass(Map loadedTypeMap,
- String className) throws PluginException {
- byte[] enhancedInstanceClassFile;
- try {
- String classResourceName = className.replaceAll("\\.", "/") + ".class";
- InputStream resourceAsStream = AgentClassLoader.getDefault().getResourceAsStream(classResourceName);
-
- if (resourceAsStream == null) {
- throw new PluginException("High priority class " + className + " not found.");
- }
-
- ByteArrayOutputStream os = new ByteArrayOutputStream();
-
- byte[] buffer = new byte[1024];
- int len;
-
- // read bytes from the input stream and store them in buffer
- while ((len = resourceAsStream.read(buffer)) != -1) {
- // write bytes from the buffer into output stream
- os.write(buffer, 0, len);
- }
-
- enhancedInstanceClassFile = os.toByteArray();
- } catch (IOException e) {
- throw new PluginException(e.getMessage(), e);
- }
-
- loadedTypeMap.put(className, enhancedInstanceClassFile);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/BootstrapPluginLogBridge.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/BootstrapPluginLogBridge.java
deleted file mode 100644
index bdcbcfdc..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/BootstrapPluginLogBridge.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bootstrap;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-
-/**
- * The log bridge makes the ILog accessible inside bootstrap classloader, especially for internal interceptor.
- */
-public class BootstrapPluginLogBridge implements IBootstrapLog {
-
- public static IBootstrapLog getLogger(String clazz) {
- return new BootstrapPluginLogBridge(clazz);
- }
-
- private final ILog logger;
-
- private BootstrapPluginLogBridge(String clazz) {
- logger = LogManager.getLogger(clazz);
- }
-
- @Override
- public void info(String format) {
- logger.info(format);
- }
-
- @Override
- public void info(String format, Object... arguments) {
- logger.info(format, arguments);
- }
-
- @Override
- public void warn(String format, Object... arguments) {
- logger.warn(format, arguments);
- }
-
- @Override
- public void warn(Throwable e, String format, Object... arguments) {
- logger.warn(e, format, arguments);
- }
-
- @Override
- public void error(String format, Throwable e) {
- logger.error(format, e);
- }
-
- @Override
- public void error(Throwable e, String format, Object... arguments) {
- logger.error(e, format, arguments);
- }
-
- @Override
- public boolean isDebugEnable() {
- return logger.isDebugEnable();
- }
-
- @Override
- public boolean isInfoEnable() {
- return logger.isInfoEnable();
- }
-
- @Override
- public boolean isWarnEnable() {
- return logger.isWarnEnable();
- }
-
- @Override
- public boolean isErrorEnable() {
- return logger.isErrorEnable();
- }
-
- @Override
- public void debug(String format) {
- logger.debug(format);
- }
-
- @Override
- public void debug(String format, Object... arguments) {
- logger.debug(format, arguments);
- }
-
- @Override
- public void error(String format) {
- logger.error(format);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/IBootstrapLog.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/IBootstrapLog.java
deleted file mode 100644
index 52645b44..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/IBootstrapLog.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bootstrap;
-
-/**
- * The log interface used in bootstrap internal interceptors.
- *
- * Never used in any plugin or tracing core.
- */
-public interface IBootstrapLog {
-
- void info(String format);
-
- void info(String format, Object... arguments);
-
- void warn(String format, Object... arguments);
-
- void warn(Throwable e, String format, Object... arguments);
-
- void error(String format, Throwable e);
-
- void error(Throwable e, String format, Object... arguments);
-
- boolean isDebugEnable();
-
- boolean isInfoEnable();
-
- boolean isWarnEnable();
-
- boolean isErrorEnable();
-
- void debug(String format);
-
- void debug(String format, Object... arguments);
-
- void error(String format);
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/ConstructorInterTemplate.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/ConstructorInterTemplate.java
deleted file mode 100644
index 3bca42a0..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/ConstructorInterTemplate.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bootstrap.template;
-
-import cn.hippo4j.agent.core.plugin.bootstrap.IBootstrapLog;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.BootstrapInterRuntimeAssist;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.This;
-
-public class ConstructorInterTemplate {
-
- /**
- * This field is never set in the template, but has value in the runtime.
- */
- private static String TARGET_INTERCEPTOR;
-
- private static InstanceConstructorInterceptor INTERCEPTOR;
- private static IBootstrapLog LOGGER;
-
- /**
- * Intercept the target constructor.
- *
- * @param obj target class instance.
- * @param allArguments all constructor arguments
- */
- @RuntimeType
- public static void intercept(@This Object obj, @AllArguments Object[] allArguments) {
- try {
- prepare();
-
- EnhancedInstance targetObject = (EnhancedInstance) obj;
-
- if (INTERCEPTOR == null) {
- return;
- }
- INTERCEPTOR.onConstruct(targetObject, allArguments);
- } catch (Throwable t) {
- LOGGER.error("ConstructorInter failure.", t);
- }
- }
-
- /**
- * Prepare the context. Link to the agent core in AppClassLoader.
- */
- private static void prepare() {
- if (INTERCEPTOR == null) {
- ClassLoader loader = BootstrapInterRuntimeAssist.getAgentClassLoader();
-
- if (loader != null) {
- IBootstrapLog logger = BootstrapInterRuntimeAssist.getLogger(loader, TARGET_INTERCEPTOR);
- if (logger != null) {
- LOGGER = logger;
-
- INTERCEPTOR = BootstrapInterRuntimeAssist.createInterceptor(loader, TARGET_INTERCEPTOR, LOGGER);
- }
- } else {
- LOGGER.error("Runtime ClassLoader not found when create {}." + TARGET_INTERCEPTOR);
- }
- }
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/InstanceMethodInterTemplate.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/InstanceMethodInterTemplate.java
deleted file mode 100644
index aa9cb6f3..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/InstanceMethodInterTemplate.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bootstrap.template;
-
-import cn.hippo4j.agent.core.plugin.bootstrap.IBootstrapLog;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.BootstrapInterRuntimeAssist;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.SuperCall;
-import net.bytebuddy.implementation.bind.annotation.This;
-
-import java.lang.reflect.Method;
-import java.util.concurrent.Callable;
-
-public class InstanceMethodInterTemplate {
-
- /**
- * This field is never set in the template, but has value in the runtime.
- */
- private static String TARGET_INTERCEPTOR;
-
- private static InstanceMethodsAroundInterceptor INTERCEPTOR;
- private static IBootstrapLog LOGGER;
-
- /**
- * Intercept the target instance method.
- *
- * @param obj target class instance.
- * @param allArguments all method arguments
- * @param method method description.
- * @param zuper the origin call ref.
- * @return the return value of target instance method.
- * @throws Exception only throw exception because of zuper.call() or unexpected exception in sky-walking ( This is a
- * bug, if anything triggers this condition ).
- */
- @RuntimeType
- public static Object intercept(@This Object obj, @AllArguments Object[] allArguments, @SuperCall Callable> zuper,
- @Origin Method method) throws Throwable {
- EnhancedInstance targetObject = (EnhancedInstance) obj;
-
- prepare();
-
- MethodInterceptResult result = new MethodInterceptResult();
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.beforeMethod(targetObject, method, allArguments, method.getParameterTypes(), result);
- }
- } catch (Throwable t) {
- if (LOGGER != null) {
- LOGGER.error(t, "class[{}] before method[{}] intercept failure", obj.getClass(), method.getName());
- }
- }
-
- Object ret = null;
- try {
- if (!result.isContinue()) {
- ret = result._ret();
- } else {
- ret = zuper.call();
- }
- } catch (Throwable t) {
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.handleMethodException(targetObject, method, allArguments, method.getParameterTypes(), t);
- }
- } catch (Throwable t2) {
- if (LOGGER != null) {
- LOGGER.error(t2, "class[{}] handle method[{}] exception failure", obj.getClass(), method.getName());
- }
- }
- throw t;
- } finally {
- try {
- if (INTERCEPTOR != null) {
- ret = INTERCEPTOR.afterMethod(targetObject, method, allArguments, method.getParameterTypes(), ret);
- }
- } catch (Throwable t) {
- if (LOGGER != null) {
- LOGGER.error(t, "class[{}] after method[{}] intercept failure", obj.getClass(), method.getName());
- }
- }
- }
-
- return ret;
- }
-
- /**
- * Prepare the context. Link to the agent core in AppClassLoader.
- */
- private static void prepare() {
- if (INTERCEPTOR == null) {
- ClassLoader loader = BootstrapInterRuntimeAssist.getAgentClassLoader();
-
- if (loader != null) {
- IBootstrapLog logger = BootstrapInterRuntimeAssist.getLogger(loader, TARGET_INTERCEPTOR);
- if (logger != null) {
- LOGGER = logger;
-
- INTERCEPTOR = BootstrapInterRuntimeAssist.createInterceptor(loader, TARGET_INTERCEPTOR, LOGGER);
- }
- } else {
- LOGGER.error("Runtime ClassLoader not found when create {}." + TARGET_INTERCEPTOR);
- }
- }
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/InstanceMethodInterWithOverrideArgsTemplate.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/InstanceMethodInterWithOverrideArgsTemplate.java
deleted file mode 100644
index 78ef6751..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/InstanceMethodInterWithOverrideArgsTemplate.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bootstrap.template;
-
-import cn.hippo4j.agent.core.plugin.bootstrap.IBootstrapLog;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.BootstrapInterRuntimeAssist;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.OverrideCallable;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Morph;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.This;
-
-import java.lang.reflect.Method;
-
-public class InstanceMethodInterWithOverrideArgsTemplate {
-
- /**
- * This field is never set in the template, but has value in the runtime.
- */
- private static String TARGET_INTERCEPTOR;
-
- private static InstanceMethodsAroundInterceptor INTERCEPTOR;
- private static IBootstrapLog LOGGER;
-
- /**
- * Intercept the target instance method.
- *
- * @param obj target class instance.
- * @param allArguments all method arguments
- * @param method method description.
- * @param zuper the origin call ref.
- * @return the return value of target instance method.
- * @throws Exception only throw exception because of zuper.call() or unexpected exception in sky-walking ( This is a
- * bug, if anything triggers this condition ).
- */
- @RuntimeType
- public static Object intercept(@This Object obj, @AllArguments Object[] allArguments, @Morph OverrideCallable zuper,
- @Origin Method method) throws Throwable {
- EnhancedInstance targetObject = (EnhancedInstance) obj;
-
- prepare();
-
- MethodInterceptResult result = new MethodInterceptResult();
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.beforeMethod(targetObject, method, allArguments, method.getParameterTypes(), result);
- }
- } catch (Throwable t) {
- if (LOGGER != null) {
- LOGGER.error(t, "class[{}] before method[{}] intercept failure", obj.getClass(), method.getName());
- }
- }
-
- Object ret = null;
- try {
- if (!result.isContinue()) {
- ret = result._ret();
- } else {
- ret = zuper.call(allArguments);
- }
- } catch (Throwable t) {
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.handleMethodException(targetObject, method, allArguments, method.getParameterTypes(), t);
- }
- } catch (Throwable t2) {
- if (LOGGER != null) {
- LOGGER.error(t2, "class[{}] handle method[{}] exception failure", obj.getClass(), method.getName());
- }
- }
- throw t;
- } finally {
- try {
- if (INTERCEPTOR != null) {
- ret = INTERCEPTOR.afterMethod(targetObject, method, allArguments, method.getParameterTypes(), ret);
- }
- } catch (Throwable t) {
- if (LOGGER != null) {
- LOGGER.error(t, "class[{}] after method[{}] intercept failure", obj.getClass(), method.getName());
- }
- }
- }
-
- return ret;
- }
-
- /**
- * Prepare the context. Link to the agent core in AppClassLoader.
- */
- private static void prepare() {
- if (INTERCEPTOR == null) {
- ClassLoader loader = BootstrapInterRuntimeAssist.getAgentClassLoader();
-
- if (loader != null) {
- IBootstrapLog logger = BootstrapInterRuntimeAssist.getLogger(loader, TARGET_INTERCEPTOR);
- if (logger != null) {
- LOGGER = logger;
-
- INTERCEPTOR = BootstrapInterRuntimeAssist.createInterceptor(loader, TARGET_INTERCEPTOR, LOGGER);
- }
- } else {
- LOGGER.error("Runtime ClassLoader not found when create {}." + TARGET_INTERCEPTOR);
- }
- }
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/StaticMethodInterTemplate.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/StaticMethodInterTemplate.java
deleted file mode 100644
index df1abaf2..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/StaticMethodInterTemplate.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bootstrap.template;
-
-import cn.hippo4j.agent.core.plugin.bootstrap.IBootstrapLog;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.BootstrapInterRuntimeAssist;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.StaticMethodsAroundInterceptor;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.SuperCall;
-
-import java.lang.reflect.Method;
-import java.util.concurrent.Callable;
-
-public class StaticMethodInterTemplate {
-
- /**
- * This field is never set in the template, but has value in the runtime.
- */
- private static String TARGET_INTERCEPTOR;
-
- private static StaticMethodsAroundInterceptor INTERCEPTOR;
- private static IBootstrapLog LOGGER;
-
- /**
- * Intercept the target static method.
- *
- * @param clazz target class
- * @param allArguments all method arguments
- * @param method method description.
- * @param zuper the origin call ref.
- * @return the return value of target static method.
- * @throws Exception only throw exception because of zuper.call() or unexpected exception in sky-walking ( This is a
- * bug, if anything triggers this condition ).
- */
- @RuntimeType
- public static Object intercept(@Origin Class> clazz, @AllArguments Object[] allArguments, @Origin Method method,
- @SuperCall Callable> zuper) throws Throwable {
- prepare();
-
- MethodInterceptResult result = new MethodInterceptResult();
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.beforeMethod(clazz, method, allArguments, method.getParameterTypes(), result);
- }
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] before static method[{}] intercept failure", clazz, method.getName());
- }
-
- Object ret = null;
- try {
- if (!result.isContinue()) {
- ret = result._ret();
- } else {
- ret = zuper.call();
- }
- } catch (Throwable t) {
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.handleMethodException(clazz, method, allArguments, method.getParameterTypes(), t);
- }
- } catch (Throwable t2) {
- LOGGER.error(t2, "class[{}] handle static method[{}] exception failure", clazz, method.getName(), t2.getMessage());
- }
- throw t;
- } finally {
- try {
- if (INTERCEPTOR != null) {
- ret = INTERCEPTOR.afterMethod(clazz, method, allArguments, method.getParameterTypes(), ret);
- }
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] after static method[{}] intercept failure:{}", clazz, method.getName(), t.getMessage());
- }
- }
- return ret;
- }
-
- /**
- * Prepare the context. Link to the agent core in AppClassLoader.
- */
- private static void prepare() {
- if (INTERCEPTOR == null) {
- ClassLoader loader = BootstrapInterRuntimeAssist.getAgentClassLoader();
-
- if (loader != null) {
- IBootstrapLog logger = BootstrapInterRuntimeAssist.getLogger(loader, TARGET_INTERCEPTOR);
- if (logger != null) {
- LOGGER = logger;
-
- INTERCEPTOR = BootstrapInterRuntimeAssist.createInterceptor(loader, TARGET_INTERCEPTOR, LOGGER);
- }
- } else {
- LOGGER.error("Runtime ClassLoader not found when create {}." + TARGET_INTERCEPTOR);
- }
- }
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/StaticMethodInterWithOverrideArgsTemplate.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/StaticMethodInterWithOverrideArgsTemplate.java
deleted file mode 100644
index a3b0b92f..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/StaticMethodInterWithOverrideArgsTemplate.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bootstrap.template;
-
-import cn.hippo4j.agent.core.plugin.bootstrap.IBootstrapLog;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.BootstrapInterRuntimeAssist;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.OverrideCallable;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.StaticMethodsAroundInterceptor;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Morph;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-
-import java.lang.reflect.Method;
-
-public class StaticMethodInterWithOverrideArgsTemplate {
-
- /**
- * This field is never set in the template, but has value in the runtime.
- */
- private static String TARGET_INTERCEPTOR;
-
- private static StaticMethodsAroundInterceptor INTERCEPTOR;
- private static IBootstrapLog LOGGER;
-
- /**
- * Intercept the target static method.
- *
- * @param clazz target class
- * @param allArguments all method arguments
- * @param method method description.
- * @param zuper the origin call ref.
- * @return the return value of target static method.
- * @throws Exception only throw exception because of zuper.call() or unexpected exception in sky-walking ( This is a
- * bug, if anything triggers this condition ).
- */
- @RuntimeType
- public static Object intercept(@Origin Class> clazz, @AllArguments Object[] allArguments, @Origin Method method,
- @Morph OverrideCallable zuper) throws Throwable {
- prepare();
-
- MethodInterceptResult result = new MethodInterceptResult();
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.beforeMethod(clazz, method, allArguments, method.getParameterTypes(), result);
- }
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] before static method[{}] intercept failure", clazz, method.getName());
- }
-
- Object ret = null;
- try {
- if (!result.isContinue()) {
- ret = result._ret();
- } else {
- ret = zuper.call(allArguments);
- }
- } catch (Throwable t) {
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.handleMethodException(clazz, method, allArguments, method.getParameterTypes(), t);
- }
- } catch (Throwable t2) {
- LOGGER.error(t2, "class[{}] handle static method[{}] exception failure", clazz, method.getName(), t2.getMessage());
- }
- throw t;
- } finally {
- try {
- if (INTERCEPTOR != null) {
- ret = INTERCEPTOR.afterMethod(clazz, method, allArguments, method.getParameterTypes(), ret);
- }
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] after static method[{}] intercept failure:{}", clazz, method.getName(), t.getMessage());
- }
- }
- return ret;
- }
-
- /**
- * Prepare the context. Link to the agent core in AppClassLoader.
- */
- private static void prepare() {
- if (INTERCEPTOR == null) {
- ClassLoader loader = BootstrapInterRuntimeAssist.getAgentClassLoader();
-
- if (loader != null) {
- IBootstrapLog logger = BootstrapInterRuntimeAssist.getLogger(loader, TARGET_INTERCEPTOR);
- if (logger != null) {
- LOGGER = logger;
-
- INTERCEPTOR = BootstrapInterRuntimeAssist.createInterceptor(loader, TARGET_INTERCEPTOR, LOGGER);
- }
- } else {
- LOGGER.error("Runtime ClassLoader not found when create {}." + TARGET_INTERCEPTOR);
- }
- }
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/v2/InstanceMethodInterV2Template.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/v2/InstanceMethodInterV2Template.java
deleted file mode 100644
index 0bc6205e..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/v2/InstanceMethodInterV2Template.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bootstrap.template.v2;
-
-import cn.hippo4j.agent.core.plugin.bootstrap.IBootstrapLog;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.BootstrapInterRuntimeAssist;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.v2.InstanceMethodsAroundInterceptorV2;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.v2.MethodInvocationContext;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.SuperCall;
-import net.bytebuddy.implementation.bind.annotation.This;
-
-import java.lang.reflect.Method;
-import java.util.concurrent.Callable;
-
-/**
- * This class wouldn't be loaded in real env. This is a class template for dynamic class generation.
- */
-public class InstanceMethodInterV2Template {
-
- /**
- * This field is never set in the template, but has value in the runtime.
- */
- private static String TARGET_INTERCEPTOR;
-
- private static InstanceMethodsAroundInterceptorV2 INTERCEPTOR;
- private static IBootstrapLog LOGGER;
-
- /**
- * Intercept the target instance method.
- *
- * @param obj target class instance.
- * @param allArguments all method arguments
- * @param method method description.
- * @param zuper the origin call ref.
- * @return the return value of target instance method.
- * @throws Exception only throw exception because of zuper.call() or unexpected exception in sky-walking ( This is a
- * bug, if anything triggers this condition ).
- */
- @RuntimeType
- public static Object intercept(@This Object obj, @AllArguments Object[] allArguments, @SuperCall Callable> zuper,
- @Origin Method method) throws Throwable {
- EnhancedInstance targetObject = (EnhancedInstance) obj;
-
- prepare();
-
- MethodInvocationContext context = new MethodInvocationContext();
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.beforeMethod(targetObject, method, allArguments, method.getParameterTypes(), context);
- }
- } catch (Throwable t) {
- if (LOGGER != null) {
- LOGGER.error(t, "class[{}] before method[{}] intercept failure", obj.getClass(), method.getName());
- }
- }
-
- Object ret = null;
- try {
- if (!context.isContinue()) {
- ret = context._ret();
- } else {
- ret = zuper.call();
- }
- } catch (Throwable t) {
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.handleMethodException(targetObject, method, allArguments, method.getParameterTypes(), t, context);
- }
- } catch (Throwable t2) {
- if (LOGGER != null) {
- LOGGER.error(t2, "class[{}] handle method[{}] exception failure", obj.getClass(), method.getName());
- }
- }
- throw t;
- } finally {
- try {
- if (INTERCEPTOR != null) {
- ret = INTERCEPTOR.afterMethod(targetObject, method, allArguments, method.getParameterTypes(), ret, context);
- }
- } catch (Throwable t) {
- if (LOGGER != null) {
- LOGGER.error(t, "class[{}] after method[{}] intercept failure", obj.getClass(), method.getName());
- }
- }
- }
-
- return ret;
- }
-
- /**
- * Prepare the context. Link to the agent core in AppClassLoader.
- */
- private static void prepare() {
- if (INTERCEPTOR == null) {
- ClassLoader loader = BootstrapInterRuntimeAssist.getAgentClassLoader();
-
- if (loader != null) {
- IBootstrapLog logger = BootstrapInterRuntimeAssist.getLogger(loader, TARGET_INTERCEPTOR);
- if (logger != null) {
- LOGGER = logger;
-
- INTERCEPTOR = BootstrapInterRuntimeAssist.createInterceptor(loader, TARGET_INTERCEPTOR, LOGGER);
- }
- } else {
- LOGGER.error("Runtime ClassLoader not found when create {}." + TARGET_INTERCEPTOR);
- }
- }
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/v2/InstanceMethodInterV2WithOverrideArgsTemplate.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/v2/InstanceMethodInterV2WithOverrideArgsTemplate.java
deleted file mode 100644
index 6e15b671..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/v2/InstanceMethodInterV2WithOverrideArgsTemplate.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bootstrap.template.v2;
-
-import cn.hippo4j.agent.core.plugin.bootstrap.IBootstrapLog;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.BootstrapInterRuntimeAssist;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.OverrideCallable;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.v2.InstanceMethodsAroundInterceptorV2;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.v2.MethodInvocationContext;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Morph;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.This;
-
-import java.lang.reflect.Method;
-
-/**
- * This class wouldn't be loaded in real env. This is a class template for dynamic class generation.
- */
-public class InstanceMethodInterV2WithOverrideArgsTemplate {
-
- /**
- * This field is never set in the template, but has value in the runtime.
- */
- private static String TARGET_INTERCEPTOR;
-
- private static InstanceMethodsAroundInterceptorV2 INTERCEPTOR;
- private static IBootstrapLog LOGGER;
-
- /**
- * Intercept the target instance method.
- *
- * @param obj target class instance.
- * @param allArguments all method arguments
- * @param method method description.
- * @param zuper the origin call ref.
- * @return the return value of target instance method.
- * @throws Exception only throw exception because of zuper.call() or unexpected exception in sky-walking ( This is a
- * bug, if anything triggers this condition ).
- */
- @RuntimeType
- public static Object intercept(@This Object obj, @AllArguments Object[] allArguments, @Morph OverrideCallable zuper,
- @Origin Method method) throws Throwable {
- EnhancedInstance targetObject = (EnhancedInstance) obj;
-
- prepare();
-
- MethodInvocationContext context = new MethodInvocationContext();
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.beforeMethod(targetObject, method, allArguments, method.getParameterTypes(), context);
- }
- } catch (Throwable t) {
- if (LOGGER != null) {
- LOGGER.error(t, "class[{}] before method[{}] intercept failure", obj.getClass(), method.getName());
- }
- }
-
- Object ret = null;
- try {
- if (!context.isContinue()) {
- ret = context._ret();
- } else {
- ret = zuper.call(allArguments);
- }
- } catch (Throwable t) {
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.handleMethodException(targetObject, method, allArguments, method.getParameterTypes(), t, context);
- }
- } catch (Throwable t2) {
- if (LOGGER != null) {
- LOGGER.error(t2, "class[{}] handle method[{}] exception failure", obj.getClass(), method.getName());
- }
- }
- throw t;
- } finally {
- try {
- if (INTERCEPTOR != null) {
- ret = INTERCEPTOR.afterMethod(targetObject, method, allArguments, method.getParameterTypes(), ret, context);
- }
- } catch (Throwable t) {
- if (LOGGER != null) {
- LOGGER.error(t, "class[{}] after method[{}] intercept failure", obj.getClass(), method.getName());
- }
- }
- }
-
- return ret;
- }
-
- /**
- * Prepare the context. Link to the agent core in AppClassLoader.
- */
- private static void prepare() {
- if (INTERCEPTOR == null) {
- ClassLoader loader = BootstrapInterRuntimeAssist.getAgentClassLoader();
-
- if (loader != null) {
- IBootstrapLog logger = BootstrapInterRuntimeAssist.getLogger(loader, TARGET_INTERCEPTOR);
- if (logger != null) {
- LOGGER = logger;
-
- INTERCEPTOR = BootstrapInterRuntimeAssist.createInterceptor(loader, TARGET_INTERCEPTOR, LOGGER);
- }
- } else {
- LOGGER.error("Runtime ClassLoader not found when create {}." + TARGET_INTERCEPTOR);
- }
- }
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/v2/StaticMethodInterV2Template.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/v2/StaticMethodInterV2Template.java
deleted file mode 100644
index 7693c597..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/v2/StaticMethodInterV2Template.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bootstrap.template.v2;
-
-import cn.hippo4j.agent.core.plugin.bootstrap.IBootstrapLog;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.BootstrapInterRuntimeAssist;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.v2.MethodInvocationContext;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.v2.StaticMethodsAroundInterceptorV2;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.SuperCall;
-
-import java.lang.reflect.Method;
-import java.util.concurrent.Callable;
-
-/**
- * This class wouldn't be loaded in real env. This is a class template for dynamic class generation.
- */
-public class StaticMethodInterV2Template {
-
- /**
- * This field is never set in the template, but has value in the runtime.
- */
- private static String TARGET_INTERCEPTOR;
-
- private static StaticMethodsAroundInterceptorV2 INTERCEPTOR;
- private static IBootstrapLog LOGGER;
-
- /**
- * Intercept the target static method.
- *
- * @param clazz target class
- * @param allArguments all method arguments
- * @param method method description.
- * @param zuper the origin call ref.
- * @return the return value of target static method.
- * @throws Exception only throw exception because of zuper.call() or unexpected exception in sky-walking ( This is a
- * bug, if anything triggers this condition ).
- */
- @RuntimeType
- public static Object intercept(@Origin Class> clazz, @AllArguments Object[] allArguments, @Origin Method method,
- @SuperCall Callable> zuper) throws Throwable {
- prepare();
-
- MethodInvocationContext context = new MethodInvocationContext();
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.beforeMethod(clazz, method, allArguments, method.getParameterTypes(), context);
- }
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] before static method[{}] intercept failure", clazz, method.getName());
- }
-
- Object ret = null;
- try {
- if (!context.isContinue()) {
- ret = context._ret();
- } else {
- ret = zuper.call();
- }
- } catch (Throwable t) {
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.handleMethodException(clazz, method, allArguments, method.getParameterTypes(), t, context);
- }
- } catch (Throwable t2) {
- LOGGER.error(t2, "class[{}] handle static method[{}] exception failure", clazz, method.getName(), t2.getMessage());
- }
- throw t;
- } finally {
- try {
- if (INTERCEPTOR != null) {
- ret = INTERCEPTOR.afterMethod(clazz, method, allArguments, method.getParameterTypes(), ret, context);
- }
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] after static method[{}] intercept failure:{}", clazz, method.getName(), t.getMessage());
- }
- }
- return ret;
- }
-
- /**
- * Prepare the context. Link to the agent core in AppClassLoader.
- */
- private static void prepare() {
- if (INTERCEPTOR == null) {
- ClassLoader loader = BootstrapInterRuntimeAssist.getAgentClassLoader();
-
- if (loader != null) {
- IBootstrapLog logger = BootstrapInterRuntimeAssist.getLogger(loader, TARGET_INTERCEPTOR);
- if (logger != null) {
- LOGGER = logger;
-
- INTERCEPTOR = BootstrapInterRuntimeAssist.createInterceptor(loader, TARGET_INTERCEPTOR, LOGGER);
- }
- } else {
- LOGGER.error("Runtime ClassLoader not found when create {}." + TARGET_INTERCEPTOR);
- }
- }
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/v2/StaticMethodInterV2WithOverrideArgsTemplate.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/v2/StaticMethodInterV2WithOverrideArgsTemplate.java
deleted file mode 100644
index 22da45bb..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bootstrap/template/v2/StaticMethodInterV2WithOverrideArgsTemplate.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bootstrap.template.v2;
-
-import cn.hippo4j.agent.core.plugin.bootstrap.IBootstrapLog;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.BootstrapInterRuntimeAssist;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.OverrideCallable;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.v2.MethodInvocationContext;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.v2.StaticMethodsAroundInterceptorV2;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Morph;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-
-import java.lang.reflect.Method;
-
-/**
- * This class wouldn't be loaded in real env. This is a class template for dynamic class generation.
- */
-public class StaticMethodInterV2WithOverrideArgsTemplate {
-
- /**
- * This field is never set in the template, but has value in the runtime.
- */
- private static String TARGET_INTERCEPTOR;
-
- private static StaticMethodsAroundInterceptorV2 INTERCEPTOR;
- private static IBootstrapLog LOGGER;
-
- /**
- * Intercept the target static method.
- *
- * @param clazz target class
- * @param allArguments all method arguments
- * @param method method description.
- * @param zuper the origin call ref.
- * @return the return value of target static method.
- * @throws Exception only throw exception because of zuper.call() or unexpected exception in sky-walking ( This is a
- * bug, if anything triggers this condition ).
- */
- @RuntimeType
- public static Object intercept(@Origin Class> clazz, @AllArguments Object[] allArguments, @Origin Method method,
- @Morph OverrideCallable zuper) throws Throwable {
- prepare();
-
- MethodInvocationContext context = new MethodInvocationContext();
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.beforeMethod(clazz, method, allArguments, method.getParameterTypes(), context);
- }
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] before static method[{}] intercept failure", clazz, method.getName());
- }
-
- Object ret = null;
- try {
- if (!context.isContinue()) {
- ret = context._ret();
- } else {
- ret = zuper.call(allArguments);
- }
- } catch (Throwable t) {
- try {
- if (INTERCEPTOR != null) {
- INTERCEPTOR.handleMethodException(clazz, method, allArguments, method.getParameterTypes(), t, context);
- }
- } catch (Throwable t2) {
- LOGGER.error(t2, "class[{}] handle static method[{}] exception failure", clazz, method.getName(), t2.getMessage());
- }
- throw t;
- } finally {
- try {
- if (INTERCEPTOR != null) {
- ret = INTERCEPTOR.afterMethod(clazz, method, allArguments, method.getParameterTypes(), ret, context);
- }
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] after static method[{}] intercept failure:{}", clazz, method.getName(), t.getMessage());
- }
- }
- return ret;
- }
-
- /**
- * Prepare the context. Link to the agent core in AppClassLoader.
- */
- private static void prepare() {
- if (INTERCEPTOR == null) {
- ClassLoader loader = BootstrapInterRuntimeAssist.getAgentClassLoader();
-
- if (loader != null) {
- IBootstrapLog logger = BootstrapInterRuntimeAssist.getLogger(loader, TARGET_INTERCEPTOR);
- if (logger != null) {
- LOGGER = logger;
-
- INTERCEPTOR = BootstrapInterRuntimeAssist.createInterceptor(loader, TARGET_INTERCEPTOR, LOGGER);
- }
- } else {
- LOGGER.error("Runtime ClassLoader not found when create {}." + TARGET_INTERCEPTOR);
- }
- }
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/AbstractJunction.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/AbstractJunction.java
deleted file mode 100644
index 4ae6ffcf..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/AbstractJunction.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bytebuddy;
-
-import net.bytebuddy.matcher.ElementMatcher;
-
-public abstract class AbstractJunction implements ElementMatcher.Junction {
-
- @Override
- public Junction and(ElementMatcher super U> other) {
- return new Conjunction(this, other);
- }
-
- @Override
- public Junction or(ElementMatcher super U> other) {
- return new Disjunction(this, other);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/AnnotationTypeNameMatch.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/AnnotationTypeNameMatch.java
deleted file mode 100644
index a1c1f69b..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/AnnotationTypeNameMatch.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bytebuddy;
-
-import net.bytebuddy.description.annotation.AnnotationDescription;
-import net.bytebuddy.description.annotation.AnnotationSource;
-import net.bytebuddy.matcher.CollectionItemMatcher;
-import net.bytebuddy.matcher.DeclaringAnnotationMatcher;
-import net.bytebuddy.matcher.ElementMatcher;
-
-/**
- * Annotation Type match. Similar with {@link net.bytebuddy.matcher.ElementMatchers#isAnnotatedWith}, the only different
- * between them is this match use {@link String} to declare the type, instead of {@link Class}. This can avoid the
- * classloader risk.
- *
- * 2019-08-15
- */
-public class AnnotationTypeNameMatch implements ElementMatcher {
-
- /**
- * the target annotation type
- */
- private String annotationTypeName;
-
- /**
- * declare the match target method with the certain type.
- *
- * @param annotationTypeName target annotation type
- */
- private AnnotationTypeNameMatch(String annotationTypeName) {
- this.annotationTypeName = annotationTypeName;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean matches(T target) {
- return target.getAnnotationType().asErasure().getName().equals(annotationTypeName);
- }
-
- /**
- * The static method to create {@link AnnotationTypeNameMatch} This is a delegate method to follow byte-buddy {@link
- * ElementMatcher}'s code style.
- *
- * @param annotationTypeName target annotation type
- * @param The type of the object that is being matched.
- * @return new {@link AnnotationTypeNameMatch} instance.
- */
- public static Junction isAnnotatedWithType(
- String annotationTypeName) {
- final AnnotationTypeNameMatch matcher = new AnnotationTypeNameMatch(annotationTypeName);
- return new DeclaringAnnotationMatcher(new CollectionItemMatcher(matcher));
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/ArgumentTypeNameMatch.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/ArgumentTypeNameMatch.java
deleted file mode 100644
index 250370f3..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/ArgumentTypeNameMatch.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bytebuddy;
-
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.description.method.ParameterList;
-import net.bytebuddy.matcher.ElementMatcher;
-
-/**
- * Argument Type match. Similar with {@link net.bytebuddy.matcher.ElementMatchers#takesArgument}, the only different
- * between them is this match use {@link String} to declare the type, instead of {@link Class}. This can avoid the
- * classloader risk.
- *
- */
-public class ArgumentTypeNameMatch implements ElementMatcher {
-
- /**
- * the index of arguments list.
- */
- private int index;
-
- /**
- * the target argument type at {@link ArgumentTypeNameMatch#index} of the arguments list.
- */
- private String argumentTypeName;
-
- /**
- * declare the match target method with the certain index and type.
- *
- * @param index the index of arguments list.
- * @param argumentTypeName target argument type
- */
- private ArgumentTypeNameMatch(int index, String argumentTypeName) {
- ArrayTypeNameChecker.check(argumentTypeName);
-
- this.index = index;
- this.argumentTypeName = argumentTypeName;
- }
-
- /**
- * Match the target method.
- *
- * @param target target method description.
- * @return true if matched. or false.
- */
- @Override
- public boolean matches(MethodDescription target) {
- ParameterList> parameters = target.getParameters();
- if (parameters.size() > index) {
- return parameters.get(index).getType().asErasure().getName().equals(argumentTypeName);
- }
-
- return false;
- }
-
- /**
- * The static method to create {@link ArgumentTypeNameMatch} This is a delegate method to follow byte-buddy {@link
- * ElementMatcher}'s code style.
- *
- * @param index the index of arguments list.
- * @param argumentTypeName target argument type
- * @return new {@link ArgumentTypeNameMatch} instance.
- */
- public static ElementMatcher takesArgumentWithType(int index, String argumentTypeName) {
- return new ArgumentTypeNameMatch(index, argumentTypeName);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/ArrayTypeNameChecker.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/ArrayTypeNameChecker.java
deleted file mode 100644
index 907b9687..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/ArrayTypeNameChecker.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bytebuddy;
-
-public class ArrayTypeNameChecker {
-
- public static void check(String typeName) {
- if (typeName.endsWith("[]")) {
- throw new IllegalArgumentException("Please use [Lxxx; to define an Array type, and ref to JVM Specification for details");
- }
- }
-}
\ No newline at end of file
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/CacheableTransformerDecorator.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/CacheableTransformerDecorator.java
deleted file mode 100644
index fd653f60..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/CacheableTransformerDecorator.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bytebuddy;
-
-import cn.hippo4j.agent.core.boot.AgentPackagePath;
-import cn.hippo4j.agent.core.util.FileUtils;
-import cn.hippo4j.agent.core.util.IOUtils;
-import cn.hippo4j.common.boot.AgentPackageNotFoundException;
-import cn.hippo4j.common.boot.ClassCacheMode;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import net.bytebuddy.agent.builder.AgentBuilder;
-import net.bytebuddy.agent.builder.ResettableClassFileTransformer;
-import net.bytebuddy.utility.RandomString;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.lang.instrument.IllegalClassFormatException;
-import java.security.ProtectionDomain;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * Wrapper classFileTransformer of ByteBuddy, save the enhanced bytecode to memory cache or file cache,
- * and automatically load the previously generated bytecode during the second retransform,
- * to solve the problem that ByteBuddy generates auxiliary classes with different random names every time.
- * Allow other javaagent to enhance those classes that enhanced by Hippo4j agent.
- */
-public class CacheableTransformerDecorator implements AgentBuilder.TransformerDecorator {
-
- private static final ILog LOGGER = LogManager.getLogger(CacheableTransformerDecorator.class);
-
- private final ClassCacheMode cacheMode;
- private ClassCacheResolver cacheResolver;
-
- public CacheableTransformerDecorator(ClassCacheMode cacheMode) throws IOException {
- this.cacheMode = cacheMode;
- initClassCache();
- }
-
- private void initClassCache() throws IOException {
- if (this.cacheMode.equals(ClassCacheMode.FILE)) {
- String cacheDirBase = null;
- try {
- cacheDirBase = AgentPackagePath.getPath() + "/class-cache";
- } catch (AgentPackageNotFoundException e) {
- throw new IOException("Can't find the root path for creating /class-cache folder.");
- }
- File cacheDir = new File(cacheDirBase + "/class-cache-" + RandomString.make());
- if (!cacheDir.exists()) {
- cacheDir.mkdirs();
- }
- if (!cacheDir.exists()) {
- throw new IOException("Create class cache dir failure");
- }
-
- cacheResolver = new FileCacheResolver(cacheDir);
- } else {
- cacheResolver = new MemoryCacheResolver();
- }
- }
-
- @Override
- public ResettableClassFileTransformer decorate(ResettableClassFileTransformer classFileTransformer) {
- return new ResettableClassFileTransformer.WithDelegation(classFileTransformer) {
-
- @Override
- public byte[] transform(ClassLoader loader, String className, Class> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException {
- // load from cache
- byte[] classCache = cacheResolver.getClassCache(loader, className);
- if (classCache != null) {
- return classCache;
- }
-
- // transform class
- classfileBuffer = classFileTransformer.transform(loader, className, classBeingRedefined, protectionDomain, classfileBuffer);
-
- // save to cache
- if (classfileBuffer != null) {
- cacheResolver.putClassCache(loader, className, classfileBuffer);
- }
-
- return classfileBuffer;
- }
- };
- }
-
- private static String getClassLoaderHash(ClassLoader loader) {
- String classloader;
- if (loader != null) {
- classloader = Integer.toHexString(loader.hashCode());
- } else {
- // classloader is null for BootstrapClassLoader
- classloader = "00000000";
- }
- return classloader;
- }
-
- interface ClassCacheResolver {
-
- byte[] getClassCache(ClassLoader loader, String className);
-
- void putClassCache(ClassLoader loader, String className, byte[] classfileBuffer);
- }
-
- static class MemoryCacheResolver implements ClassCacheResolver {
-
- // classloaderHashcode@className -> class bytes
- private Map classCacheMap = new ConcurrentHashMap();
-
- @Override
- public byte[] getClassCache(ClassLoader loader, String className) {
- String cacheKey = getCacheKey(loader, className);
- return classCacheMap.get(cacheKey);
- }
-
- @Override
- public void putClassCache(ClassLoader loader, String className, byte[] classfileBuffer) {
- String cacheKey = getCacheKey(loader, className);
- classCacheMap.put(cacheKey, classfileBuffer);
- }
-
- private String getCacheKey(ClassLoader loader, String className) {
- return getClassLoaderHash(loader) + "@" + className;
- }
- }
-
- static class FileCacheResolver implements ClassCacheResolver {
-
- private final File cacheDir;
-
- FileCacheResolver(File cacheDir) {
- this.cacheDir = cacheDir;
-
- // clean cache dir on exit
- FileUtils.deleteDirectoryOnExit(cacheDir);
- }
-
- @Override
- public byte[] getClassCache(ClassLoader loader, String className) {
- // load from cache
- File cacheFile = getCacheFile(loader, className);
- if (cacheFile.exists()) {
- FileInputStream fileInputStream = null;
- try {
- fileInputStream = new FileInputStream(cacheFile);
- return IOUtils.toByteArray(fileInputStream);
- } catch (IOException e) {
- LOGGER.error("load class bytes from cache file failure", e);
- } finally {
- IOUtils.closeQuietly(fileInputStream);
- }
- }
- return null;
- }
-
- @Override
- public void putClassCache(ClassLoader loader, String className, byte[] classfileBuffer) {
- File cacheFile = getCacheFile(loader, className);
- cacheFile.getParentFile().mkdirs();
- FileOutputStream output = null;
- try {
- output = new FileOutputStream(cacheFile);
- IOUtils.copy(new ByteArrayInputStream(classfileBuffer), output);
- } catch (IOException e) {
- LOGGER.error("save class bytes to cache file failure", e);
- } finally {
- IOUtils.closeQuietly(output);
- }
- }
-
- private File getCacheFile(ClassLoader loader, String className) {
- String filename = getClassLoaderHash(loader) + "/" + className.replace('.', '/') + ".class";
- return new File(cacheDir, filename);
- }
-
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/ReturnTypeNameMatch.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/ReturnTypeNameMatch.java
deleted file mode 100644
index 38318020..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/bytebuddy/ReturnTypeNameMatch.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.bytebuddy;
-
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-/**
- * Return Type match. Similar with {@link net.bytebuddy.matcher.ElementMatchers#returns}, the only different between
- * them is this match use {@link String} to declare the type, instead of {@link Class}. This can avoid the classloader
- * risk.
- *
- * 2019-08-15
- */
-public class ReturnTypeNameMatch implements ElementMatcher {
-
- /**
- * the target return type
- */
- private String returnTypeName;
-
- /**
- * declare the match target method with the certain type.
- *
- * @param returnTypeName target return type
- */
- private ReturnTypeNameMatch(String returnTypeName) {
- ArrayTypeNameChecker.check(returnTypeName);
- this.returnTypeName = returnTypeName;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean matches(MethodDescription target) {
- return target.getReturnType().asErasure().getName().equals(returnTypeName);
- }
-
- /**
- * The static method to create {@link ReturnTypeNameMatch} This is a delegate method to follow byte-buddy {@link
- * ElementMatcher}'s code style.
- *
- * @param returnTypeName target return type
- * @return new {@link ReturnTypeNameMatch} instance.
- */
- public static ElementMatcher returnsWithType(String returnTypeName) {
- return new ReturnTypeNameMatch(returnTypeName);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/exception/IllegalPluginDefineException.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/exception/IllegalPluginDefineException.java
deleted file mode 100644
index a23d7240..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/exception/IllegalPluginDefineException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.exception;
-
-/**
- * Thrown to indicate that a illegal format plugin definition has been defined in hippo4j-plugin.define.
- */
-public class IllegalPluginDefineException extends Exception {
-
- public IllegalPluginDefineException(String define) {
- super("Illegal plugin define : " + define);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/ConstructorInterceptPoint.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/ConstructorInterceptPoint.java
deleted file mode 100644
index 330aa7d0..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/ConstructorInterceptPoint.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor;
-
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-/**
- * One of the three "Intercept Point". "Intercept Point" is a definition about where and how intercept happens. In this
- * "Intercept Point", the definition targets class's constructors, and the interceptor.
- *
- * ref to two others: {@link StaticMethodsInterceptPoint} and {@link InstanceMethodsInterceptPoint}
- *
- */
-public interface ConstructorInterceptPoint {
-
- /**
- * Constructor matcher
- *
- * @return matcher instance.
- */
- ElementMatcher getConstructorMatcher();
-
- /**
- * @return represents a class name, the class instance must be a instance of {@link
- * cn.hippo4j.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor}
- */
- String getConstructorInterceptor();
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/DeclaredInstanceMethodsInterceptPoint.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/DeclaredInstanceMethodsInterceptPoint.java
deleted file mode 100644
index 5ff4368a..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/DeclaredInstanceMethodsInterceptPoint.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor;
-
-/**
- * this interface for those who only want to enhance declared method in case of some unexpected issue, such as spring
- * controller
- */
-public interface DeclaredInstanceMethodsInterceptPoint extends InstanceMethodsInterceptPoint {
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/EnhanceException.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/EnhanceException.java
deleted file mode 100644
index 605bd8f5..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/EnhanceException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor;
-
-import cn.hippo4j.agent.core.plugin.PluginException;
-
-public class EnhanceException extends PluginException {
-
- private static final long serialVersionUID = -2234782755784217255L;
-
- public EnhanceException(String message) {
- super(message);
- }
-
- public EnhanceException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/InstanceMethodsInterceptPoint.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/InstanceMethodsInterceptPoint.java
deleted file mode 100644
index 396f471c..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/InstanceMethodsInterceptPoint.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor;
-
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-/**
- * One of the three "Intercept Point". "Intercept Point" is a definition about where and how intercept happens. In this
- * "Intercept Point", the definition targets class's instance methods, and the interceptor.
- *
- * ref to two others: {@link ConstructorInterceptPoint} and {@link StaticMethodsInterceptPoint}
- *
- */
-public interface InstanceMethodsInterceptPoint {
-
- /**
- * class instance methods matcher.
- *
- * @return methods matcher
- */
- ElementMatcher getMethodsMatcher();
-
- /**
- * @return represents a class name, the class instance must instanceof InstanceMethodsAroundInterceptor.
- */
- String getMethodsInterceptor();
-
- boolean isOverrideArgs();
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/StaticMethodsInterceptPoint.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/StaticMethodsInterceptPoint.java
deleted file mode 100644
index 73babfa5..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/StaticMethodsInterceptPoint.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor;
-
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-/**
- * One of the three "Intercept Point". "Intercept Point" is a definition about where and how intercept happens. In this
- * "Intercept Point", the definition targets class's static methods, and the interceptor.
- *
- * ref to two others: {@link ConstructorInterceptPoint} and {@link InstanceMethodsInterceptPoint}
- *
- */
-public interface StaticMethodsInterceptPoint {
-
- /**
- * static methods matcher.
- *
- * @return matcher instance.
- */
- ElementMatcher getMethodsMatcher();
-
- /**
- * @return represents a class name, the class instance must instanceof StaticMethodsAroundInterceptor.
- */
- String getMethodsInterceptor();
-
- boolean isOverrideArgs();
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/BootstrapInterRuntimeAssist.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/BootstrapInterRuntimeAssist.java
deleted file mode 100644
index a1c5d38a..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/BootstrapInterRuntimeAssist.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance;
-
-import cn.hippo4j.agent.core.plugin.bootstrap.IBootstrapLog;
-
-import java.io.PrintStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-/**
- * This assist help all bootstrap class core interceptor.
- */
-public class BootstrapInterRuntimeAssist {
-
- private static final String AGENT_CLASSLOADER_DEFAULT = "cn.hippo4j.agent.core.plugin.loader.AgentClassLoader";
- private static final String DEFAULT_AGENT_CLASSLOADER_INSTANCE = "DEFAULT_LOADER";
- private static final String LOG_MANAGER_CLASS = "cn.hippo4j.agent.core.plugin.bootstrap.BootstrapPluginLogBridge";
- private static final String LOG_MANAGER_GET_LOGGER_METHOD = "getLogger";
- private static final PrintStream OUT = System.out;
-
- public static ClassLoader getAgentClassLoader() {
- try {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- if (loader == null) {
- return null;
- }
- Class> agentClassLoaderClass = Class.forName(AGENT_CLASSLOADER_DEFAULT, true, loader);
- Field defaultLoaderField = agentClassLoaderClass.getDeclaredField(DEFAULT_AGENT_CLASSLOADER_INSTANCE);
- defaultLoaderField.setAccessible(true);
- ClassLoader defaultAgentClassLoader = (ClassLoader) defaultLoaderField.get(null);
-
- return defaultAgentClassLoader;
- } catch (Exception e) {
- e.printStackTrace(OUT);
- return null;
- }
- }
-
- public static IBootstrapLog getLogger(ClassLoader defaultAgentClassLoader, String interceptor) {
- try {
- Class> logManagerClass = Class.forName(LOG_MANAGER_CLASS, true, defaultAgentClassLoader);
- Method getLogger = logManagerClass.getMethod(LOG_MANAGER_GET_LOGGER_METHOD, String.class);
- return (IBootstrapLog) getLogger.invoke(null, interceptor + "_internal");
- } catch (Exception e) {
- e.printStackTrace(OUT);
- return null;
- }
- }
-
- public static T createInterceptor(ClassLoader defaultAgentClassLoader, String className, IBootstrapLog log) {
- try {
- Class> interceptor = Class.forName(className, true, defaultAgentClassLoader);
- return (T) interceptor.newInstance();
- } catch (Exception e) {
- log.error(e, "Interceptor[{}] not found", className);
- }
- return null;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/ClassEnhancePluginDefine.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/ClassEnhancePluginDefine.java
deleted file mode 100644
index 5790f80c..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/ClassEnhancePluginDefine.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance;
-
-import cn.hippo4j.agent.core.plugin.AbstractClassEnhancePluginDefine;
-import cn.hippo4j.agent.core.plugin.EnhanceContext;
-import cn.hippo4j.agent.core.plugin.PluginException;
-import cn.hippo4j.agent.core.plugin.bootstrap.BootstrapInstrumentBoost;
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.DeclaredInstanceMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.EnhanceException;
-import cn.hippo4j.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.StaticMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.v2.InstanceMethodsInterceptV2Point;
-import cn.hippo4j.agent.core.plugin.interceptor.v2.StaticMethodsInterceptV2Point;
-import cn.hippo4j.agent.core.util.StringUtil;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.dynamic.DynamicType;
-import net.bytebuddy.implementation.FieldAccessor;
-import net.bytebuddy.implementation.MethodDelegation;
-import net.bytebuddy.implementation.SuperMethodCall;
-import net.bytebuddy.implementation.bind.annotation.Morph;
-import net.bytebuddy.matcher.ElementMatcher;
-import net.bytebuddy.matcher.ElementMatchers;
-
-import static net.bytebuddy.jar.asm.Opcodes.ACC_PRIVATE;
-import static net.bytebuddy.jar.asm.Opcodes.ACC_VOLATILE;
-import static net.bytebuddy.matcher.ElementMatchers.isStatic;
-import static net.bytebuddy.matcher.ElementMatchers.not;
-
-/**
- * This class controls all enhance operations, including enhance constructors, instance methods and static methods. All
- * the enhances base on three types interceptor point: {@link ConstructorInterceptPoint}, {@link
- * InstanceMethodsInterceptPoint} and {@link StaticMethodsInterceptPoint} If plugin is going to enhance constructors,
- * instance methods, or both, {@link ClassEnhancePluginDefine} will add a field of {@link Object} type.
- */
-public abstract class ClassEnhancePluginDefine extends AbstractClassEnhancePluginDefine {
-
- private static final ILog LOGGER = LogManager.getLogger(ClassEnhancePluginDefine.class);
-
- /**
- * Enhance a class to intercept constructors and class instance methods.
- *
- * @param typeDescription target class description
- * @param newClassBuilder byte-buddy's builder to manipulate class bytecode.
- * @return new byte-buddy's builder for further manipulation.
- */
- @Override
- protected DynamicType.Builder> enhanceInstance(TypeDescription typeDescription,
- DynamicType.Builder> newClassBuilder, ClassLoader classLoader,
- EnhanceContext context) throws PluginException {
- ConstructorInterceptPoint[] constructorInterceptPoints = getConstructorsInterceptPoints();
- InstanceMethodsInterceptPoint[] instanceMethodsInterceptPoints = getInstanceMethodsInterceptPoints();
- String enhanceOriginClassName = typeDescription.getTypeName();
- boolean existedConstructorInterceptPoint = false;
- if (constructorInterceptPoints != null && constructorInterceptPoints.length > 0) {
- existedConstructorInterceptPoint = true;
- }
- boolean existedMethodsInterceptPoints = false;
- if (instanceMethodsInterceptPoints != null && instanceMethodsInterceptPoints.length > 0) {
- existedMethodsInterceptPoints = true;
- }
-
- /**
- * nothing need to be enhanced in class instance, maybe need enhance static methods.
- */
- if (!existedConstructorInterceptPoint && !existedMethodsInterceptPoints) {
- return newClassBuilder;
- }
-
- /**
- * Manipulate class source code.
- *
- * new class need:
- * 1.Add field, name {@link #CONTEXT_ATTR_NAME}.
- * 2.Add a field accessor for this field.
- *
- * And make sure the source codes manipulation only occurs once.
- *
- */
- if (!typeDescription.isAssignableTo(EnhancedInstance.class)) {
- if (!context.isObjectExtended()) {
- newClassBuilder = newClassBuilder.defineField(
- CONTEXT_ATTR_NAME, Object.class, ACC_PRIVATE | ACC_VOLATILE)
- .implement(EnhancedInstance.class)
- .intercept(FieldAccessor.ofField(CONTEXT_ATTR_NAME));
- context.extendObjectCompleted();
- }
- }
-
- /**
- * 2. enhance constructors
- */
- if (existedConstructorInterceptPoint) {
- for (ConstructorInterceptPoint constructorInterceptPoint : constructorInterceptPoints) {
- if (isBootstrapInstrumentation()) {
- newClassBuilder = newClassBuilder.constructor(constructorInterceptPoint.getConstructorMatcher())
- .intercept(SuperMethodCall.INSTANCE.andThen(MethodDelegation.withDefaultConfiguration()
- .to(BootstrapInstrumentBoost
- .forInternalDelegateClass(constructorInterceptPoint
- .getConstructorInterceptor()))));
- } else {
- newClassBuilder = newClassBuilder.constructor(constructorInterceptPoint.getConstructorMatcher())
- .intercept(SuperMethodCall.INSTANCE.andThen(MethodDelegation.withDefaultConfiguration()
- .to(new ConstructorInter(constructorInterceptPoint
- .getConstructorInterceptor(), classLoader))));
- }
- }
- }
-
- /**
- * 3. enhance instance methods
- */
- if (existedMethodsInterceptPoints) {
- for (InstanceMethodsInterceptPoint instanceMethodsInterceptPoint : instanceMethodsInterceptPoints) {
- String interceptor = instanceMethodsInterceptPoint.getMethodsInterceptor();
- if (StringUtil.isEmpty(interceptor)) {
- throw new EnhanceException("no InstanceMethodsAroundInterceptor define to enhance class " + enhanceOriginClassName);
- }
- ElementMatcher.Junction junction = not(isStatic()).and(instanceMethodsInterceptPoint.getMethodsMatcher());
- if (instanceMethodsInterceptPoint instanceof DeclaredInstanceMethodsInterceptPoint) {
- junction = junction.and(ElementMatchers.isDeclaredBy(typeDescription));
- }
- if (instanceMethodsInterceptPoint.isOverrideArgs()) {
- if (isBootstrapInstrumentation()) {
- newClassBuilder = newClassBuilder.method(junction)
- .intercept(MethodDelegation.withDefaultConfiguration()
- .withBinders(Morph.Binder.install(OverrideCallable.class))
- .to(BootstrapInstrumentBoost.forInternalDelegateClass(interceptor)));
- } else {
- newClassBuilder = newClassBuilder.method(junction)
- .intercept(MethodDelegation.withDefaultConfiguration()
- .withBinders(Morph.Binder.install(OverrideCallable.class))
- .to(new InstMethodsInterWithOverrideArgs(interceptor, classLoader)));
- }
- } else {
- if (isBootstrapInstrumentation()) {
- newClassBuilder = newClassBuilder.method(junction)
- .intercept(MethodDelegation.withDefaultConfiguration()
- .to(BootstrapInstrumentBoost.forInternalDelegateClass(interceptor)));
- } else {
- newClassBuilder = newClassBuilder.method(junction)
- .intercept(MethodDelegation.withDefaultConfiguration()
- .to(new InstMethodsInter(interceptor, classLoader)));
- }
- }
- }
- }
-
- return newClassBuilder;
- }
-
- /**
- * Enhance a class to intercept class static methods.
- *
- * @param typeDescription target class description
- * @param newClassBuilder byte-buddy's builder to manipulate class bytecode.
- * @return new byte-buddy's builder for further manipulation.
- */
- @Override
- protected DynamicType.Builder> enhanceClass(TypeDescription typeDescription, DynamicType.Builder> newClassBuilder,
- ClassLoader classLoader) throws PluginException {
- StaticMethodsInterceptPoint[] staticMethodsInterceptPoints = getStaticMethodsInterceptPoints();
- String enhanceOriginClassName = typeDescription.getTypeName();
- if (staticMethodsInterceptPoints == null || staticMethodsInterceptPoints.length == 0) {
- return newClassBuilder;
- }
-
- for (StaticMethodsInterceptPoint staticMethodsInterceptPoint : staticMethodsInterceptPoints) {
- String interceptor = staticMethodsInterceptPoint.getMethodsInterceptor();
- if (StringUtil.isEmpty(interceptor)) {
- throw new EnhanceException("no StaticMethodsAroundInterceptor define to enhance class " + enhanceOriginClassName);
- }
-
- if (staticMethodsInterceptPoint.isOverrideArgs()) {
- if (isBootstrapInstrumentation()) {
- newClassBuilder = newClassBuilder.method(isStatic().and(staticMethodsInterceptPoint.getMethodsMatcher()))
- .intercept(MethodDelegation.withDefaultConfiguration()
- .withBinders(Morph.Binder.install(OverrideCallable.class))
- .to(BootstrapInstrumentBoost.forInternalDelegateClass(interceptor)));
- } else {
- newClassBuilder = newClassBuilder.method(isStatic().and(staticMethodsInterceptPoint.getMethodsMatcher()))
- .intercept(MethodDelegation.withDefaultConfiguration()
- .withBinders(Morph.Binder.install(OverrideCallable.class))
- .to(new StaticMethodsInterWithOverrideArgs(interceptor)));
- }
- } else {
- if (isBootstrapInstrumentation()) {
- newClassBuilder = newClassBuilder.method(isStatic().and(staticMethodsInterceptPoint.getMethodsMatcher()))
- .intercept(MethodDelegation.withDefaultConfiguration()
- .to(BootstrapInstrumentBoost.forInternalDelegateClass(interceptor)));
- } else {
- newClassBuilder = newClassBuilder.method(isStatic().and(staticMethodsInterceptPoint.getMethodsMatcher()))
- .intercept(MethodDelegation.withDefaultConfiguration()
- .to(new StaticMethodsInter(interceptor)));
- }
- }
-
- }
-
- return newClassBuilder;
- }
-
- /**
- * @return null, means enhance no v2 instance methods.
- */
- @Override
- public InstanceMethodsInterceptV2Point[] getInstanceMethodsInterceptV2Points() {
- return null;
- }
-
- /**
- * @return null, means enhance no v2 static methods.
- */
- @Override
- public StaticMethodsInterceptV2Point[] getStaticMethodsInterceptV2Points() {
- return null;
- }
-
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/ClassInstanceMethodsEnhancePluginDefine.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/ClassInstanceMethodsEnhancePluginDefine.java
deleted file mode 100644
index f8b5c8c3..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/ClassInstanceMethodsEnhancePluginDefine.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance;
-
-import cn.hippo4j.agent.core.plugin.interceptor.StaticMethodsInterceptPoint;
-
-/**
- * Plugins, which only need enhance class instance methods. Actually, inherit from {@link
- * ClassInstanceMethodsEnhancePluginDefine} has no differences with inherit from {@link ClassEnhancePluginDefine}. Just
- * override {@link ClassEnhancePluginDefine#getStaticMethodsInterceptPoints}, and return NULL, which means nothing to
- * enhance.
- */
-public abstract class ClassInstanceMethodsEnhancePluginDefine extends ClassEnhancePluginDefine {
-
- /**
- * @return null, means enhance no static methods.
- */
- @Override
- public StaticMethodsInterceptPoint[] getStaticMethodsInterceptPoints() {
- return null;
- }
-
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/ClassStaticMethodsEnhancePluginDefine.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/ClassStaticMethodsEnhancePluginDefine.java
deleted file mode 100644
index c5b04513..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/ClassStaticMethodsEnhancePluginDefine.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance;
-
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
-
-/**
- * Plugins, which only need enhance class static methods. Actually, inherit from {@link
- * ClassStaticMethodsEnhancePluginDefine} has no differences with inherit from {@link ClassEnhancePluginDefine}. Just
- * override {@link ClassEnhancePluginDefine#getConstructorsInterceptPoints} and {@link
- * ClassEnhancePluginDefine#getInstanceMethodsInterceptPoints}, and return NULL, which means nothing to enhance.
- */
-public abstract class ClassStaticMethodsEnhancePluginDefine extends ClassEnhancePluginDefine {
-
- /**
- * @return null, means enhance no constructors.
- */
- @Override
- public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
- return null;
- }
-
- /**
- * @return null, means enhance no instance methods.
- */
- @Override
- public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
- return null;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/ConstructorInter.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/ConstructorInter.java
deleted file mode 100644
index 7896eb22..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/ConstructorInter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.agent.core.plugin.PluginException;
-import cn.hippo4j.agent.core.plugin.loader.InterceptorInstanceLoader;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.This;
-
-/**
- * The actual byte-buddy's interceptor to intercept constructor methods. In this class, it provides a bridge between
- * byte-buddy and sky-walking plugin.
- */
-public class ConstructorInter {
-
- private static final ILog LOGGER = LogManager.getLogger(ConstructorInter.class);
-
- /**
- * An {@link InstanceConstructorInterceptor} This name should only stay in {@link String}, the real {@link Class}
- * type will trigger classloader failure. If you want to know more, please check on books about Classloader or
- * Classloader appointment mechanism.
- */
- private InstanceConstructorInterceptor interceptor;
-
- /**
- * @param constructorInterceptorClassName class full name.
- */
- public ConstructorInter(String constructorInterceptorClassName, ClassLoader classLoader) throws PluginException {
- try {
- interceptor = InterceptorInstanceLoader.load(constructorInterceptorClassName, classLoader);
- } catch (Throwable t) {
- throw new PluginException("Can't create InstanceConstructorInterceptorV2.", t);
- }
- }
-
- /**
- * Intercept the target constructor.
- *
- * @param obj target class instance.
- * @param allArguments all constructor arguments
- */
- @RuntimeType
- public void intercept(@This Object obj, @AllArguments Object[] allArguments) {
- try {
- EnhancedInstance targetObject = (EnhancedInstance) obj;
-
- interceptor.onConstruct(targetObject, allArguments);
- } catch (Throwable t) {
- LOGGER.error("ConstructorInter failure.", t);
- }
-
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/EnhancedInstance.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/EnhancedInstance.java
deleted file mode 100644
index c6b7900b..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/EnhancedInstance.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance;
-
-public interface EnhancedInstance {
-
- Object getHippo4jDynamicField();
-
- void setHippo4jDynamicField(Object value);
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/InstMethodsInter.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/InstMethodsInter.java
deleted file mode 100644
index 1d5dd6c1..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/InstMethodsInter.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.agent.core.plugin.PluginException;
-import cn.hippo4j.agent.core.plugin.loader.InterceptorInstanceLoader;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.SuperCall;
-import net.bytebuddy.implementation.bind.annotation.This;
-
-import java.lang.reflect.Method;
-import java.util.concurrent.Callable;
-
-/**
- * The actual byte-buddy's interceptor to intercept class instance methods. In this class, it provides a bridge between
- * byte-buddy and sky-walking plugin.
- */
-public class InstMethodsInter {
-
- private static final ILog LOGGER = LogManager.getLogger(InstMethodsInter.class);
-
- /**
- * An {@link InstanceMethodsAroundInterceptor} This name should only stay in {@link String}, the real {@link Class}
- * type will trigger classloader failure. If you want to know more, please check on books about Classloader or
- * Classloader appointment mechanism.
- */
- private InstanceMethodsAroundInterceptor interceptor;
-
- /**
- * @param instanceMethodsAroundInterceptorClassName class full name.
- */
- public InstMethodsInter(String instanceMethodsAroundInterceptorClassName, ClassLoader classLoader) {
- try {
- interceptor = InterceptorInstanceLoader.load(instanceMethodsAroundInterceptorClassName, classLoader);
- } catch (Throwable t) {
- throw new PluginException("Can't create InstanceMethodsAroundInterceptor.", t);
- }
- }
-
- /**
- * Intercept the target instance method.
- *
- * @param obj target class instance.
- * @param allArguments all method arguments
- * @param method method description.
- * @param zuper the origin call ref.
- * @return the return value of target instance method.
- * @throws Exception only throw exception because of zuper.call() or unexpected exception in sky-walking ( This is a
- * bug, if anything triggers this condition ).
- */
- @RuntimeType
- public Object intercept(@This Object obj, @AllArguments Object[] allArguments, @SuperCall Callable> zuper,
- @Origin Method method) throws Throwable {
- EnhancedInstance targetObject = (EnhancedInstance) obj;
-
- MethodInterceptResult result = new MethodInterceptResult();
- try {
- interceptor.beforeMethod(targetObject, method, allArguments, method.getParameterTypes(), result);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] before method[{}] intercept failure", obj.getClass(), method.getName());
- }
-
- Object ret = null;
- try {
- if (!result.isContinue()) {
- ret = result._ret();
- } else {
- ret = zuper.call();
- }
- } catch (Throwable t) {
- try {
- interceptor.handleMethodException(targetObject, method, allArguments, method.getParameterTypes(), t);
- } catch (Throwable t2) {
- LOGGER.error(t2, "class[{}] handle method[{}] exception failure", obj.getClass(), method.getName());
- }
- throw t;
- } finally {
- try {
- ret = interceptor.afterMethod(targetObject, method, allArguments, method.getParameterTypes(), ret);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] after method[{}] intercept failure", obj.getClass(), method.getName());
- }
- }
- return ret;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/InstMethodsInterWithOverrideArgs.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/InstMethodsInterWithOverrideArgs.java
deleted file mode 100644
index 57bc7444..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/InstMethodsInterWithOverrideArgs.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.agent.core.plugin.PluginException;
-import cn.hippo4j.agent.core.plugin.loader.InterceptorInstanceLoader;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Morph;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.This;
-
-import java.lang.reflect.Method;
-
-/**
- * The actual byte-buddy's interceptor to intercept class instance methods. In this class, it provides a bridge between
- * byte-buddy and sky-walking plugin.
- */
-public class InstMethodsInterWithOverrideArgs {
-
- private static final ILog LOGGER = LogManager.getLogger(InstMethodsInterWithOverrideArgs.class);
-
- /**
- * An {@link InstanceMethodsAroundInterceptor} This name should only stay in {@link String}, the real {@link Class}
- * type will trigger classloader failure. If you want to know more, please check on books about Classloader or
- * Classloader appointment mechanism.
- */
- private InstanceMethodsAroundInterceptor interceptor;
-
- /**
- * @param instanceMethodsAroundInterceptorClassName class full name.
- */
- public InstMethodsInterWithOverrideArgs(String instanceMethodsAroundInterceptorClassName, ClassLoader classLoader) {
- try {
- interceptor = InterceptorInstanceLoader.load(instanceMethodsAroundInterceptorClassName, classLoader);
- } catch (Throwable t) {
- throw new PluginException("Can't create InstanceMethodsAroundInterceptor.", t);
- }
- }
-
- /**
- * Intercept the target instance method.
- *
- * @param obj target class instance.
- * @param allArguments all method arguments
- * @param method method description.
- * @param zuper the origin call ref.
- * @return the return value of target instance method.
- * @throws Exception only throw exception because of zuper.call() or unexpected exception in sky-walking ( This is a
- * bug, if anything triggers this condition ).
- */
- @RuntimeType
- public Object intercept(@This Object obj, @AllArguments Object[] allArguments, @Origin Method method,
- @Morph OverrideCallable zuper) throws Throwable {
- EnhancedInstance targetObject = (EnhancedInstance) obj;
-
- MethodInterceptResult result = new MethodInterceptResult();
- try {
- interceptor.beforeMethod(targetObject, method, allArguments, method.getParameterTypes(), result);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] before method[{}] intercept failure", obj.getClass(), method.getName());
- }
-
- Object ret = null;
- try {
- if (!result.isContinue()) {
- ret = result._ret();
- } else {
- ret = zuper.call(allArguments);
- }
- } catch (Throwable t) {
- try {
- interceptor.handleMethodException(targetObject, method, allArguments, method.getParameterTypes(), t);
- } catch (Throwable t2) {
- LOGGER.error(t2, "class[{}] handle method[{}] exception failure", obj.getClass(), method.getName());
- }
- throw t;
- } finally {
- try {
- ret = interceptor.afterMethod(targetObject, method, allArguments, method.getParameterTypes(), ret);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] after method[{}] intercept failure", obj.getClass(), method.getName());
- }
- }
- return ret;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/InstanceConstructorInterceptor.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/InstanceConstructorInterceptor.java
deleted file mode 100644
index 7cc3472c..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/InstanceConstructorInterceptor.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance;
-
-/**
- * The instance constructor's interceptor interface. Any plugin, which wants to intercept constructor, must implement
- * this interface.
- *
- */
-public interface InstanceConstructorInterceptor {
-
- /**
- * Called after the origin constructor invocation.
- */
- void onConstruct(EnhancedInstance objInst, Object[] allArguments) throws Throwable;
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/InstanceMethodsAroundInterceptor.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/InstanceMethodsAroundInterceptor.java
deleted file mode 100644
index 97e13ad8..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/InstanceMethodsAroundInterceptor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance;
-
-import java.lang.reflect.Method;
-
-/**
- * A interceptor, which intercept method's invocation. The target methods will be defined in {@link
- * ClassEnhancePluginDefine}'s subclass, most likely in {@link ClassInstanceMethodsEnhancePluginDefine}
- */
-public interface InstanceMethodsAroundInterceptor {
-
- /**
- * called before target method invocation.
- *
- * @param result change this result, if you want to truncate the method.
- */
- void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes,
- MethodInterceptResult result) throws Throwable;
-
- /**
- * called after target method invocation. Even method's invocation triggers an exception.
- *
- * @param ret the method's original return value. May be null if the method triggers an exception.
- * @return the method's actual return value.
- */
- Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes,
- Object ret) throws Throwable;
-
- /**
- * called when occur exception.
- *
- * @param t the exception occur.
- */
- void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
- Class>[] argumentsTypes, Throwable t);
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/MethodInterceptResult.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/MethodInterceptResult.java
deleted file mode 100644
index e647f2bc..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/MethodInterceptResult.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance;
-
-import java.lang.reflect.Method;
-
-/**
- * This is a method return value manipulator. When a interceptor's method, such as {@link
- * InstanceMethodsAroundInterceptor#beforeMethod(EnhancedInstance, Method, Object[], Class[], MethodInterceptResult)}
- * (org.apache.skywalking.apm.agent.core.plugin.interceptor.EnhancedClassInstanceContext, has this as a method argument,
- * the interceptor can manipulate the method's return value.
The new value set to this object, by {@link
- * MethodInterceptResult#defineReturnValue(Object)}, will override the origin return value.
- */
-public class MethodInterceptResult {
-
- private boolean isContinue = true;
-
- private Object ret = null;
-
- /**
- * define the new return value.
- *
- * @param ret new return value.
- */
- public void defineReturnValue(Object ret) {
- this.isContinue = false;
- this.ret = ret;
- }
-
- /**
- * @return true, will trigger method interceptor({@link InstMethodsInter} and {@link StaticMethodsInter}) to invoke
- * the origin method. Otherwise, not.
- */
- public boolean isContinue() {
- return isContinue;
- }
-
- /**
- * @return the new return value.
- */
- public Object _ret() {
- return ret;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/OverrideCallable.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/OverrideCallable.java
deleted file mode 100644
index 8a488dd4..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/OverrideCallable.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance;
-
-public interface OverrideCallable {
-
- Object call(Object[] args);
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/StaticMethodsAroundInterceptor.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/StaticMethodsAroundInterceptor.java
deleted file mode 100644
index d6398f19..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/StaticMethodsAroundInterceptor.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance;
-
-import java.lang.reflect.Method;
-
-/**
- * The static method's interceptor interface. Any plugin, which wants to intercept static methods, must implement this
- * interface.
- */
-public interface StaticMethodsAroundInterceptor {
-
- /**
- * called before target method invocation.
- *
- * @param result change this result, if you want to truncate the method.
- */
- void beforeMethod(Class clazz, Method method, Object[] allArguments, Class>[] parameterTypes,
- MethodInterceptResult result);
-
- /**
- * called after target method invocation. Even method's invocation triggers an exception.
- *
- * @param ret the method's original return value.
- * @return the method's actual return value.
- */
- Object afterMethod(Class clazz, Method method, Object[] allArguments, Class>[] parameterTypes, Object ret);
-
- /**
- * called when occur exception.
- *
- * @param t the exception occur.
- */
- void handleMethodException(Class clazz, Method method, Object[] allArguments, Class>[] parameterTypes,
- Throwable t);
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/StaticMethodsInter.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/StaticMethodsInter.java
deleted file mode 100644
index 0a98c7de..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/StaticMethodsInter.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.agent.core.plugin.loader.InterceptorInstanceLoader;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.SuperCall;
-
-import java.lang.reflect.Method;
-import java.util.concurrent.Callable;
-
-/**
- * The actual byte-buddy's interceptor to intercept class static methods. In this class, it provides a bridge between
- * byte-buddy and sky-walking plugin.
- */
-public class StaticMethodsInter {
-
- private static final ILog LOGGER = LogManager.getLogger(StaticMethodsInter.class);
-
- /**
- * A class full name, and instanceof {@link StaticMethodsAroundInterceptor} This name should only stay in {@link
- * String}, the real {@link Class} type will trigger classloader failure. If you want to know more, please check on
- * books about Classloader or Classloader appointment mechanism.
- */
- private String staticMethodsAroundInterceptorClassName;
-
- /**
- * Set the name of {@link StaticMethodsInter#staticMethodsAroundInterceptorClassName}
- *
- * @param staticMethodsAroundInterceptorClassName class full name.
- */
- public StaticMethodsInter(String staticMethodsAroundInterceptorClassName) {
- this.staticMethodsAroundInterceptorClassName = staticMethodsAroundInterceptorClassName;
- }
-
- /**
- * Intercept the target static method.
- *
- * @param clazz target class
- * @param allArguments all method arguments
- * @param method method description.
- * @param zuper the origin call ref.
- * @return the return value of target static method.
- * @throws Exception only throw exception because of zuper.call() or unexpected exception in sky-walking ( This is a
- * bug, if anything triggers this condition ).
- */
- @RuntimeType
- public Object intercept(@Origin Class> clazz, @AllArguments Object[] allArguments, @Origin Method method,
- @SuperCall Callable> zuper) throws Throwable {
- StaticMethodsAroundInterceptor interceptor = InterceptorInstanceLoader.load(staticMethodsAroundInterceptorClassName, clazz
- .getClassLoader());
-
- MethodInterceptResult result = new MethodInterceptResult();
- try {
- interceptor.beforeMethod(clazz, method, allArguments, method.getParameterTypes(), result);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] before static method[{}] intercept failure", clazz, method.getName());
- }
-
- Object ret = null;
- try {
- if (!result.isContinue()) {
- ret = result._ret();
- } else {
- ret = zuper.call();
- }
- } catch (Throwable t) {
- try {
- interceptor.handleMethodException(clazz, method, allArguments, method.getParameterTypes(), t);
- } catch (Throwable t2) {
- LOGGER.error(t2, "class[{}] handle static method[{}] exception failure", clazz, method.getName(), t2.getMessage());
- }
- throw t;
- } finally {
- try {
- ret = interceptor.afterMethod(clazz, method, allArguments, method.getParameterTypes(), ret);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] after static method[{}] intercept failure:{}", clazz, method.getName(), t.getMessage());
- }
- }
- return ret;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/StaticMethodsInterWithOverrideArgs.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/StaticMethodsInterWithOverrideArgs.java
deleted file mode 100644
index e7c11a7f..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/StaticMethodsInterWithOverrideArgs.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.agent.core.plugin.loader.InterceptorInstanceLoader;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Morph;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-
-import java.lang.reflect.Method;
-
-/**
- * The actual byte-buddy's interceptor to intercept class static methods. In this class, it provides a bridge between
- * byte-buddy and sky-walking plugin.
- */
-public class StaticMethodsInterWithOverrideArgs {
-
- private static final ILog LOGGER = LogManager.getLogger(StaticMethodsInterWithOverrideArgs.class);
-
- /**
- * A class full name, and instanceof {@link StaticMethodsAroundInterceptor} This name should only stay in {@link
- * String}, the real {@link Class} type will trigger classloader failure. If you want to know more, please check on
- * books about Classloader or Classloader appointment mechanism.
- */
- private String staticMethodsAroundInterceptorClassName;
-
- /**
- * Set the name of {@link StaticMethodsInterWithOverrideArgs#staticMethodsAroundInterceptorClassName}
- *
- * @param staticMethodsAroundInterceptorClassName class full name.
- */
- public StaticMethodsInterWithOverrideArgs(String staticMethodsAroundInterceptorClassName) {
- this.staticMethodsAroundInterceptorClassName = staticMethodsAroundInterceptorClassName;
- }
-
- /**
- * Intercept the target static method.
- *
- * @param clazz target class
- * @param allArguments all method arguments
- * @param method method description.
- * @param zuper the origin call ref.
- * @return the return value of target static method.
- * @throws Exception only throw exception because of zuper.call() or unexpected exception in sky-walking ( This is a
- * bug, if anything triggers this condition ).
- */
- @RuntimeType
- public Object intercept(@Origin Class> clazz, @AllArguments Object[] allArguments, @Origin Method method,
- @Morph OverrideCallable zuper) throws Throwable {
- StaticMethodsAroundInterceptor interceptor = InterceptorInstanceLoader.load(staticMethodsAroundInterceptorClassName, clazz
- .getClassLoader());
-
- MethodInterceptResult result = new MethodInterceptResult();
- try {
- interceptor.beforeMethod(clazz, method, allArguments, method.getParameterTypes(), result);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] before static method[{}] intercept failure", clazz, method.getName());
- }
-
- Object ret = null;
- try {
- if (!result.isContinue()) {
- ret = result._ret();
- } else {
- ret = zuper.call(allArguments);
- }
- } catch (Throwable t) {
- try {
- interceptor.handleMethodException(clazz, method, allArguments, method.getParameterTypes(), t);
- } catch (Throwable t2) {
- LOGGER.error(t2, "class[{}] handle static method[{}] exception failure", clazz, method.getName(), t2.getMessage());
- }
- throw t;
- } finally {
- try {
- ret = interceptor.afterMethod(clazz, method, allArguments, method.getParameterTypes(), ret);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] after static method[{}] intercept failure:{}", clazz, method.getName(), t.getMessage());
- }
- }
- return ret;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/ClassEnhancePluginDefineV2.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/ClassEnhancePluginDefineV2.java
deleted file mode 100644
index 75da0262..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/ClassEnhancePluginDefineV2.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance.v2;
-
-import cn.hippo4j.agent.core.plugin.AbstractClassEnhancePluginDefine;
-import cn.hippo4j.agent.core.plugin.EnhanceContext;
-import cn.hippo4j.agent.core.plugin.PluginException;
-import cn.hippo4j.agent.core.plugin.bootstrap.BootstrapInstrumentBoost;
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.EnhanceException;
-import cn.hippo4j.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.StaticMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.ConstructorInter;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.OverrideCallable;
-import cn.hippo4j.agent.core.plugin.interceptor.v2.ConstructorInterceptV2Point;
-import cn.hippo4j.agent.core.plugin.interceptor.v2.DeclaredInstanceMethodsInterceptV2Point;
-import cn.hippo4j.agent.core.plugin.interceptor.v2.InstanceMethodsInterceptV2Point;
-import cn.hippo4j.agent.core.plugin.interceptor.v2.StaticMethodsInterceptV2Point;
-import cn.hippo4j.agent.core.util.StringUtil;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.dynamic.DynamicType;
-import net.bytebuddy.implementation.FieldAccessor;
-import net.bytebuddy.implementation.MethodDelegation;
-import net.bytebuddy.implementation.SuperMethodCall;
-import net.bytebuddy.implementation.bind.annotation.Morph;
-import net.bytebuddy.matcher.ElementMatcher;
-import net.bytebuddy.matcher.ElementMatchers;
-
-import static net.bytebuddy.jar.asm.Opcodes.ACC_PRIVATE;
-import static net.bytebuddy.jar.asm.Opcodes.ACC_VOLATILE;
-import static net.bytebuddy.matcher.ElementMatchers.isStatic;
-import static net.bytebuddy.matcher.ElementMatchers.not;
-
-/**
- * This class controls all enhance operations, including enhance constructors, instance methods and static methods. All
- * the enhances base on three types interceptor point: {@link ConstructorInterceptV2Point}, {@link
- * InstanceMethodsInterceptV2Point} and {@link StaticMethodsInterceptV2Point} If plugin is going to enhance constructors,
- * instance methods, or both, {@link ClassEnhancePluginDefineV2} will add a field of {@link Object} type.
- */
-public abstract class ClassEnhancePluginDefineV2 extends AbstractClassEnhancePluginDefine {
-
- @Override
- protected DynamicType.Builder> enhanceClass(TypeDescription typeDescription,
- DynamicType.Builder> newClassBuilder,
- ClassLoader classLoader) throws PluginException {
- StaticMethodsInterceptV2Point[] staticMethodsInterceptV2Points = getStaticMethodsInterceptV2Points();
- String enhanceOriginClassName = typeDescription.getTypeName();
- if (staticMethodsInterceptV2Points == null || staticMethodsInterceptV2Points.length == 0) {
- return newClassBuilder;
- }
-
- for (StaticMethodsInterceptV2Point staticMethodsInterceptV2Point : staticMethodsInterceptV2Points) {
- String interceptor = staticMethodsInterceptV2Point.getMethodsInterceptorV2();
- if (StringUtil.isEmpty(interceptor)) {
- throw new EnhanceException(
- "no StaticMethodsAroundInterceptorV2 define to enhance class " + enhanceOriginClassName);
- }
-
- if (staticMethodsInterceptV2Point.isOverrideArgs()) {
- if (isBootstrapInstrumentation()) {
- newClassBuilder = newClassBuilder.method(
- isStatic().and(staticMethodsInterceptV2Point.getMethodsMatcher()))
- .intercept(MethodDelegation.withDefaultConfiguration()
- .withBinders(Morph.Binder.install(OverrideCallable.class))
- .to(BootstrapInstrumentBoost.forInternalDelegateClass(interceptor)));
- } else {
- newClassBuilder = newClassBuilder.method(
- isStatic().and(staticMethodsInterceptV2Point.getMethodsMatcher()))
- .intercept(MethodDelegation.withDefaultConfiguration()
- .withBinders(Morph.Binder.install(OverrideCallable.class))
- .to(new StaticMethodsInterV2WithOverrideArgs(interceptor)));
- }
- } else {
- if (isBootstrapInstrumentation()) {
- newClassBuilder = newClassBuilder.method(
- isStatic().and(staticMethodsInterceptV2Point.getMethodsMatcher()))
- .intercept(MethodDelegation.withDefaultConfiguration()
- .to(BootstrapInstrumentBoost.forInternalDelegateClass(interceptor)));
- } else {
- newClassBuilder = newClassBuilder.method(
- isStatic().and(staticMethodsInterceptV2Point.getMethodsMatcher()))
- .intercept(MethodDelegation.withDefaultConfiguration()
- .to(new StaticMethodsInterV2(interceptor)));
- }
- }
-
- }
-
- return newClassBuilder;
- }
-
- @Override
- protected DynamicType.Builder> enhanceInstance(TypeDescription typeDescription,
- DynamicType.Builder> newClassBuilder, ClassLoader classLoader,
- EnhanceContext context) throws PluginException {
- ConstructorInterceptPoint[] constructorInterceptPoints = getConstructorsInterceptPoints();
- InstanceMethodsInterceptV2Point[] instanceMethodsInterceptV2Points = getInstanceMethodsInterceptV2Points();
- String enhanceOriginClassName = typeDescription.getTypeName();
-
- boolean existedConstructorInterceptPoint = false;
- if (constructorInterceptPoints != null && constructorInterceptPoints.length > 0) {
- existedConstructorInterceptPoint = true;
- }
- boolean existedMethodsInterceptV2Points = false;
- if (instanceMethodsInterceptV2Points != null && instanceMethodsInterceptV2Points.length > 0) {
- existedMethodsInterceptV2Points = true;
- }
-
- if (!existedConstructorInterceptPoint && !existedMethodsInterceptV2Points) {
- return newClassBuilder;
- }
-
- if (!typeDescription.isAssignableTo(EnhancedInstance.class)) {
- if (!context.isObjectExtended()) {
- newClassBuilder = newClassBuilder.defineField(
- CONTEXT_ATTR_NAME, Object.class, ACC_PRIVATE | ACC_VOLATILE)
- .implement(EnhancedInstance.class)
- .intercept(FieldAccessor.ofField(CONTEXT_ATTR_NAME));
- context.extendObjectCompleted();
- }
- }
-
- if (existedConstructorInterceptPoint) {
- for (ConstructorInterceptPoint constructorInterceptPoint : constructorInterceptPoints) {
- if (isBootstrapInstrumentation()) {
- newClassBuilder = newClassBuilder.constructor(constructorInterceptPoint.getConstructorMatcher())
- .intercept(SuperMethodCall.INSTANCE.andThen(MethodDelegation.withDefaultConfiguration()
- .to(BootstrapInstrumentBoost
- .forInternalDelegateClass(constructorInterceptPoint
- .getConstructorInterceptor()))));
- } else {
- newClassBuilder = newClassBuilder.constructor(constructorInterceptPoint.getConstructorMatcher())
- .intercept(SuperMethodCall.INSTANCE.andThen(MethodDelegation.withDefaultConfiguration()
- .to(new ConstructorInter(constructorInterceptPoint
- .getConstructorInterceptor(), classLoader))));
- }
- }
- }
-
- if (existedMethodsInterceptV2Points) {
- for (InstanceMethodsInterceptV2Point instanceMethodsInterceptV2Point : instanceMethodsInterceptV2Points) {
- String interceptor = instanceMethodsInterceptV2Point.getMethodsInterceptorV2();
- if (StringUtil.isEmpty(interceptor)) {
- throw new EnhanceException(
- "no InstanceMethodsAroundInterceptorV2 define to enhance class " + enhanceOriginClassName);
- }
- ElementMatcher.Junction junction = not(isStatic()).and(
- instanceMethodsInterceptV2Point.getMethodsMatcher());
- if (instanceMethodsInterceptV2Point instanceof DeclaredInstanceMethodsInterceptV2Point) {
- junction = junction.and(ElementMatchers.isDeclaredBy(typeDescription));
- }
- if (instanceMethodsInterceptV2Point.isOverrideArgs()) {
- if (isBootstrapInstrumentation()) {
- newClassBuilder = newClassBuilder.method(junction)
- .intercept(MethodDelegation.withDefaultConfiguration()
- .withBinders(Morph.Binder.install(OverrideCallable.class))
- .to(BootstrapInstrumentBoost.forInternalDelegateClass(interceptor)));
- } else {
- newClassBuilder = newClassBuilder.method(junction)
- .intercept(MethodDelegation.withDefaultConfiguration()
- .withBinders(Morph.Binder.install(OverrideCallable.class))
- .to(new InstMethodsInterV2WithOverrideArgs(interceptor, classLoader)));
- }
- } else {
- if (isBootstrapInstrumentation()) {
- newClassBuilder = newClassBuilder.method(junction)
- .intercept(MethodDelegation.withDefaultConfiguration()
- .to(BootstrapInstrumentBoost.forInternalDelegateClass(interceptor)));
- } else {
- newClassBuilder = newClassBuilder.method(junction)
- .intercept(MethodDelegation.withDefaultConfiguration()
- .to(new InstMethodsInterV2(interceptor, classLoader)));
- }
- }
- }
- }
-
- return newClassBuilder;
- }
-
- @Override
- public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
- return null;
- }
-
- @Override
- public StaticMethodsInterceptPoint[] getStaticMethodsInterceptPoints() {
- return null;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/ClassInstanceMethodsEnhancePluginDefineV2.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/ClassInstanceMethodsEnhancePluginDefineV2.java
deleted file mode 100644
index 2f2c7300..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/ClassInstanceMethodsEnhancePluginDefineV2.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance.v2;
-
-import cn.hippo4j.agent.core.plugin.interceptor.v2.StaticMethodsInterceptV2Point;
-
-/**
- * Plugins, which only need enhance class instance methods. Actually, inherit from {@link
- * ClassInstanceMethodsEnhancePluginDefineV2} has no differences with inherit from {@link ClassEnhancePluginDefineV2}.
- * Just override {@link ClassEnhancePluginDefineV2#getStaticMethodsInterceptPoints}, and return NULL, which means nothing
- * to enhance.
- */
-public abstract class ClassInstanceMethodsEnhancePluginDefineV2 extends ClassEnhancePluginDefineV2 {
-
- /**
- * @return null, means enhance no v2 static methods.
- */
- @Override
- public StaticMethodsInterceptV2Point[] getStaticMethodsInterceptV2Points() {
- return null;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/ClassStaticMethodsEnhancePluginDefineV2.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/ClassStaticMethodsEnhancePluginDefineV2.java
deleted file mode 100644
index 294e70d8..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/ClassStaticMethodsEnhancePluginDefineV2.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance.v2;
-
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.v2.InstanceMethodsInterceptV2Point;
-
-/**
- * Plugins, which only need enhance class static methods. Actually, inherit from {@link
- * ClassStaticMethodsEnhancePluginDefineV2} has no differences with inherit from {@link ClassEnhancePluginDefineV2}. Just
- * override {@link ClassEnhancePluginDefineV2#getConstructorsInterceptPoints} and {@link
- * ClassEnhancePluginDefineV2#getInstanceMethodsInterceptV2Points}, and return NULL, which means nothing to enhance.
- */
-public abstract class ClassStaticMethodsEnhancePluginDefineV2 extends ClassEnhancePluginDefineV2 {
-
- /**
- * @return null, means enhance no constructors.
- */
- @Override
- public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
- return null;
- }
-
- /**
- * @return null, means enhance no v2 instance methods.
- */
- @Override
- public InstanceMethodsInterceptV2Point[] getInstanceMethodsInterceptV2Points() {
- return null;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/InstMethodsInterV2.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/InstMethodsInterV2.java
deleted file mode 100644
index eea316d0..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/InstMethodsInterV2.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance.v2;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.agent.core.plugin.PluginException;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.loader.InterceptorInstanceLoader;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.SuperCall;
-import net.bytebuddy.implementation.bind.annotation.This;
-
-import java.lang.reflect.Method;
-import java.util.concurrent.Callable;
-
-/**
- * The actual byte-buddy's interceptor to intercept class instance methods. In this class, it provides a bridge between
- * byte-buddy and sky-walking plugin.
- */
-public class InstMethodsInterV2 {
-
- private static final ILog LOGGER = LogManager.getLogger(InstMethodsInterV2.class);
-
- private InstanceMethodsAroundInterceptorV2 interceptor;
-
- public InstMethodsInterV2(String instanceMethodsAroundInterceptorClassName, ClassLoader classLoader) {
- try {
- interceptor = InterceptorInstanceLoader.load(instanceMethodsAroundInterceptorClassName, classLoader);
- } catch (Throwable t) {
- throw new PluginException("Can't create InstanceMethodsAroundInterceptor.", t);
- }
- }
-
- @RuntimeType
- public Object intercept(@This Object obj, @AllArguments Object[] allArguments, @SuperCall Callable> zuper,
- @Origin Method method) throws Throwable {
- EnhancedInstance targetObject = (EnhancedInstance) obj;
-
- MethodInvocationContext context = new MethodInvocationContext();
- try {
- interceptor.beforeMethod(targetObject, method, allArguments, method.getParameterTypes(), context);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] before method[{}] intercept failure", obj.getClass(), method.getName());
- }
-
- Object ret = null;
- try {
- if (!context.isContinue()) {
- ret = context._ret();
- } else {
- ret = zuper.call();
- }
- } catch (Throwable t) {
- try {
- interceptor.handleMethodException(targetObject, method, allArguments, method.getParameterTypes(), t, context);
- } catch (Throwable t2) {
- LOGGER.error(t2, "class[{}] handle method[{}] exception failure", obj.getClass(), method.getName());
- }
- throw t;
- } finally {
- try {
- ret = interceptor.afterMethod(targetObject, method, allArguments, method.getParameterTypes(), ret, context);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] after method[{}] intercept failure", obj.getClass(), method.getName());
- }
- }
- return ret;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/InstMethodsInterV2WithOverrideArgs.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/InstMethodsInterV2WithOverrideArgs.java
deleted file mode 100644
index 9aaa9888..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/InstMethodsInterV2WithOverrideArgs.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance.v2;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.agent.core.plugin.PluginException;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.OverrideCallable;
-import cn.hippo4j.agent.core.plugin.loader.InterceptorInstanceLoader;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Morph;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.This;
-
-import java.lang.reflect.Method;
-
-/**
- * The actual byte-buddy's interceptor to intercept class instance methods. In this class, it provides a bridge between
- * byte-buddy and sky-walking plugin.
- */
-public class InstMethodsInterV2WithOverrideArgs {
-
- private static final ILog LOGGER = LogManager.getLogger(InstMethodsInterV2WithOverrideArgs.class);
-
- /**
- * An {@link InstanceMethodsAroundInterceptorV2} This name should only stay in {@link String}, the real {@link Class}
- * type will trigger classloader failure. If you want to know more, please check on books about Classloader or
- * Classloader appointment mechanism.
- */
- private InstanceMethodsAroundInterceptorV2 interceptor;
-
- /**
- * @param instanceMethodsAroundInterceptorClassName class full name.
- */
- public InstMethodsInterV2WithOverrideArgs(String instanceMethodsAroundInterceptorClassName, ClassLoader classLoader) {
- try {
- interceptor = InterceptorInstanceLoader.load(instanceMethodsAroundInterceptorClassName, classLoader);
- } catch (Throwable t) {
- throw new PluginException("Can't create InstanceMethodsAroundInterceptor.", t);
- }
- }
-
- /**
- * Intercept the target instance method.
- *
- * @param obj target class instance.
- * @param allArguments all method arguments
- * @param method method description.
- * @param zuper the origin call ref.
- * @return the return value of target instance method.
- * @throws Exception only throw exception because of zuper.call() or unexpected exception in sky-walking ( This is a
- * bug, if anything triggers this condition ).
- */
- @RuntimeType
- public Object intercept(@This Object obj, @AllArguments Object[] allArguments, @Origin Method method,
- @Morph OverrideCallable zuper) throws Throwable {
- EnhancedInstance targetObject = (EnhancedInstance) obj;
-
- MethodInvocationContext context = new MethodInvocationContext();
- try {
- interceptor.beforeMethod(targetObject, method, allArguments, method.getParameterTypes(), context);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] before method[{}] intercept failure", obj.getClass(), method.getName());
- }
-
- Object ret = null;
- try {
- if (!context.isContinue()) {
- ret = context._ret();
- } else {
- ret = zuper.call(allArguments);
- }
- } catch (Throwable t) {
- try {
- interceptor.handleMethodException(targetObject, method, allArguments, method.getParameterTypes(), t, context);
- } catch (Throwable t2) {
- LOGGER.error(t2, "class[{}] handle method[{}] exception failure", obj.getClass(), method.getName());
- }
- throw t;
- } finally {
- try {
- ret = interceptor.afterMethod(targetObject, method, allArguments, method.getParameterTypes(), ret, context);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] after method[{}] intercept failure", obj.getClass(), method.getName());
- }
- }
- return ret;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/InstanceMethodsAroundInterceptorV2.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/InstanceMethodsAroundInterceptorV2.java
deleted file mode 100644
index b732300f..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/InstanceMethodsAroundInterceptorV2.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance.v2;
-
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-
-import java.lang.reflect.Method;
-
-/**
- * A v2 interceptor, which intercept method's invocation. The target methods will be defined in {@link
- * ClassEnhancePluginDefineV2}'s subclass, most likely in {@link ClassInstanceMethodsEnhancePluginDefine}
- */
-public interface InstanceMethodsAroundInterceptorV2 {
-
- /**
- * called before target method invocation.
- *
- * @param context the method invocation context including result context.
- */
- void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes,
- MethodInvocationContext context) throws Throwable;
-
- /**
- * called after target method invocation. Even method's invocation triggers an exception.
- *
- * @param ret the method's original return value. May be null if the method triggers an exception.
- * @return the method's actual return value.
- */
- Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes,
- Object ret, MethodInvocationContext context) throws Throwable;
-
- /**
- * called when occur exception.
- *
- * @param t the exception occur.
- */
- void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
- Class>[] argumentsTypes, Throwable t, MethodInvocationContext context);
-
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/MethodInvocationContext.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/MethodInvocationContext.java
deleted file mode 100644
index a6647aa8..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/MethodInvocationContext.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance.v2;
-
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * MethodInvocationContext holds the reference to propagate it between beforeMethod and afterMethod/handleMethodException
- */
-@Setter
-@Getter
-public class MethodInvocationContext extends MethodInterceptResult {
-
- /**
- * A pointer for the propagating context
- */
- private Object context;
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/StaticMethodsAroundInterceptorV2.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/StaticMethodsAroundInterceptorV2.java
deleted file mode 100644
index 55685f07..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/StaticMethodsAroundInterceptorV2.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance.v2;
-
-import java.lang.reflect.Method;
-
-/**
- * The static method's interceptor v2 interface. Any plugin, which wants to intercept static methods, must implement this
- * interface.
- */
-public interface StaticMethodsAroundInterceptorV2 {
-
- /**
- * called before target method invocation.
- *
- * @param context the method invocation context including result context.
- */
- void beforeMethod(Class clazz, Method method, Object[] allArguments, Class>[] parameterTypes,
- MethodInvocationContext context);
-
- /**
- * called after target method invocation. Even method's invocation triggers an exception.
- *
- * @param ret the method's original return value.
- * @return the method's actual return value.
- */
- Object afterMethod(Class clazz, Method method, Object[] allArguments, Class>[] parameterTypes, Object ret,
- MethodInvocationContext context);
-
- /**
- * called when occur exception.
- *
- * @param t the exception occur.
- */
- void handleMethodException(Class clazz, Method method, Object[] allArguments, Class>[] parameterTypes,
- Throwable t, MethodInvocationContext context);
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/StaticMethodsInterV2.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/StaticMethodsInterV2.java
deleted file mode 100644
index 7bd4c2f1..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/StaticMethodsInterV2.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance.v2;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.agent.core.plugin.loader.InterceptorInstanceLoader;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-import net.bytebuddy.implementation.bind.annotation.SuperCall;
-
-import java.lang.reflect.Method;
-import java.util.concurrent.Callable;
-
-/**
- * The actual byte-buddy's interceptor to intercept class instance methods. In this class, it provides a bridge between
- * byte-buddy and sky-walking plugin.
- */
-public class StaticMethodsInterV2 {
-
- private static final ILog LOGGER = LogManager.getLogger(StaticMethodsInterV2.class);
-
- /**
- * A class full name, and instanceof {@link StaticMethodsAroundInterceptorV2} This name should only stay in {@link
- * String}, the real {@link Class} type will trigger classloader failure. If you want to know more, please check on
- * books about Classloader or Classloader appointment mechanism.
- */
- private String staticMethodsAroundInterceptorClassName;
-
- /**
- * Set the name of {@link StaticMethodsInterV2#staticMethodsAroundInterceptorClassName}
- *
- * @param staticMethodsAroundInterceptorClassName class full name.
- */
- public StaticMethodsInterV2(String staticMethodsAroundInterceptorClassName) {
- this.staticMethodsAroundInterceptorClassName = staticMethodsAroundInterceptorClassName;
- }
-
- /**
- * Intercept the target static method.
- *
- * @param clazz target class
- * @param allArguments all method arguments
- * @param method method description.
- * @param zuper the origin call ref.
- * @return the return value of target static method.
- * @throws Exception only throw exception because of zuper.call() or unexpected exception in sky-walking ( This is a
- * bug, if anything triggers this condition ).
- */
- @RuntimeType
- public Object intercept(@Origin Class> clazz, @AllArguments Object[] allArguments, @Origin Method method,
- @SuperCall Callable> zuper) throws Throwable {
- StaticMethodsAroundInterceptorV2 interceptor = InterceptorInstanceLoader.load(staticMethodsAroundInterceptorClassName,
- clazz.getClassLoader());
-
- MethodInvocationContext context = new MethodInvocationContext();
- try {
- interceptor.beforeMethod(clazz, method, allArguments, method.getParameterTypes(), context);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] before static method[{}] intercept failure", clazz, method.getName());
- }
-
- Object ret = null;
- try {
- if (!context.isContinue()) {
- ret = context._ret();
- } else {
- ret = zuper.call();
- }
- } catch (Throwable t) {
- try {
- interceptor.handleMethodException(clazz, method, allArguments, method.getParameterTypes(), t, context);
- } catch (Throwable t2) {
- LOGGER.error(t2, "class[{}] handle static method[{}] exception failure", clazz, method.getName(), t2.getMessage());
- }
- throw t;
- } finally {
- try {
- ret = interceptor.afterMethod(clazz, method, allArguments, method.getParameterTypes(), ret, context);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] after static method[{}] intercept failure:{}", clazz, method.getName(), t.getMessage());
- }
- }
- return ret;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/StaticMethodsInterV2WithOverrideArgs.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/StaticMethodsInterV2WithOverrideArgs.java
deleted file mode 100644
index ca86bf2e..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/enhance/v2/StaticMethodsInterV2WithOverrideArgs.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.enhance.v2;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.OverrideCallable;
-import cn.hippo4j.agent.core.plugin.loader.InterceptorInstanceLoader;
-import net.bytebuddy.implementation.bind.annotation.AllArguments;
-import net.bytebuddy.implementation.bind.annotation.Morph;
-import net.bytebuddy.implementation.bind.annotation.Origin;
-import net.bytebuddy.implementation.bind.annotation.RuntimeType;
-
-import java.lang.reflect.Method;
-
-/**
- * The actual byte-buddy's interceptor to intercept class instance methods. In this class, it provides a bridge between
- * byte-buddy and sky-walking plugin.
- */
-public class StaticMethodsInterV2WithOverrideArgs {
-
- private static final ILog LOGGER = LogManager.getLogger(StaticMethodsInterV2WithOverrideArgs.class);
-
- /**
- * A class full name, and instanceof {@link StaticMethodsAroundInterceptorV2} This name should only stay in {@link
- * String}, the real {@link Class} type will trigger classloader failure. If you want to know more, please check on
- * books about Classloader or Classloader appointment mechanism.
- */
- private String staticMethodsAroundInterceptorClassName;
-
- /**
- * Set the name of {@link StaticMethodsInterV2WithOverrideArgs#staticMethodsAroundInterceptorClassName}
- *
- * @param staticMethodsAroundInterceptorClassName class full name.
- */
- public StaticMethodsInterV2WithOverrideArgs(String staticMethodsAroundInterceptorClassName) {
- this.staticMethodsAroundInterceptorClassName = staticMethodsAroundInterceptorClassName;
- }
-
- /**
- * Intercept the target static method.
- *
- * @param clazz target class
- * @param allArguments all method arguments
- * @param method method description.
- * @param zuper the origin call ref.
- * @return the return value of target static method.
- * @throws Exception only throw exception because of zuper.call() or unexpected exception in sky-walking ( This is a
- * bug, if anything triggers this condition ).
- */
- @RuntimeType
- public Object intercept(@Origin Class> clazz, @AllArguments Object[] allArguments, @Origin Method method,
- @Morph OverrideCallable zuper) throws Throwable {
- StaticMethodsAroundInterceptorV2 interceptor = InterceptorInstanceLoader.load(staticMethodsAroundInterceptorClassName,
- clazz.getClassLoader());
-
- MethodInvocationContext context = new MethodInvocationContext();
- try {
- interceptor.beforeMethod(clazz, method, allArguments, method.getParameterTypes(), context);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] before static method[{}] intercept failure", clazz, method.getName());
- }
-
- Object ret = null;
- try {
- if (!context.isContinue()) {
- ret = context._ret();
- } else {
- ret = zuper.call(allArguments);
- }
- } catch (Throwable t) {
- try {
- interceptor.handleMethodException(clazz, method, allArguments, method.getParameterTypes(), t, context);
- } catch (Throwable t2) {
- LOGGER.error(t2, "class[{}] handle static method[{}] exception failure", clazz, method.getName(), t2.getMessage());
- }
- throw t;
- } finally {
- try {
- ret = interceptor.afterMethod(clazz, method, allArguments, method.getParameterTypes(), ret, context);
- } catch (Throwable t) {
- LOGGER.error(t, "class[{}] after static method[{}] intercept failure:{}", clazz, method.getName(), t.getMessage());
- }
- }
- return ret;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/v2/ConstructorInterceptV2Point.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/v2/ConstructorInterceptV2Point.java
deleted file mode 100644
index e073e7c1..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/v2/ConstructorInterceptV2Point.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.v2;
-
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-public interface ConstructorInterceptV2Point {
-
- /**
- * Constructor matcher
- *
- * @return matcher instance.
- */
- ElementMatcher getConstructorMatcher();
-
- /**
- * @return represents a class name, the class instance must be a instance of {@link
- * cn.hippo4j.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor}
- */
- String getConstructorInterceptorV2();
-
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/v2/DeclaredInstanceMethodsInterceptV2Point.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/v2/DeclaredInstanceMethodsInterceptV2Point.java
deleted file mode 100644
index 02754d87..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/v2/DeclaredInstanceMethodsInterceptV2Point.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.v2;
-
-/**
- * this interface for those who only want to enhance declared method in case of some unexpected issue, such as spring
- * controller
- */
-public interface DeclaredInstanceMethodsInterceptV2Point extends InstanceMethodsInterceptV2Point {
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/v2/InstanceMethodsInterceptV2Point.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/v2/InstanceMethodsInterceptV2Point.java
deleted file mode 100644
index 6d4844cb..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/v2/InstanceMethodsInterceptV2Point.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.v2;
-
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-/**
- * One of the three "Intercept Point". "Intercept Point" is a definition about where and how intercept happens. In this
- * "Intercept Point", the definition targets class's instance methods, and the interceptor.
- *
- * ref to two others: {@link ConstructorInterceptPoint} and {@link StaticMethodsInterceptV2Point}
- *
- */
-public interface InstanceMethodsInterceptV2Point {
-
- /**
- * class instance methods matcher.
- *
- * @return methods matcher
- */
- ElementMatcher getMethodsMatcher();
-
- /**
- * @return represents a class name, the class instance must instanceof InstanceMethodsAroundInterceptorV2.
- */
- String getMethodsInterceptorV2();
-
- boolean isOverrideArgs();
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/v2/StaticMethodsInterceptV2Point.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/v2/StaticMethodsInterceptV2Point.java
deleted file mode 100644
index aa6e5d56..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/interceptor/v2/StaticMethodsInterceptV2Point.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.interceptor.v2;
-
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-/**
- * One of the three "Intercept Point". "Intercept Point" is a definition about where and how intercept happens. In this
- * "Intercept Point", the definition targets class's static methods, and the interceptor.
- *
- * ref to two others: {@link ConstructorInterceptPoint} and {@link InstanceMethodsInterceptV2Point}
- *
- */
-public interface StaticMethodsInterceptV2Point {
-
- /**
- * static methods matcher.
- *
- * @return matcher instance.
- */
- ElementMatcher getMethodsMatcher();
-
- /**
- * @return represents a class name, the class instance must instanceof StaticMethodsAroundInterceptorV2.
- */
- String getMethodsInterceptorV2();
-
- boolean isOverrideArgs();
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/jdk9module/JDK9ModuleExporter.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/jdk9module/JDK9ModuleExporter.java
deleted file mode 100644
index 07c69b54..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/jdk9module/JDK9ModuleExporter.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.jdk9module;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.agent.core.plugin.ByteBuddyCoreClasses;
-import net.bytebuddy.agent.builder.AgentBuilder;
-
-import java.lang.instrument.Instrumentation;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Since JDK 9, module concept has been introduced. By supporting that, agent core needs to open the read edge
- */
-public class JDK9ModuleExporter {
-
- private static final ILog LOGGER = LogManager.getLogger(JDK9ModuleExporter.class);
-
- private static final String[] HIGH_PRIORITY_CLASSES = {
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance",
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.MethodInterceptResult",
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.OverrideCallable",
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.ConstructorInter",
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.InstMethodsInter",
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.InstMethodsInterWithOverrideArgs",
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.StaticMethodsInter",
- "cn.hippo4j.agent.core.plugin.interceptor.enhance.StaticMethodsInterWithOverrideArgs",
- };
-
- /**
- * Assures that all modules of the supplied types are read by the module of any instrumented type. JDK Module system
- * was introduced since JDK9.
- *
- * The following codes work only JDK Module system exist.
- */
- public static AgentBuilder openReadEdge(Instrumentation instrumentation, AgentBuilder agentBuilder,
- EdgeClasses classes) {
- for (String className : classes.classes) {
- try {
- agentBuilder = agentBuilder.assureReadEdgeFromAndTo(instrumentation, Class.forName(className));
- } catch (ClassNotFoundException e) {
- throw new UnsupportedOperationException("Fail to open read edge for class " + className + " to public access in JDK9+", e);
- }
- }
- for (String className : HIGH_PRIORITY_CLASSES) {
- try {
- agentBuilder = agentBuilder.assureReadEdgeFromAndTo(instrumentation, Class.forName(className));
- } catch (ClassNotFoundException e) {
- throw new UnsupportedOperationException("Fail to open read edge for class " + className + " to public access in JDK9+", e);
- }
- }
-
- return agentBuilder;
- }
-
- public static class EdgeClasses {
-
- private List classes = new ArrayList();
-
- public EdgeClasses() {
- for (String className : ByteBuddyCoreClasses.CLASSES) {
- add(className);
- }
- }
-
- public void add(String className) {
- if (!classes.contains(className)) {
- classes.add(className);
- }
- }
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/loader/AgentClassLoader.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/loader/AgentClassLoader.java
deleted file mode 100644
index d227ec7e..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/loader/AgentClassLoader.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.loader;
-
-import cn.hippo4j.agent.core.boot.AgentPackagePath;
-import cn.hippo4j.agent.core.boot.PluginConfig;
-import cn.hippo4j.agent.core.boot.SpringBootConfigInitializer;
-import cn.hippo4j.agent.core.boot.SpringBootConfigNode;
-import cn.hippo4j.agent.core.conf.SnifferConfigInitializer;
-import cn.hippo4j.agent.core.plugin.PluginBootstrap;
-import cn.hippo4j.common.boot.AgentPackageNotFoundException;
-import cn.hippo4j.common.conf.Config;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import lombok.RequiredArgsConstructor;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.concurrent.locks.ReentrantLock;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-/**
- * The AgentClassLoader represents a classloader, which is in charge of finding plugins and interceptors.
- */
-public class AgentClassLoader extends ClassLoader {
-
- static {
- /*
- * Try to solve the classloader dead lock. See https://github.com/apache/skywalking/pull/2016
- */
- registerAsParallelCapable();
- }
-
- private static final ILog LOGGER = LogManager.getLogger(AgentClassLoader.class);
- /**
- * The default class loader for the agent.
- */
- private static AgentClassLoader DEFAULT_LOADER;
-
- private List classpath;
- private static List allJars;
- private ReentrantLock jarScanLock = new ReentrantLock();
-
- public static AgentClassLoader getDefault() {
- return DEFAULT_LOADER;
- }
-
- /**
- * Init the default class loader.
- *
- * @throws AgentPackageNotFoundException if agent package is not found.
- */
- public static void initDefaultLoader() throws AgentPackageNotFoundException {
- if (DEFAULT_LOADER == null) {
- synchronized (AgentClassLoader.class) {
- if (DEFAULT_LOADER == null) {
- DEFAULT_LOADER = new AgentClassLoader(PluginBootstrap.class.getClassLoader());
- }
- }
- }
- }
-
- public AgentClassLoader(ClassLoader parent) throws AgentPackageNotFoundException {
- super(parent);
- File agentDictionary = AgentPackagePath.getPath();
- classpath = new LinkedList<>();
- Config.Plugin.MOUNT.forEach(mountFolder -> classpath.add(new File(agentDictionary, mountFolder)));
- }
-
- @Override
- protected Class> findClass(String name) throws ClassNotFoundException {
- List allJars = getAllJars();
- String path = name.replace('.', '/').concat(".class");
- for (Jar jar : allJars) {
- JarEntry entry = jar.jarFile.getJarEntry(path);
- if (entry == null) {
- continue;
- }
- try {
- URL classFileUrl = new URL("jar:file:" + jar.sourceFile.getAbsolutePath() + "!/" + path);
- byte[] data;
- try (
- final BufferedInputStream is = new BufferedInputStream(
- classFileUrl.openStream());
- final ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
- int ch;
- while ((ch = is.read()) != -1) {
- baos.write(ch);
- }
- data = baos.toByteArray();
- }
- return processLoadedClass(defineClass(name, data, 0, data.length));
- } catch (IOException e) {
- LOGGER.error(e, "find class fail.");
- }
- }
- throw new ClassNotFoundException("Can't find " + name);
- }
-
- @Override
- protected URL findResource(String name) {
- List allJars = getAllJars();
- for (Jar jar : allJars) {
- JarEntry entry = jar.jarFile.getJarEntry(name);
- if (entry != null) {
- try {
- return new URL("jar:file:" + jar.sourceFile.getAbsolutePath() + "!/" + name);
- } catch (MalformedURLException ignored) {
- }
- }
- }
- return null;
- }
-
- @Override
- protected Enumeration findResources(String name) throws IOException {
- List allResources = new LinkedList<>();
- List allJars = getAllJars();
- for (Jar jar : allJars) {
- JarEntry entry = jar.jarFile.getJarEntry(name);
- if (entry != null) {
- allResources.add(new URL("jar:file:" + jar.sourceFile.getAbsolutePath() + "!/" + name));
- }
- }
-
- final Iterator iterator = allResources.iterator();
- return new Enumeration() {
-
- @Override
- public boolean hasMoreElements() {
- return iterator.hasNext();
- }
-
- @Override
- public URL nextElement() {
- return iterator.next();
- }
- };
- }
-
- private Class> processLoadedClass(Class> loadedClass) {
- final PluginConfig pluginConfig = loadedClass.getAnnotation(PluginConfig.class);
- if (pluginConfig != null) {
- // Set up the plugin config when loaded by class loader at the first time.
- // Agent class loader just loaded limited classes in the plugin jar(s), so the cost of this
- // isAssignableFrom would be also very limited.
- SnifferConfigInitializer.initializeConfig(pluginConfig.root());
- }
-
- final SpringBootConfigNode springBootConfig = loadedClass.getAnnotation(SpringBootConfigNode.class);
- if (springBootConfig != null) {
- // Set up the plugin config when loaded by spring environment is prepared, just scan in here.
- // Agent class loader just loaded limited classes in the plugin jar(s), so the cost of this
- // isAssignableFrom would be also very limited.
- SpringBootConfigInitializer.initializeConfig(springBootConfig);
- }
- return loadedClass;
- }
-
- private List getAllJars() {
- if (allJars == null) {
- jarScanLock.lock();
- try {
- if (allJars == null) {
- allJars = doGetJars();
- }
- } finally {
- jarScanLock.unlock();
- }
- }
- return allJars;
- }
-
- private LinkedList doGetJars() {
- LinkedList jars = new LinkedList<>();
- for (File path : classpath) {
- if (path.exists() && path.isDirectory()) {
- String[] jarFileNames = path.list((dir, name) -> name.endsWith(".jar"));
- for (String fileName : jarFileNames) {
- try {
- File file = new File(path, fileName);
- Jar jar = new Jar(new JarFile(file), file);
- jars.add(jar);
- LOGGER.info("{} loaded.", file.toString());
- } catch (IOException e) {
- LOGGER.error(e, "{} jar file can't be resolved", fileName);
- }
- }
- }
- }
- return jars;
- }
-
- @RequiredArgsConstructor
- private static class Jar {
-
- private final JarFile jarFile;
- private final File sourceFile;
- }
-}
\ No newline at end of file
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/loader/InstrumentationLoader.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/loader/InstrumentationLoader.java
deleted file mode 100755
index 9fa470b4..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/loader/InstrumentationLoader.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.loader;
-
-import cn.hippo4j.agent.core.plugin.AbstractClassEnhancePluginDefine;
-
-import java.util.List;
-
-/**
- * the spi of the InstrumentationLoader.
- */
-
-public interface InstrumentationLoader {
-
- List load(AgentClassLoader classLoader);
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/loader/InterceptorInstanceLoader.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/loader/InterceptorInstanceLoader.java
deleted file mode 100644
index e5c55ad4..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/loader/InterceptorInstanceLoader.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.loader;
-
-import cn.hippo4j.common.boot.AgentPackageNotFoundException;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.locks.ReentrantLock;
-
-/**
- * The InterceptorInstanceLoader is a classes finder and container.
- *
- * This is a very important class in sky-walking's auto-instrumentation mechanism. If you want to fully understand why
- * need this, and how it works, you need have knowledge about Classloader appointment mechanism.
- *
- */
-public class InterceptorInstanceLoader {
-
- private static ConcurrentHashMap INSTANCE_CACHE = new ConcurrentHashMap();
- private static ReentrantLock INSTANCE_LOAD_LOCK = new ReentrantLock();
- private static Map EXTEND_PLUGIN_CLASSLOADERS = new HashMap();
-
- /**
- * Load an instance of interceptor, and keep it singleton. Create {@link AgentClassLoader} for each
- * targetClassLoader, as an extend classloader. It can load interceptor classes from plugins, activations folders.
- *
- * @param className the interceptor class, which is expected to be found
- * @param targetClassLoader the class loader for current application context
- * @param expected type
- * @return the type reference.
- */
- public static T load(String className,
- ClassLoader targetClassLoader) throws IllegalAccessException, InstantiationException, ClassNotFoundException, AgentPackageNotFoundException {
- if (targetClassLoader == null) {
- targetClassLoader = InterceptorInstanceLoader.class.getClassLoader();
- }
- String instanceKey = className + "_OF_" + targetClassLoader.getClass()
- .getName() + "@"
- + Integer.toHexString(targetClassLoader
- .hashCode());
- Object inst = INSTANCE_CACHE.get(instanceKey);
- if (inst == null) {
- INSTANCE_LOAD_LOCK.lock();
- ClassLoader pluginLoader;
- try {
- pluginLoader = EXTEND_PLUGIN_CLASSLOADERS.get(targetClassLoader);
- if (pluginLoader == null) {
- pluginLoader = new AgentClassLoader(targetClassLoader);
- EXTEND_PLUGIN_CLASSLOADERS.put(targetClassLoader, pluginLoader);
- }
- } finally {
- INSTANCE_LOAD_LOCK.unlock();
- }
- inst = Class.forName(className, true, pluginLoader).newInstance();
- if (inst != null) {
- INSTANCE_CACHE.put(instanceKey, inst);
- }
- }
-
- return (T) inst;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/ClassAnnotationMatch.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/ClassAnnotationMatch.java
deleted file mode 100644
index ab181816..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/ClassAnnotationMatch.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.match;
-
-import net.bytebuddy.description.annotation.AnnotationDescription;
-import net.bytebuddy.description.annotation.AnnotationList;
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import static net.bytebuddy.matcher.ElementMatchers.isAnnotatedWith;
-import static net.bytebuddy.matcher.ElementMatchers.isInterface;
-import static net.bytebuddy.matcher.ElementMatchers.named;
-import static net.bytebuddy.matcher.ElementMatchers.not;
-
-/**
- * Match the class by the given annotations in class.
- */
-public class ClassAnnotationMatch implements IndirectMatch {
-
- private String[] annotations;
-
- private ClassAnnotationMatch(String[] annotations) {
- if (annotations == null || annotations.length == 0) {
- throw new IllegalArgumentException("annotations is null");
- }
- this.annotations = annotations;
- }
-
- @Override
- public ElementMatcher.Junction buildJunction() {
- ElementMatcher.Junction junction = null;
- for (String annotation : annotations) {
- if (junction == null) {
- junction = buildEachAnnotation(annotation);
- } else {
- junction = junction.and(buildEachAnnotation(annotation));
- }
- }
- junction = junction.and(not(isInterface()));
- return junction;
- }
-
- @Override
- public boolean isMatch(TypeDescription typeDescription) {
- List annotationList = new ArrayList(Arrays.asList(annotations));
- AnnotationList declaredAnnotations = typeDescription.getDeclaredAnnotations();
- for (AnnotationDescription annotation : declaredAnnotations) {
- annotationList.remove(annotation.getAnnotationType().getActualName());
- }
- return annotationList.isEmpty();
- }
-
- private ElementMatcher.Junction buildEachAnnotation(String annotationName) {
- return isAnnotatedWith(named(annotationName));
- }
-
- public static ClassAnnotationMatch byClassAnnotationMatch(String... annotations) {
- return new ClassAnnotationMatch(annotations);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/ClassMatch.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/ClassMatch.java
deleted file mode 100644
index 750bcf63..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/ClassMatch.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.match;
-
-public interface ClassMatch {
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/HierarchyMatch.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/HierarchyMatch.java
deleted file mode 100644
index 759f38ba..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/HierarchyMatch.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.match;
-
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.description.type.TypeList;
-import net.bytebuddy.matcher.ElementMatcher;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import static net.bytebuddy.matcher.ElementMatchers.hasSuperType;
-import static net.bytebuddy.matcher.ElementMatchers.isInterface;
-import static net.bytebuddy.matcher.ElementMatchers.named;
-import static net.bytebuddy.matcher.ElementMatchers.not;
-
-/**
- * Match the class by the given super class or interfaces.
- */
-public class HierarchyMatch implements IndirectMatch {
-
- private String[] parentTypes;
-
- private HierarchyMatch(String[] parentTypes) {
- if (parentTypes == null || parentTypes.length == 0) {
- throw new IllegalArgumentException("parentTypes is null");
- }
- this.parentTypes = parentTypes;
- }
-
- @Override
- public ElementMatcher.Junction buildJunction() {
- ElementMatcher.Junction junction = null;
- for (String superTypeName : parentTypes) {
- if (junction == null) {
- junction = buildSuperClassMatcher(superTypeName);
- } else {
- junction = junction.and(buildSuperClassMatcher(superTypeName));
- }
- }
- junction = junction.and(not(isInterface()));
- return junction;
- }
-
- private ElementMatcher.Junction buildSuperClassMatcher(String superTypeName) {
- return hasSuperType(named(superTypeName));
- }
-
- @Override
- public boolean isMatch(TypeDescription typeDescription) {
- List parentTypes = new ArrayList(Arrays.asList(this.parentTypes));
-
- TypeList.Generic implInterfaces = typeDescription.getInterfaces();
- for (TypeDescription.Generic implInterface : implInterfaces) {
- matchHierarchyClass(implInterface, parentTypes);
- }
-
- if (typeDescription.getSuperClass() != null) {
- matchHierarchyClass(typeDescription.getSuperClass(), parentTypes);
- }
-
- return parentTypes.size() == 0;
-
- }
-
- private void matchHierarchyClass(TypeDescription.Generic clazz, List parentTypes) {
- parentTypes.remove(clazz.asRawType().getTypeName());
- if (parentTypes.size() == 0) {
- return;
- }
-
- for (TypeDescription.Generic generic : clazz.getInterfaces()) {
- matchHierarchyClass(generic, parentTypes);
- }
-
- TypeDescription.Generic superClazz = clazz.getSuperClass();
- if (superClazz != null && !clazz.getTypeName().equals("java.lang.Object")) {
- matchHierarchyClass(superClazz, parentTypes);
- }
-
- }
-
- public static IndirectMatch byHierarchyMatch(String... parentTypes) {
- return new HierarchyMatch(parentTypes);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/IndirectMatch.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/IndirectMatch.java
deleted file mode 100644
index a400fdfc..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/IndirectMatch.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.match;
-
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-/**
- * All implementations can't direct match the class like {@link NameMatch} did.
- */
-public interface IndirectMatch extends ClassMatch {
-
- ElementMatcher.Junction buildJunction();
-
- boolean isMatch(TypeDescription typeDescription);
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/MethodAnnotationMatch.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/MethodAnnotationMatch.java
deleted file mode 100644
index 71c79747..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/MethodAnnotationMatch.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.match;
-
-import net.bytebuddy.description.annotation.AnnotationDescription;
-import net.bytebuddy.description.annotation.AnnotationList;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-import net.bytebuddy.matcher.ElementMatchers;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import static net.bytebuddy.matcher.ElementMatchers.declaresMethod;
-import static net.bytebuddy.matcher.ElementMatchers.isAnnotatedWith;
-import static net.bytebuddy.matcher.ElementMatchers.isInterface;
-import static net.bytebuddy.matcher.ElementMatchers.named;
-
-/**
- * Match the class, which has methods with the certain annotations. This is a very complex match.
- */
-public class MethodAnnotationMatch implements IndirectMatch {
-
- private String[] annotations;
-
- private MethodAnnotationMatch(String[] annotations) {
- if (annotations == null || annotations.length == 0) {
- throw new IllegalArgumentException("annotations is null");
- }
- this.annotations = annotations;
- }
-
- @Override
- public ElementMatcher.Junction buildJunction() {
- ElementMatcher.Junction junction = null;
- for (String annotation : annotations) {
- if (junction == null) {
- junction = buildEachAnnotation(annotation);
- } else {
- junction = junction.and(buildEachAnnotation(annotation));
- }
- }
- junction = declaresMethod(junction).and(ElementMatchers.not(isInterface()));
- return junction;
- }
-
- @Override
- public boolean isMatch(TypeDescription typeDescription) {
- for (MethodDescription.InDefinedShape methodDescription : typeDescription.getDeclaredMethods()) {
- List annotationList = new ArrayList(Arrays.asList(annotations));
-
- AnnotationList declaredAnnotations = methodDescription.getDeclaredAnnotations();
- for (AnnotationDescription annotation : declaredAnnotations) {
- annotationList.remove(annotation.getAnnotationType().getActualName());
- }
- if (annotationList.isEmpty()) {
- return true;
- }
- }
-
- return false;
- }
-
- private ElementMatcher.Junction buildEachAnnotation(String annotationName) {
- return isAnnotatedWith(named(annotationName));
- }
-
- public static IndirectMatch byMethodAnnotationMatch(String... annotations) {
- return new MethodAnnotationMatch(annotations);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/MethodInheritanceAnnotationMatcher.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/MethodInheritanceAnnotationMatcher.java
deleted file mode 100644
index 94fd02ae..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/MethodInheritanceAnnotationMatcher.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.match;
-
-import net.bytebuddy.build.HashCodeAndEqualsPlugin;
-import net.bytebuddy.description.annotation.AnnotationList;
-import net.bytebuddy.description.annotation.AnnotationSource;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.description.method.MethodList;
-import net.bytebuddy.description.method.ParameterList;
-import net.bytebuddy.description.type.TypeDefinition;
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.description.type.TypeList;
-import net.bytebuddy.matcher.CollectionItemMatcher;
-import net.bytebuddy.matcher.ElementMatcher;
-
-import java.util.Objects;
-
-import static net.bytebuddy.matcher.ElementMatchers.annotationType;
-
-/**
- * Matching used to match method annotations, Can match annotations on interface methods
- */
-@HashCodeAndEqualsPlugin.Enhance
-public class MethodInheritanceAnnotationMatcher extends ElementMatcher.Junction.AbstractBase {
-
- /**
- * The matcher to be applied to the provided annotation list.
- */
- private final ElementMatcher super AnnotationList> matcher;
-
- /**
- * Creates a new matcher for the annotations of an annotated element.
- *
- * @param matcher The matcher to be applied to the provided annotation list.
- */
- public MethodInheritanceAnnotationMatcher(ElementMatcher super AnnotationList> matcher) {
- this.matcher = matcher;
- }
-
- @Override
- public boolean matches(T target) {
- if (matcher.matches(target.getDeclaredAnnotations())) {
- return true;
- }
- String name = target.getName();
- ParameterList> parameters = target.getParameters();
-
- TypeDefinition declaringType = target.getDeclaringType();
- return recursiveMatches(declaringType, name, parameters);
- }
-
- private boolean recursiveMatches(TypeDefinition typeDefinition, String methodName, ParameterList> parameters) {
- TypeList.Generic interfaces = typeDefinition.getInterfaces();
- for (TypeDescription.Generic implInterface : interfaces) {
- if (recursiveMatches(implInterface, methodName, parameters)) {
- return true;
- }
- MethodList declaredMethods = implInterface.getDeclaredMethods();
- for (MethodDescription declaredMethod : declaredMethods) {
- if (Objects.equals(declaredMethod.getName(), methodName) && parameterEquals(parameters, declaredMethod.getParameters())) {
- return matcher.matches(declaredMethod.getDeclaredAnnotations());
- }
- }
- }
- return false;
- }
-
- private boolean parameterEquals(ParameterList> source, ParameterList> impl) {
- if (source.size() != impl.size()) {
- return false;
- }
- for (int i = 0; i < source.size(); i++) {
- if (!Objects.equals(source.get(i).getType(), impl.get(i).getType())) {
- return false;
- }
- }
- return true;
- }
-
- public static Junction byMethodInheritanceAnnotationMatcher(
- ElementMatcher super TypeDescription> matcher) {
- return new MethodInheritanceAnnotationMatcher(new CollectionItemMatcher<>(annotationType(matcher)));
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/MultiClassNameMatch.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/MultiClassNameMatch.java
deleted file mode 100644
index 8ebeba25..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/MultiClassNameMatch.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.match;
-
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-import java.util.Arrays;
-import java.util.List;
-
-import static net.bytebuddy.matcher.ElementMatchers.named;
-
-/**
- * Match class with a given set of classes.
- */
-public class MultiClassNameMatch implements IndirectMatch {
-
- private List matchClassNames;
-
- private MultiClassNameMatch(String[] classNames) {
- if (classNames == null || classNames.length == 0) {
- throw new IllegalArgumentException("match class names is null");
- }
- this.matchClassNames = Arrays.asList(classNames);
- }
-
- @Override
- public ElementMatcher.Junction buildJunction() {
- ElementMatcher.Junction junction = null;
- for (String name : matchClassNames) {
- if (junction == null) {
- junction = named(name);
- } else {
- junction = junction.or(named(name));
- }
- }
- return junction;
- }
-
- @Override
- public boolean isMatch(TypeDescription typeDescription) {
- return matchClassNames.contains(typeDescription.getTypeName());
- }
-
- public static IndirectMatch byMultiClassMatch(String... classNames) {
- return new MultiClassNameMatch(classNames);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/NameMatch.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/NameMatch.java
deleted file mode 100644
index 2dd9b11d..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/NameMatch.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.match;
-
-/**
- * Match the class with an explicit class name.
- */
-public class NameMatch implements ClassMatch {
-
- private String className;
-
- private NameMatch(String className) {
- this.className = className;
- }
-
- public String getClassName() {
- return className;
- }
-
- public static NameMatch byName(String className) {
- return new NameMatch(className);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/PrefixMatch.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/PrefixMatch.java
deleted file mode 100644
index d47d0409..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/PrefixMatch.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.match;
-
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-import net.bytebuddy.matcher.ElementMatchers;
-
-/**
- * Match classes by any one of the given {@link #prefixes}
- */
-@SuppressWarnings("rawtypes")
-public class PrefixMatch implements IndirectMatch {
-
- private String[] prefixes;
-
- private PrefixMatch(String... prefixes) {
- if (prefixes == null || prefixes.length == 0) {
- throw new IllegalArgumentException("prefixes argument is null or empty");
- }
- this.prefixes = prefixes;
- }
-
- @Override
- public ElementMatcher.Junction buildJunction() {
- ElementMatcher.Junction junction = null;
-
- for (String prefix : prefixes) {
- if (junction == null) {
- junction = ElementMatchers.nameStartsWith(prefix);
- } else {
- junction = junction.or(ElementMatchers.nameStartsWith(prefix));
- }
- }
-
- return junction;
- }
-
- @Override
- public boolean isMatch(TypeDescription typeDescription) {
- for (final String prefix : prefixes) {
- if (typeDescription.getName().startsWith(prefix)) {
- return true;
- }
- }
- return false;
- }
-
- public static PrefixMatch nameStartsWith(final String... prefixes) {
- return new PrefixMatch(prefixes);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/ProtectiveShieldMatcher.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/ProtectiveShieldMatcher.java
deleted file mode 100644
index 7a02b300..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/ProtectiveShieldMatcher.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.match;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import net.bytebuddy.matcher.ElementMatcher;
-
-/**
- * In some cases, some frameworks and libraries use some binary codes tech too. From the community feedback, some of
- * them have compatible issues with byte-buddy core, which trigger "Can't resolve type description" exception.
- *
- * So I build this protective shield by a nested matcher. When the origin matcher(s) can't resolve the type, the
- * Hippo4j agent ignores this types.
- *
- * Notice: this ignore mechanism may miss some instrumentations, but at most cases, it's same. If missing happens,
- * please pay attention to the WARNING logs.
- */
-public class ProtectiveShieldMatcher extends ElementMatcher.Junction.AbstractBase {
-
- private static final ILog LOGGER = LogManager.getLogger(ProtectiveShieldMatcher.class);
-
- private final ElementMatcher super T> matcher;
-
- public ProtectiveShieldMatcher(ElementMatcher super T> matcher) {
- this.matcher = matcher;
- }
-
- @Override
- public boolean matches(T target) {
- try {
- return this.matcher.matches(target);
- } catch (Throwable t) {
- if (LOGGER.isDebugEnable()) {
- LOGGER.debug(t, "Byte-buddy occurs exception when match type.");
- }
- return false;
- }
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/RegexMatch.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/RegexMatch.java
deleted file mode 100644
index e3310b24..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/RegexMatch.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.match;
-
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-import static net.bytebuddy.matcher.ElementMatchers.nameMatches;
-
-/**
- * Match the class by given class name regex expression.
- */
-public class RegexMatch implements IndirectMatch {
-
- private String[] regexExpressions;
-
- private RegexMatch(String... regexExpressions) {
- if (regexExpressions == null || regexExpressions.length == 0) {
- throw new IllegalArgumentException("annotations is null");
- }
- this.regexExpressions = regexExpressions;
- }
-
- @Override
- public ElementMatcher.Junction buildJunction() {
- ElementMatcher.Junction regexJunction = null;
- for (String regexExpression : regexExpressions) {
- if (regexJunction == null) {
- regexJunction = nameMatches(regexExpression);
- } else {
- regexJunction = regexJunction.or(nameMatches(regexExpression));
- }
- }
- return regexJunction;
- }
-
- @Override
- public boolean isMatch(TypeDescription typeDescription) {
- boolean isMatch = false;
- for (String matchExpression : regexExpressions) {
- isMatch = typeDescription.getTypeName().matches(matchExpression);
- if (isMatch) {
- break;
- }
- }
- return isMatch;
- }
-
- public static RegexMatch byRegexMatch(String... regexExpressions) {
- return new RegexMatch(regexExpressions);
- }
-}
\ No newline at end of file
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/logical/LogicalAndMatch.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/logical/LogicalAndMatch.java
deleted file mode 100644
index 8f5f05f5..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/logical/LogicalAndMatch.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.match.logical;
-
-import cn.hippo4j.agent.core.plugin.match.IndirectMatch;
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-/**
- * Match classes by multiple criteria with AND conjunction
- */
-public class LogicalAndMatch implements IndirectMatch {
-
- private final IndirectMatch[] indirectMatches;
-
- /**
- * Don't instantiate this class directly, use {@link LogicalMatchOperation} instead
- *
- * @param indirectMatches the matching criteria to conjunct with AND
- */
- LogicalAndMatch(final IndirectMatch... indirectMatches) {
- this.indirectMatches = indirectMatches;
- }
-
- @Override
- public ElementMatcher.Junction buildJunction() {
- ElementMatcher.Junction junction = null;
-
- for (final IndirectMatch indirectMatch : indirectMatches) {
- if (junction == null) {
- junction = indirectMatch.buildJunction();
- } else {
- junction = junction.and(indirectMatch.buildJunction());
- }
- }
-
- return junction;
- }
-
- @Override
- public boolean isMatch(final TypeDescription typeDescription) {
- for (final IndirectMatch indirectMatch : indirectMatches) {
- if (!indirectMatch.isMatch(typeDescription)) {
- return false;
- }
- }
-
- return true;
- }
-
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/logical/LogicalMatchOperation.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/logical/LogicalMatchOperation.java
deleted file mode 100644
index 26637d8d..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/logical/LogicalMatchOperation.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.match.logical;
-
-import cn.hippo4j.agent.core.plugin.match.IndirectMatch;
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-import net.bytebuddy.matcher.NegatingMatcher;
-
-/**
- * Util class to help to construct logical operations on {@link cn.hippo4j.agent.core.plugin.match.ClassMatch}s
- */
-public class LogicalMatchOperation {
-
- public static IndirectMatch and(final IndirectMatch... matches) {
- return new LogicalAndMatch(matches);
- }
-
- public static IndirectMatch or(final IndirectMatch... matches) {
- return new LogicalOrMatch(matches);
- }
-
- public static IndirectMatch not(final IndirectMatch match) {
- return new IndirectMatch() {
-
- @Override
- public ElementMatcher.Junction buildJunction() {
- return new NegatingMatcher(match.buildJunction());
- }
-
- @Override
- public boolean isMatch(final TypeDescription typeDescription) {
- return !match.isMatch(typeDescription);
- }
- };
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/logical/LogicalOrMatch.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/logical/LogicalOrMatch.java
deleted file mode 100644
index 35549a3a..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/plugin/match/logical/LogicalOrMatch.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.plugin.match.logical;
-
-import cn.hippo4j.agent.core.plugin.match.IndirectMatch;
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-/**
- * Match classes by multiple criteria with OR conjunction
- */
-public class LogicalOrMatch implements IndirectMatch {
-
- private final IndirectMatch[] indirectMatches;
-
- /**
- * Don't instantiate this class directly, use {@link LogicalMatchOperation} instead
- *
- * @param indirectMatches the matching criteria to conjunct with OR
- */
- LogicalOrMatch(final IndirectMatch... indirectMatches) {
- this.indirectMatches = indirectMatches;
- }
-
- @Override
- public ElementMatcher.Junction buildJunction() {
- ElementMatcher.Junction junction = null;
-
- for (final IndirectMatch indirectMatch : indirectMatches) {
- if (junction == null) {
- junction = indirectMatch.buildJunction();
- } else {
- junction = junction.or(indirectMatch.buildJunction());
- }
- }
-
- return junction;
- }
-
- @Override
- public boolean isMatch(final TypeDescription typeDescription) {
- for (final IndirectMatch indirectMatch : indirectMatches) {
- if (indirectMatch.isMatch(typeDescription)) {
- return true;
- }
- }
-
- return false;
- }
-
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/AgentThreadPoolConstants.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/AgentThreadPoolConstants.java
deleted file mode 100644
index bdfbdaac..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/AgentThreadPoolConstants.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-public interface AgentThreadPoolConstants {
-
- String TOMCAT_NAME_PREFIX = "namePrefix";
- String DUBBO_NAME_PREFIX = "mPrefix";
- String DUBBO_THREAD_NAME = "DubboServerHandler";
- String THREAD_POOL_NAME_DUBBO = "dubbo";
-
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/CollectionUtil.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/CollectionUtil.java
deleted file mode 100644
index 587c84f8..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/CollectionUtil.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-/**
- * Some utility methods for collections. Reinvent the wheels because importing third-party libs just for some methods is
- * not worthwhile in agent side
- *
- * @since 7.0.0
- */
-public final class CollectionUtil {
-
- public static String toString(final Map map) {
- return map.entrySet()
- .stream()
- .map(entry -> entry.getKey() + "=" + Arrays.toString(entry.getValue()))
- .collect(Collectors.joining("\n"));
- }
-
- @SuppressWarnings("rawtypes")
- public static boolean isEmpty(Collection collection) {
- return collection == null || collection.isEmpty();
- }
-
- /**
- * Is empty.
- *
- * @param map
- * @return
- */
- public static boolean isEmpty(Map, ?> map) {
- return map == null || map.isEmpty();
- }
-
- /**
- * Is not empty.
- *
- * @param map
- * @return
- */
- public static boolean isNotEmpty(Map, ?> map) {
- return !isEmpty(map);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/ConfigInitializer.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/ConfigInitializer.java
deleted file mode 100644
index 5559db3c..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/ConfigInitializer.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Properties;
-
-/**
- * Init a class's static fields by a {@link Properties}, including static fields and static inner classes.
- *
- */
-public class ConfigInitializer {
-
- public static void initialize(Properties properties, Class> rootConfigType) throws IllegalAccessException {
- initNextLevel(properties, rootConfigType, new ConfigDesc(), false);
- }
-
- public static void initialize(Properties properties, Class> rootConfigType, boolean isSpringProperties) throws IllegalAccessException {
- initNextLevel(properties, rootConfigType, new ConfigDesc(), isSpringProperties);
- }
-
- private static void initNextLevel(Properties properties, Class> recentConfigType,
- ConfigDesc parentDesc, boolean isSpringProperties) throws IllegalArgumentException, IllegalAccessException {
- for (Field field : recentConfigType.getFields()) {
- if (Modifier.isPublic(field.getModifiers()) && Modifier.isStatic(field.getModifiers())) {
- String configKey = (parentDesc + "." + (isSpringProperties ? field.getName().replace("_", "-") : field.getName())).toLowerCase();
- Class> type = field.getType();
-
- if (type.equals(Map.class)) {
- /*
- * Map config format is, config_key[map_key]=map_value Such as plugin.opgroup.resttemplate.rule[abc]=/url/path
- */
- // Deduct two generic types of the map
- ParameterizedType genericType = (ParameterizedType) field.getGenericType();
- Type[] argumentTypes = genericType.getActualTypeArguments();
-
- Type keyType = null;
- Type valueType = null;
- if (argumentTypes != null && argumentTypes.length == 2) {
- // Get key type and value type of the map
- keyType = argumentTypes[0];
- valueType = argumentTypes[1];
- }
- Map map = (Map) field.get(null);
- // Set the map from config key and properties
- setForMapType(configKey, map, properties, keyType, valueType);
- } else {
- /*
- * Others typical field type
- */
- String value = properties.getProperty(configKey);
- // Convert the value into real type
- final Length lengthDefine = field.getAnnotation(Length.class);
- if (lengthDefine != null) {
- if (value != null && value.length() > lengthDefine.value()) {
- value = value.substring(0, lengthDefine.value());
- }
- }
- Object convertedValue = convertToTypicalType(type, value);
- if (convertedValue != null) {
- field.set(null, convertedValue);
- }
- }
- }
- }
- for (Class> innerConfiguration : recentConfigType.getClasses()) {
- String simpleName = innerConfiguration.getSimpleName();
- String description = isSpringProperties ? simpleName.replace("_", "-") : simpleName;
- parentDesc.append(description);
- initNextLevel(properties, innerConfiguration, parentDesc, isSpringProperties);
- parentDesc.removeLastDesc();
- }
- }
-
- /**
- * Convert string value to typical type.
- *
- * @param type type to convert
- * @param value string value to be converted
- * @return converted value or null
- */
- private static Object convertToTypicalType(Type type, String value) {
- if (value == null || type == null) {
- return null;
- }
-
- Object result = null;
- if (String.class.equals(type)) {
- result = value;
- } else if (int.class.equals(type) || Integer.class.equals(type)) {
- result = Integer.valueOf(value);
- } else if (long.class.equals(type) || Long.class.equals(type)) {
- result = Long.valueOf(value);
- } else if (boolean.class.equals(type) || Boolean.class.equals(type)) {
- result = Boolean.valueOf(value);
- } else if (float.class.equals(type) || Float.class.equals(type)) {
- result = Float.valueOf(value);
- } else if (double.class.equals(type) || Double.class.equals(type)) {
- result = Double.valueOf(value);
- } else if (List.class.equals(type)) {
- result = convert2List(value);
- } else if (type instanceof Class) {
- Class> clazz = (Class>) type;
- if (clazz.isEnum()) {
- result = Enum.valueOf((Class) type, value.toUpperCase());
- }
- }
- return result;
- }
-
- /**
- * Set map items.
- *
- * @param configKey config key must not be null
- * @param map map to set must not be null
- * @param properties properties must not be null
- * @param keyType key type of the map
- * @param valueType value type of the map
- */
- private static void setForMapType(String configKey, Map map, Properties properties,
- final Type keyType, final Type valueType) {
-
- Objects.requireNonNull(configKey);
- Objects.requireNonNull(map);
- Objects.requireNonNull(properties);
-
- String prefix = configKey + "[";
- String suffix = "]";
-
- properties.forEach((propertyKey, propertyValue) -> {
- String propertyStringKey = propertyKey.toString();
- if (propertyStringKey.startsWith(prefix) && propertyStringKey.endsWith(suffix)) {
- String itemKey = propertyStringKey.substring(
- prefix.length(), propertyStringKey.length() - suffix.length());
- Object keyObj;
- Object valueObj;
-
- keyObj = convertToTypicalType(keyType, itemKey);
- valueObj = convertToTypicalType(valueType, propertyValue.toString());
-
- if (keyObj == null) {
- keyObj = itemKey;
- }
-
- if (valueObj == null) {
- valueObj = propertyValue;
- }
-
- map.put(keyObj, valueObj);
- }
- });
- }
-
- private static List convert2List(String value) {
- if (StringUtil.isEmpty(value)) {
- return Collections.emptyList();
- }
- List result = new LinkedList<>();
-
- String[] segments = value.split(",");
- for (String segment : segments) {
- String trimmedSegment = segment.trim();
- if (StringUtil.isNotEmpty(trimmedSegment)) {
- result.add(trimmedSegment);
- }
- }
- return result;
- }
-
-}
-
-class ConfigDesc {
-
- private LinkedList descs = new LinkedList<>();
-
- void append(String currentDesc) {
- if (StringUtil.isNotEmpty(currentDesc)) {
- descs.addLast(currentDesc);
- }
- }
-
- void removeLastDesc() {
- descs.removeLast();
- }
-
- @Override
- public String toString() {
- return String.join(".", descs);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/CustomizeExpression.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/CustomizeExpression.java
deleted file mode 100644
index f4aebf8a..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/CustomizeExpression.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-
-import java.lang.reflect.Array;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * a simple parsing expression
- */
-
-public class CustomizeExpression {
-
- private static final ILog LOGGER = LogManager.getLogger(CustomizeExpression.class);
-
- public static Map evaluationContext(Object[] allArguments) {
- Map context = new HashMap<>();
- if (allArguments == null) {
- return context;
- }
- for (int i = 0; i < allArguments.length; i++) {
- context.put("arg[" + i + "]", allArguments[i]);
- }
- return context;
- }
-
- public static Map evaluationReturnContext(Object ret) {
- Map context = new HashMap<>();
- context.put("returnedObj", ret);
- return context;
- }
-
- public static String parseExpression(String expression, Map context) {
- try {
- String[] es = expression.split("\\.");
- Object o = context.get(es[0]);
- return o == null ? "null" : String.valueOf(parse(es, o, 0));
- } catch (Exception e) {
- LOGGER.debug("parse expression error, expression is {}, exception is {}", expression, e.getMessage());
- }
- return "null";
- }
-
- private static Object parse(String[] expressions, Object o, int i) {
- int next = i + 1;
- if (next == expressions.length) {
- return o;
- } else {
- o = parse0(expressions[next], o);
- return o == null ? "null" : parse(expressions, o, next);
- }
- }
-
- private static Object parse0(String expression, Object o) {
- if (o instanceof Map) {
- return matcherMap(expression, o);
- } else if (o instanceof List) {
- return matcherList(expression, o);
- } else if (o.getClass().isArray()) {
- return matcherArray(expression, o);
- } else {
- return matcherDefault(expression, o);
- }
- }
-
- private static Object matcherMap(String expression, Object o) {
- String key = expression.replace("['", "").replace("']", "");
- return ((Map) o).get(key);
- }
-
- private static Object matcherList(String expression, Object o) {
- int index = Integer.parseInt(expression.replace("[", "").replace("]", ""));
- List l = (List) o;
- return l != null && l.size() > index ? l.get(index) : null;
- }
-
- private static Object matcherArray(String expression, Object o) {
- int index = Integer.parseInt(expression.replace("[", "").replace("]", ""));
- return o != null && Array.getLength(o) > index ? Array.get(o, index) : null;
- }
-
- private static Object matcherDefault(String expression, Object o) {
- try {
- if (expression.contains("()")) {
- Method m = o.getClass().getMethod(expression.replace("()", ""));
- m.setAccessible(true);
- return m.invoke(o);
- } else {
- Field f = o.getClass().getDeclaredField(expression);
- f.setAccessible(true);
- return f.get(o);
- }
- } catch (Exception e) {
- LOGGER.debug("matcher default error, expression is {}, object is {}, expression is {}", expression, o, e.getMessage());
- }
- return null;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/ExecutorNameUtil.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/ExecutorNameUtil.java
deleted file mode 100644
index e605e1ad..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/ExecutorNameUtil.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-
-import java.lang.reflect.Field;
-
-public class ExecutorNameUtil {
-
- private static final ILog LOGGER = LogManager.getLogger(ExecutorNameUtil.class);
-
- public static boolean isTomcatExecutor(Object threadFactory) {
- try {
- if ("org.apache.tomcat.util.threads.TaskThreadFactory".equals(threadFactory.getClass().getName())) {
- Field namePrefixField = threadFactory.getClass().getDeclaredField(AgentThreadPoolConstants.TOMCAT_NAME_PREFIX);
- namePrefixField.setAccessible(true);
- String namePrefix = (String) namePrefixField.get(threadFactory);
- if (RegexUtil.isTomcatNameMatch(namePrefix)) {
- return true;
- }
- }
- } catch (Throwable t) {
- LOGGER.error("Fail to put tomcat executor", t);
- }
- return false;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/FileUtils.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/FileUtils.java
deleted file mode 100644
index 2d954dda..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/FileUtils.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-import java.io.File;
-import java.nio.file.Files;
-
-public class FileUtils {
-
- /**
- * delete directories and files recursively
- *
- * @param dir directory to delete
- */
- public static void deleteDirectory(File dir) {
- File[] files = dir.listFiles();
- if (files != null) {
- for (File file : files) {
- if (!Files.isSymbolicLink(file.toPath())) {
- if (file.isDirectory()) {
- deleteDirectory(file);
- } else {
- file.delete();
- }
- } else {
- file.delete();
- }
- }
- }
- dir.delete();
- }
-
- public static void deleteDirectoryOnExit(File dir) {
- Runtime.getRuntime().addShutdownHook(new Thread() {
-
- @Override
- public void run() {
- FileUtils.deleteDirectory(dir);
- }
- });
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/IOUtils.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/IOUtils.java
deleted file mode 100644
index 7c89756b..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/IOUtils.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-import java.io.ByteArrayOutputStream;
-import java.io.Closeable;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- * Copied from commons-io-2.2 (org.apache.commons.io.IOUtils)
- * Origin license: http://www.apache.org/licenses/LICENSE-2.0
- * @version $Id: IOUtils.java 1304177 2012-03-23 03:36:44Z ggregory $
- */
-public class IOUtils {
-
- private static final int EOF = -1;
-
- /**
- * The default buffer size ({@value}) to use for
- * {@link #copyLarge(InputStream, OutputStream)}
- */
- private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
-
- /**
- * Get the contents of an InputStream as a byte[].
- *
- * This method buffers the input internally, so there is no need to use a
- * BufferedInputStream.
- *
- * @param input the InputStream to read from
- * @return the requested byte array
- * @throws NullPointerException if the input is null
- * @throws IOException if an I/O error occurs
- */
- public static byte[] toByteArray(InputStream input) throws IOException {
- ByteArrayOutputStream output = new ByteArrayOutputStream();
- copy(input, output);
- return output.toByteArray();
- }
-
- /**
- * Copy bytes from an InputStream to an
- * OutputStream.
- *
- * This method buffers the input internally, so there is no need to use a
- * BufferedInputStream.
- *
- * Large streams (over 2GB) will return a bytes copied value of
- * -1 after the copy has completed since the correct
- * number of bytes cannot be returned as an int. For large streams
- * use the copyLarge(InputStream, OutputStream) method.
- *
- * @param input the InputStream to read from
- * @param output the OutputStream to write to
- * @return the number of bytes copied, or -1 if > Integer.MAX_VALUE
- * @throws NullPointerException if the input or output is null
- * @throws IOException if an I/O error occurs
- * @since 1.1
- */
- public static int copy(InputStream input, OutputStream output) throws IOException {
- long count = copyLarge(input, output);
- if (count > Integer.MAX_VALUE) {
- return -1;
- }
- return (int) count;
- }
-
- /**
- * Copy bytes from a large (over 2GB) InputStream to an
- * OutputStream.
- *
- * This method buffers the input internally, so there is no need to use a
- * BufferedInputStream.
- *
- * The buffer size is given by {@link #DEFAULT_BUFFER_SIZE}.
- *
- * @param input the InputStream to read from
- * @param output the OutputStream to write to
- * @return the number of bytes copied
- * @throws NullPointerException if the input or output is null
- * @throws IOException if an I/O error occurs
- * @since 1.3
- */
- public static long copyLarge(InputStream input, OutputStream output) throws IOException {
- return copyLarge(input, output, new byte[DEFAULT_BUFFER_SIZE]);
- }
-
- /**
- * Copy bytes from a large (over 2GB) InputStream to an
- * OutputStream.
- *
- * This method uses the provided buffer, so there is no need to use a
- * BufferedInputStream.
- *
- *
- * @param input the InputStream to read from
- * @param output the OutputStream to write to
- * @param buffer the buffer to use for the copy
- * @return the number of bytes copied
- * @throws NullPointerException if the input or output is null
- * @throws IOException if an I/O error occurs
- * @since 2.2
- */
- public static long copyLarge(InputStream input, OutputStream output, byte[] buffer) throws IOException {
- long count = 0;
- int n = 0;
- while (EOF != (n = input.read(buffer))) {
- output.write(buffer, 0, n);
- count += n;
- }
- return count;
- }
-
- /**
- * close streams
- * @param closeable the closeable handler
- */
- public static void closeQuietly(Closeable closeable) {
- try {
- if (closeable != null) {
- closeable.close();
- }
- } catch (IOException ex) {
- // ignore ex
- }
- }
-
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/Length.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/Length.java
deleted file mode 100644
index 4226d4d7..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/Length.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * The length rule of the target field.
- */
-@Target({ElementType.FIELD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Length {
-
- int value();
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/MethodUtil.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/MethodUtil.java
deleted file mode 100644
index bd7e13f6..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/MethodUtil.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-import java.lang.reflect.Method;
-
-/**
- * According to the input parameter, return the OperationName for the span record, It can determine the unique method
- */
-
-public class MethodUtil {
-
- public static String generateOperationName(Method method) {
- StringBuilder operationName = new StringBuilder(method.getDeclaringClass()
- .getName() + "." + method.getName() + "(");
- Class>[] parameterTypes = method.getParameterTypes();
- for (int i = 0; i < parameterTypes.length; i++) {
- operationName.append(parameterTypes[i].getName());
- if (i < (parameterTypes.length - 1)) {
- operationName.append(",");
- }
- }
- operationName.append(")");
- return operationName.toString();
- }
-
- /**
- * This is a low-performance method, recommend to use this when have to, make sure it is only executed once and the
- * result is being cached.
- */
- public static boolean isMethodExist(ClassLoader classLoader, String className, String methodName,
- String... parameterTypes) {
- try {
- Class> clazz = Class.forName(className, true, classLoader);
- if (parameterTypes == null || parameterTypes.length == 0) {
- clazz.getDeclaredMethod(methodName);
- return true;
- } else {
- Method[] declaredMethods = clazz.getDeclaredMethods();
- for (Method declaredMethod : declaredMethods) {
- if (declaredMethod.getName().equals(methodName)
- && isParameterTypesEquals(declaredMethod.getParameterTypes(), parameterTypes)) {
- return true;
- }
- }
- }
- } catch (Exception e) {
- // ignore
- }
- return false;
- }
-
- private static boolean isParameterTypesEquals(Class>[] parameterTypeClazz, String[] parameterTypeString) {
- if (parameterTypeClazz == null) {
- return false;
- }
- if (parameterTypeClazz.length != parameterTypeString.length) {
- return false;
- }
- for (int i = 0; i < parameterTypeClazz.length; i++) {
- if (!parameterTypeClazz[i].getName().equals(parameterTypeString[i])) {
- return false;
- }
- }
- return true;
-
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/PlaceholderConfigurerSupport.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/PlaceholderConfigurerSupport.java
deleted file mode 100644
index 3b2f6ffd..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/PlaceholderConfigurerSupport.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-public class PlaceholderConfigurerSupport {
-
- /**
- * Default placeholder prefix: {@value}
- */
- public static final String DEFAULT_PLACEHOLDER_PREFIX = "${";
-
- /**
- * Default placeholder suffix: {@value}
- */
- public static final String DEFAULT_PLACEHOLDER_SUFFIX = "}";
-
- /**
- * Default value separator: {@value}
- */
- public static final String DEFAULT_VALUE_SEPARATOR = ":";
-
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/PrivateKeyUtil.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/PrivateKeyUtil.java
deleted file mode 100644
index 48df0f19..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/PrivateKeyUtil.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.Base64;
-
-/**
- * Util intends to parse PKCS#1 and PKCS#8 at same time.
- */
-public class PrivateKeyUtil {
-
- private static final String PKCS_1_PEM_HEADER = "-----BEGIN RSA PRIVATE KEY-----";
- private static final String PKCS_1_PEM_FOOTER = "-----END RSA PRIVATE KEY-----";
- private static final String PKCS_8_PEM_HEADER = "-----BEGIN PRIVATE KEY-----";
- private static final String PKCS_8_PEM_FOOTER = "-----END PRIVATE KEY-----";
-
- /**
- * Load a RSA decryption key from a file (PEM or DER).
- */
- public static InputStream loadDecryptionKey(String keyFilePath) throws IOException {
- byte[] keyDataBytes = Files.readAllBytes(Paths.get(keyFilePath));
- String keyDataString = new String(keyDataBytes, StandardCharsets.UTF_8);
-
- if (keyDataString.contains(PKCS_1_PEM_HEADER)) {
- // OpenSSL / PKCS#1 Base64 PEM encoded file
- keyDataString = keyDataString.replace(PKCS_1_PEM_HEADER, "");
- keyDataString = keyDataString.replace(PKCS_1_PEM_FOOTER, "");
- keyDataString = keyDataString.replace("\n", "");
- return readPkcs1PrivateKey(Base64.getDecoder().decode(keyDataString));
- }
-
- return new ByteArrayInputStream(keyDataString.getBytes());
- }
-
- /**
- * Create a InputStream instance from raw PKCS#1 bytes. Raw Java API can't recognize ASN.1 format, so we should
- * convert it into a pkcs#8 format Java can understand.
- */
- private static InputStream readPkcs1PrivateKey(byte[] pkcs1Bytes) {
- int pkcs1Length = pkcs1Bytes.length;
- int totalLength = pkcs1Length + 22;
- byte[] pkcs8Header = new byte[]{
- 0x30, (byte) 0x82, (byte) ((totalLength >> 8) & 0xff), (byte) (totalLength & 0xff), // Sequence + total length
- 0x2, 0x1, 0x0, // Integer (0)
- 0x30, 0xD, 0x6, 0x9, 0x2A, (byte) 0x86, 0x48, (byte) 0x86, (byte) 0xF7, 0xD, 0x1, 0x1, 0x1, 0x5, 0x0, // Sequence: 1.2.840.113549.1.1.1, NULL
- 0x4, (byte) 0x82, (byte) ((pkcs1Length >> 8) & 0xff), (byte) (pkcs1Length & 0xff) // Octet string + length
- };
- StringBuilder pkcs8 = new StringBuilder(PKCS_8_PEM_HEADER);
- pkcs8.append("\n").append(new String(Base64.getEncoder().encode(join(pkcs8Header, pkcs1Bytes))));
- pkcs8.append("\n").append(PKCS_8_PEM_FOOTER);
- return new ByteArrayInputStream(pkcs8.toString().getBytes());
- }
-
- private static byte[] join(byte[] byteArray1, byte[] byteArray2) {
- byte[] bytes = new byte[byteArray1.length + byteArray2.length];
- System.arraycopy(byteArray1, 0, bytes, 0, byteArray1.length);
- System.arraycopy(byteArray2, 0, bytes, byteArray1.length, byteArray2.length);
- return bytes;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/PropertyPlaceholderHelper.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/PropertyPlaceholderHelper.java
deleted file mode 100644
index 39e09629..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/PropertyPlaceholderHelper.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-/**
- * Utility class for working with Strings that have placeholder values in them. A placeholder takes the form {@code
- * ${name}}. Using {@code PropertyPlaceholderHelper} these placeholders can be substituted for user-supplied values.
- * Values for substitution can be supplied using a {@link Properties} instance or using a {@link PlaceholderResolver}.
- */
-public enum PropertyPlaceholderHelper {
-
- INSTANCE(
- PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_PREFIX,
- PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_SUFFIX, PlaceholderConfigurerSupport.DEFAULT_VALUE_SEPARATOR,
- true);
-
- private final String placeholderPrefix;
-
- private final String placeholderSuffix;
-
- private final String simplePrefix;
-
- private final String valueSeparator;
-
- private final boolean ignoreUnresolvablePlaceholders;
-
- /**
- * Creates a new {@code PropertyPlaceholderHelper} that uses the supplied prefix and suffix.
- *
- * @param placeholderPrefix the prefix that denotes the start of a placeholder
- * @param placeholderSuffix the suffix that denotes the end of a placeholder
- * @param valueSeparator the separating character between the placeholder variable and the
- * associated default value, if any
- * @param ignoreUnresolvablePlaceholders indicates whether unresolvable placeholders should be ignored ({@code
- * true}) or cause an exception ({@code false})
- */
- PropertyPlaceholderHelper(String placeholderPrefix, String placeholderSuffix, String valueSeparator,
- boolean ignoreUnresolvablePlaceholders) {
- if (StringUtil.isEmpty(placeholderPrefix) || StringUtil.isEmpty(placeholderSuffix)) {
- throw new UnsupportedOperationException("'placeholderPrefix or placeholderSuffix' must not be null");
- }
-
- final Map wellKnownSimplePrefixes = new HashMap(4);
-
- wellKnownSimplePrefixes.put("}", "{");
- wellKnownSimplePrefixes.put("]", "[");
- wellKnownSimplePrefixes.put(")", "(");
-
- this.placeholderPrefix = placeholderPrefix;
- this.placeholderSuffix = placeholderSuffix;
- String simplePrefixForSuffix = wellKnownSimplePrefixes.get(this.placeholderSuffix);
- if (simplePrefixForSuffix != null && this.placeholderPrefix.endsWith(simplePrefixForSuffix)) {
- this.simplePrefix = simplePrefixForSuffix;
- } else {
- this.simplePrefix = this.placeholderPrefix;
- }
- this.valueSeparator = valueSeparator;
- this.ignoreUnresolvablePlaceholders = ignoreUnresolvablePlaceholders;
- }
-
- /**
- * Replaces all placeholders of format {@code ${name}} with the corresponding property from the supplied {@link
- * Properties}.
- *
- * @param value the value containing the placeholders to be replaced
- * @param properties the {@code Properties} to use for replacement
- * @return the supplied value with placeholders replaced inline
- */
- public String replacePlaceholders(String value, final Properties properties) {
- return replacePlaceholders(value, new PlaceholderResolver() {
-
- @Override
- public String resolvePlaceholder(String placeholderName) {
- return getConfigValue(placeholderName, properties);
- }
- });
- }
-
- private String getConfigValue(String key, final Properties properties) {
- String value = System.getProperty(key);
- if (value == null) {
- value = System.getenv(key);
- }
- if (value == null) {
- value = properties.getProperty(key);
- }
- return value;
- }
-
- /**
- * Replaces all placeholders of format {@code ${name}} with the value returned from the supplied {@link
- * PlaceholderResolver}.
- *
- * @param value the value containing the placeholders to be replaced
- * @param placeholderResolver the {@code PlaceholderResolver} to use for replacement
- * @return the supplied value with placeholders replaced inline
- */
- public String replacePlaceholders(String value, PlaceholderResolver placeholderResolver) {
- return parseStringValue(value, placeholderResolver, new HashSet());
- }
-
- protected String parseStringValue(String value, PlaceholderResolver placeholderResolver,
- Set visitedPlaceholders) {
-
- StringBuilder result = new StringBuilder(value);
-
- int startIndex = value.indexOf(this.placeholderPrefix);
- while (startIndex != -1) {
- int endIndex = findPlaceholderEndIndex(result, startIndex);
- if (endIndex != -1) {
- String placeholder = result.substring(startIndex + this.placeholderPrefix.length(), endIndex);
- String originalPlaceholder = placeholder;
- if (!visitedPlaceholders.add(originalPlaceholder)) {
- throw new IllegalArgumentException(
- "Circular placeholder reference '" + originalPlaceholder + "' in property definitions");
- }
- // Recursive invocation, parsing placeholders contained in the placeholder key.
- placeholder = parseStringValue(placeholder, placeholderResolver, visitedPlaceholders);
- // Now obtain the value for the fully resolved key...
- String propVal = placeholderResolver.resolvePlaceholder(placeholder);
- if (propVal == null && this.valueSeparator != null) {
- int separatorIndex = placeholder.indexOf(this.valueSeparator);
- if (separatorIndex != -1) {
- String actualPlaceholder = placeholder.substring(0, separatorIndex);
- String defaultValue = placeholder.substring(separatorIndex + this.valueSeparator.length());
- propVal = placeholderResolver.resolvePlaceholder(actualPlaceholder);
- if (propVal == null) {
- propVal = defaultValue;
- }
- }
- }
- if (propVal != null) {
- // Recursive invocation, parsing placeholders contained in the
- // previously resolved placeholder value.
- propVal = parseStringValue(propVal, placeholderResolver, visitedPlaceholders);
- result.replace(startIndex, endIndex + this.placeholderSuffix.length(), propVal);
- startIndex = result.indexOf(this.placeholderPrefix, startIndex + propVal.length());
- } else if (this.ignoreUnresolvablePlaceholders) {
- // Proceed with unprocessed value.
- startIndex = result.indexOf(this.placeholderPrefix, endIndex + this.placeholderSuffix.length());
- } else {
- throw new IllegalArgumentException(
- "Could not resolve placeholder '" + placeholder + "'" + " in value \"" + value + "\"");
- }
- visitedPlaceholders.remove(originalPlaceholder);
- } else {
- startIndex = -1;
- }
- }
- return result.toString();
- }
-
- private int findPlaceholderEndIndex(CharSequence buf, int startIndex) {
- int index = startIndex + this.placeholderPrefix.length();
- int withinNestedPlaceholder = 0;
- while (index < buf.length()) {
- if (StringUtil.substringMatch(buf, index, this.placeholderSuffix)) {
- if (withinNestedPlaceholder > 0) {
- withinNestedPlaceholder--;
- index = index + this.placeholderSuffix.length();
- } else {
- return index;
- }
- } else if (StringUtil.substringMatch(buf, index, this.simplePrefix)) {
- withinNestedPlaceholder++;
- index = index + this.simplePrefix.length();
- } else {
- index++;
- }
- }
- return -1;
- }
-
- /**
- * Strategy interface used to resolve replacement values for placeholders contained in Strings.
- */
- public interface PlaceholderResolver {
-
- /**
- * Resolve the supplied placeholder name to the replacement value.
- *
- * @param placeholderName the name of the placeholder to resolve
- * @return the replacement value, or {@code null} if no replacement is to be made
- */
- String resolvePlaceholder(String placeholderName);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/ReflectUtil.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/ReflectUtil.java
deleted file mode 100644
index 105a5274..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/ReflectUtil.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.List;
-
-public class ReflectUtil {
-
- private static final ILog LOGGER = LogManager.getLogger(ReflectUtil.class);
-
- public static List getStaticFieldsFromType(Class> clazz, Class> declaredType) {
- Field[] fields = clazz.getDeclaredFields();
- List result = new ArrayList<>();
- for (Field field : fields) {
- if (field.getType().isAssignableFrom(declaredType)
- && Modifier.isStatic(field.getModifiers())) {
- field.setAccessible(true);
- result.add(field);
- }
- }
- return result;
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/RegexUtil.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/RegexUtil.java
deleted file mode 100644
index a3576643..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/RegexUtil.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-import java.util.regex.Pattern;
-
-public class RegexUtil {
-
- private static final String TOMCAT_NAME_PATTERN_STRING = "http\\S+nio\\S+-exec-";
- private static final Pattern TOMCAT_NAME_PATTERN = Pattern.compile(TOMCAT_NAME_PATTERN_STRING);
-
- public static boolean isTomcatNameMatch(String executorName) {
- return TOMCAT_NAME_PATTERN.matcher(executorName).find();
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/RunnableWithExceptionProtection.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/RunnableWithExceptionProtection.java
deleted file mode 100644
index 5a3d392b..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/RunnableWithExceptionProtection.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-public class RunnableWithExceptionProtection implements Runnable {
-
- private Runnable run;
- private CallbackWhenException callback;
-
- public RunnableWithExceptionProtection(Runnable run, CallbackWhenException callback) {
- this.run = run;
- this.callback = callback;
- }
-
- @Override
- public void run() {
- try {
- run.run();
- } catch (Throwable t) {
- callback.handle(t);
- }
- }
-
- public interface CallbackWhenException {
-
- void handle(Throwable t);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/StringUtil.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/StringUtil.java
deleted file mode 100644
index 040f915c..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/StringUtil.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-import java.util.function.Consumer;
-
-public final class StringUtil {
-
- public static boolean isEmpty(String str) {
- return str == null || str.length() == 0;
- }
-
- public static boolean isNotEmpty(String str) {
- return !isEmpty(str);
- }
-
- public static boolean isBlank(String str) {
- return str == null || isEmpty(str.trim());
- }
-
- public static boolean isNotBlank(String str) {
- return !isBlank(str);
- }
-
- public static void setIfPresent(String value, Consumer setter) {
- if (isNotEmpty(value)) {
- setter.accept(value);
- }
- }
-
- public static String join(final char delimiter, final String... strings) {
- if (strings.length == 0) {
- return null;
- }
- if (strings.length == 1) {
- return strings[0];
- }
- int length = strings.length - 1;
- for (final String s : strings) {
- if (s == null) {
- continue;
- }
- length += s.length();
- }
- final StringBuilder sb = new StringBuilder(length);
- if (strings[0] != null) {
- sb.append(strings[0]);
- }
- for (int i = 1; i < strings.length; ++i) {
- if (!isEmpty(strings[i])) {
- sb.append(delimiter).append(strings[i]);
- } else {
- sb.append(delimiter);
- }
- }
- return sb.toString();
- }
-
- public static boolean substringMatch(CharSequence str, int index, CharSequence substring) {
- if (index + substring.length() > str.length()) {
- return false;
- }
- for (int i = 0; i < substring.length(); i++) {
- if (str.charAt(index + i) != substring.charAt(i)) {
- return false;
- }
- }
- return true;
- }
-
- public static String cut(String str, int threshold) {
- if (isEmpty(str) || str.length() <= threshold) {
- return str;
- }
- return str.substring(0, threshold);
- }
-
- public static String trim(final String str, final char ch) {
- if (isEmpty(str)) {
- return null;
- }
-
- final char[] chars = str.toCharArray();
-
- int i = 0, j = chars.length - 1;
- // noinspection StatementWithEmptyBody
- for (; i < chars.length && chars[i] == ch; i++) {
- }
- // noinspection StatementWithEmptyBody
- for (; j > 0 && chars[j] == ch; j--) {
- }
-
- return new String(chars, i, j - i + 1);
- }
-}
diff --git a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/ThreadPoolPropertyKey.java b/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/ThreadPoolPropertyKey.java
deleted file mode 100644
index aa493f9e..00000000
--- a/agent/hippo4j-agent-core/src/main/java/cn/hippo4j/agent/core/util/ThreadPoolPropertyKey.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.core.util;
-
-public interface ThreadPoolPropertyKey {
-
- String THREAD_POOL_ID = "threadPoolId";
-
- String CORE_POOL_SIZE = "corePoolSize";
-
- String MAXIMUM_POOL_SIZE = "maximumPoolSize";
-
- String ALLOW_CORE_THREAD_TIME_OUT = "allowCoreThreadTimeOut";
-
- String KEEP_ALIVE_TIME = "keepAliveTime";
-
- String BLOCKING_QUEUE = "blockingQueue";
-
- String QUEUE_CAPACITY = "queueCapacity";
-
- String REJECTED_HANDLER = "rejectedHandler";
-
- String EXECUTE_TIME_OUT = "executeTimeOut";
-}
diff --git a/agent/hippo4j-agent-plugin/adapter-plugins/dubbo-plugin/pom.xml b/agent/hippo4j-agent-plugin/adapter-plugins/dubbo-plugin/pom.xml
deleted file mode 100644
index 5304c6eb..00000000
--- a/agent/hippo4j-agent-plugin/adapter-plugins/dubbo-plugin/pom.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
- hippo4j-agent-adapter-plugins
- cn.hippo4j
- ${revision}
-
- 4.0.0
-
- dubbo-plugin
-
-
-
- org.apache.dubbo
- dubbo
- provided
-
-
-
- cn.hippo4j
- hippo4j-threadpool-infra-common
- ${project.version}
-
-
-
-
-
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/adapter-plugins/dubbo-plugin/src/main/java/cn/hippo4j/agent/adapter/dubbo/DubboThreadPoolAdapter.java b/agent/hippo4j-agent-plugin/adapter-plugins/dubbo-plugin/src/main/java/cn/hippo4j/agent/adapter/dubbo/DubboThreadPoolAdapter.java
deleted file mode 100644
index 6ba5045e..00000000
--- a/agent/hippo4j-agent-plugin/adapter-plugins/dubbo-plugin/src/main/java/cn/hippo4j/agent/adapter/dubbo/DubboThreadPoolAdapter.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.adapter.dubbo;
-
-import cn.hippo4j.common.executor.ThreadPoolExecutorRegistry;
-import cn.hippo4j.common.executor.support.BlockingQueueTypeEnum;
-import cn.hippo4j.common.executor.support.RejectedPolicyTypeEnum;
-import cn.hippo4j.common.model.executor.ExecutorProperties;
-import cn.hippo4j.common.toolkit.BooleanUtil;
-import cn.hippo4j.common.toolkit.ReflectUtil;
-import java.util.Map;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ThreadPoolExecutor;
-import org.apache.dubbo.common.Version;
-import org.apache.dubbo.common.extension.ExtensionLoader;
-import org.apache.dubbo.common.store.DataStore;
-import org.apache.dubbo.common.threadpool.manager.ExecutorRepository;
-
-/**
- * Dubbo thread-pool adapter.
- */
-public class DubboThreadPoolAdapter {
-
- public static void registerExecutors() {
- boolean isLegacyVersion = true;
- String poolKey = ExecutorService.class.getName();
- // Since 2.7.5, Dubbo has changed the way thread pools are used
- // fixed https://github.com/opengoofy/hippo4j/issues/708
- try {
- if (Version.getIntVersion(Version.getVersion()) < 2070500) {
- isLegacyVersion = false;
- }
- } catch (Exception ex) {
- }
-
- try {
- if (isLegacyVersion) {
- DataStore dataStore = ExtensionLoader.getExtensionLoader(DataStore.class).getDefaultExtension();
- Map executors = dataStore.get(poolKey);
- executors.forEach((key, value) -> putHolder(mark() + key, (ThreadPoolExecutor) value));
- return;
- }
- ExecutorRepository executorRepository = ExtensionLoader.getExtensionLoader(ExecutorRepository.class).getDefaultExtension();
- ConcurrentMap> data =
- (ConcurrentMap>) ReflectUtil.getFieldValue(executorRepository, "data");
- ConcurrentMap executorServiceMap = data.get(poolKey);
- executorServiceMap.forEach((key, value) -> putHolder(mark() + key, (ThreadPoolExecutor) value));
- } catch (Exception ex) {
- }
- }
-
- private static void putHolder(String executorName, ThreadPoolExecutor executor) {
- if (executor == null) {
- return;
- }
- ExecutorProperties executorProperties = ExecutorProperties.builder()
- .threadPoolId(executorName)
- .corePoolSize(executor.getCorePoolSize())
- .maximumPoolSize(executor.getMaximumPoolSize())
- .allowCoreThreadTimeOut(BooleanUtil.toBoolean(String.valueOf(executor.allowsCoreThreadTimeOut())))
- .blockingQueue(BlockingQueueTypeEnum.getBlockingQueueTypeEnumByName(executor.getQueue().getClass().getSimpleName()).getName())
- .queueCapacity(executor.getQueue().remainingCapacity())
- .rejectedHandler(RejectedPolicyTypeEnum.getRejectedPolicyTypeEnumByName(executor.getRejectedExecutionHandler().getClass().getSimpleName()).getName())
- .build();
- ThreadPoolExecutorRegistry.putHolder(executorName, executor, executorProperties);
- }
-
- public static String mark() {
- return "Dubbo";
- }
-}
diff --git a/agent/hippo4j-agent-plugin/adapter-plugins/pom.xml b/agent/hippo4j-agent-plugin/adapter-plugins/pom.xml
deleted file mode 100644
index 1c52b2e9..00000000
--- a/agent/hippo4j-agent-plugin/adapter-plugins/pom.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
- 4.0.0
-
- cn.hippo4j
- hippo4j-agent-plugin
- ${revision}
-
-
- hippo4j-agent-adapter-plugins
- pom
-
-
- 8
- 8
- UTF-8
-
-
-
- dubbo-plugin
-
-
-
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/apollo-plugin/pom.xml b/agent/hippo4j-agent-plugin/apollo-plugin/pom.xml
deleted file mode 100644
index 67ddd9c6..00000000
--- a/agent/hippo4j-agent-plugin/apollo-plugin/pom.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
- 4.0.0
-
- cn.hippo4j
- hippo4j-agent-plugin
- ${revision}
-
-
- hippo4j-agent-apollo-plugin
-
-
- 1.9.1
-
-
-
-
- cn.hippo4j
- hippo4j-agent-spring-plugin-common
- ${project.version}
-
-
- cn.hippo4j
- hippo4j-threadpool-dynamic-mode-config
- ${project.version}
-
-
- com.ctrip.framework.apollo
- apollo-client
- ${apollo.version}
- provided
-
-
-
-
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/apollo-plugin/src/main/java/cn/hippo4j/agent/plugin/apollo/ApolloDynamicThreadPoolChangeHandler.java b/agent/hippo4j-agent-plugin/apollo-plugin/src/main/java/cn/hippo4j/agent/plugin/apollo/ApolloDynamicThreadPoolChangeHandler.java
deleted file mode 100644
index 77784263..00000000
--- a/agent/hippo4j-agent-plugin/apollo-plugin/src/main/java/cn/hippo4j/agent/plugin/apollo/ApolloDynamicThreadPoolChangeHandler.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.apollo;
-
-import cn.hippo4j.agent.plugin.spring.common.conf.SpringBootConfig;
-import cn.hippo4j.agent.plugin.spring.common.toolkit.SpringPropertyBinder;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.threadpool.dynamic.mode.config.properties.BootstrapConfigProperties;
-import cn.hippo4j.threadpool.dynamic.mode.config.refresher.AbstractConfigThreadPoolDynamicRefresh;
-import com.ctrip.framework.apollo.Config;
-import com.ctrip.framework.apollo.ConfigChangeListener;
-import com.ctrip.framework.apollo.ConfigFile;
-import com.ctrip.framework.apollo.ConfigService;
-import com.ctrip.framework.apollo.core.enums.ConfigFileFormat;
-import com.ctrip.framework.apollo.model.ConfigChange;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static cn.hippo4j.agent.core.conf.Constants.SPRING_BOOT_CONFIG_PREFIX;
-
-/**
- * Dynamic thread pool change handler
- */
-public class ApolloDynamicThreadPoolChangeHandler extends AbstractConfigThreadPoolDynamicRefresh {
-
- private static final ILog LOGGER = LogManager.getLogger(ApolloDynamicThreadPoolChangeHandler.class);
-
- /**
- * Registers a listener with Apollo to monitor for changes in the thread pool configuration.
- */
- @Override
- public void registerListener() {
- List apolloNamespaces = SpringBootConfig.Spring.Dynamic.Thread_Pool.Apollo.NAMESPACE;
- String namespace = apolloNamespaces.get(0);
- String configFileType = SpringBootConfig.Spring.Dynamic.Thread_Pool.CONFIG_FILE_TYPE;
- Config config = ConfigService.getConfig(String.format("%s.%s", namespace, configFileType));
- ConfigChangeListener configChangeListener = configChangeEvent -> {
- String replacedNamespace = namespace.replaceAll("." + configFileType, "");
- ConfigFileFormat configFileFormat = ConfigFileFormat.fromString(configFileType);
- ConfigFile configFile = ConfigService.getConfigFile(replacedNamespace, configFileFormat);
- Map newChangeValueMap = new HashMap<>();
- configChangeEvent.changedKeys().stream().filter(each -> each.contains(SPRING_BOOT_CONFIG_PREFIX)).forEach(each -> {
- ConfigChange change = configChangeEvent.getChange(each);
- String newValue = change.getNewValue();
- newChangeValueMap.put(each, newValue);
- });
- dynamicRefresh(configFileType, configFile.getContent(), newChangeValueMap);
- };
- config.addChangeListener(configChangeListener);
- LOGGER.info("[Hippo4j-Agent] Dynamic thread pool refresher, add apollo listener success. namespace: {}", namespace);
- }
-
- /**
- * Builds and binds the {@link BootstrapConfigProperties} from the given configuration map.
- *
- * This method uses SpringPropertyBinder to bind the configuration values to an instance
- * of {@link BootstrapConfigProperties}, which can then be used to configure the thread pool
- * dynamically.
- *
- * @param configInfo the configuration map containing properties to bind.
- * @return the bound {@link BootstrapConfigProperties} instance.
- */
- @Override
- public BootstrapConfigProperties buildBootstrapProperties(Map configInfo) {
- BootstrapConfigProperties bindableBootstrapConfigProperties = SpringPropertyBinder.bindProperties(configInfo, BootstrapConfigProperties.PREFIX, BootstrapConfigProperties.class);
- return bindableBootstrapConfigProperties;
- }
-}
diff --git a/agent/hippo4j-agent-plugin/apollo-plugin/src/main/java/cn/hippo4j/agent/plugin/apollo/boot/ApolloPluginBootService.java b/agent/hippo4j-agent-plugin/apollo-plugin/src/main/java/cn/hippo4j/agent/plugin/apollo/boot/ApolloPluginBootService.java
deleted file mode 100644
index 20d7551f..00000000
--- a/agent/hippo4j-agent-plugin/apollo-plugin/src/main/java/cn/hippo4j/agent/plugin/apollo/boot/ApolloPluginBootService.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.apollo.boot;
-
-import cn.hippo4j.agent.core.boot.BootService;
-import cn.hippo4j.agent.core.boot.DefaultImplementor;
-
-/**
- * Apollo plugin boot service
- */
-@DefaultImplementor
-public class ApolloPluginBootService implements BootService {
-
- @Override
- public void prepare() throws Throwable {
-
- }
-
- @Override
- public void boot() throws Throwable {
-
- }
-
- @Override
- public void onComplete() throws Throwable {
-
- }
-
- @Override
- public void shutdown() throws Throwable {
-
- }
-}
diff --git a/agent/hippo4j-agent-plugin/apollo-plugin/src/main/java/cn/hippo4j/agent/plugin/apollo/define/ApolloInstrumentation.java b/agent/hippo4j-agent-plugin/apollo-plugin/src/main/java/cn/hippo4j/agent/plugin/apollo/define/ApolloInstrumentation.java
deleted file mode 100644
index 76579b47..00000000
--- a/agent/hippo4j-agent-plugin/apollo-plugin/src/main/java/cn/hippo4j/agent/plugin/apollo/define/ApolloInstrumentation.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.apollo.define;
-
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
-import cn.hippo4j.agent.core.plugin.match.ClassMatch;
-import cn.hippo4j.agent.core.plugin.match.NameMatch;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-import static net.bytebuddy.matcher.ElementMatchers.any;
-
-/**
- * Apollo instrumentation
- */
-public class ApolloInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
-
- private static final String ENHANCE_CLASS = "com.ctrip.framework.apollo.internals.DefaultConfig";
-
- private static final String CONSTRUCTOR_INTERCEPT_CLASS = "cn.hippo4j.agent.plugin.apollo.interceptor.ApolloConfigConstructorInterceptor";
-
- @Override
- protected ClassMatch enhanceClass() {
- return NameMatch.byName(ENHANCE_CLASS);
- }
-
- @Override
- public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
- return new ConstructorInterceptPoint[]{
- new ConstructorInterceptPoint() {
-
- @Override
- public ElementMatcher getConstructorMatcher() {
- return any();
- }
-
- @Override
- public String getConstructorInterceptor() {
- return CONSTRUCTOR_INTERCEPT_CLASS;
- }
- }
- };
- }
-
- @Override
- public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
- return new InstanceMethodsInterceptPoint[0];
- }
-}
diff --git a/agent/hippo4j-agent-plugin/apollo-plugin/src/main/java/cn/hippo4j/agent/plugin/apollo/interceptor/ApolloConfigConstructorInterceptor.java b/agent/hippo4j-agent-plugin/apollo-plugin/src/main/java/cn/hippo4j/agent/plugin/apollo/interceptor/ApolloConfigConstructorInterceptor.java
deleted file mode 100644
index 16c3dced..00000000
--- a/agent/hippo4j-agent-plugin/apollo-plugin/src/main/java/cn/hippo4j/agent/plugin/apollo/interceptor/ApolloConfigConstructorInterceptor.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.apollo.interceptor;
-
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
-import cn.hippo4j.agent.plugin.apollo.listeners.ApolloConfigPropertiesLoaderCompletedListener;
-import cn.hippo4j.common.extension.design.AbstractSubjectCenter;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * Default config constructor interceptor
- */
-public class ApolloConfigConstructorInterceptor implements InstanceConstructorInterceptor {
-
- private static final AtomicBoolean isExecuted = new AtomicBoolean(false);
-
- @Override
- public void onConstruct(EnhancedInstance objInst, Object[] allArguments) throws Throwable {
-
- // This logic will only be executed once
- if (isExecuted.compareAndSet(false, true)) {
- // The Apollo plugin triggers before the Spring configuration plug-in.
- // This means that when the Apollo plug-in executes, Spring's Environment is not yet ready,
- // so the configuration cannot be read
- // After listening to the AGENT_SPRING_PROPERTIES_LOADER_COMPLETED event, register the listener for Apollo
- AbstractSubjectCenter.register(AbstractSubjectCenter.SubjectType.AGENT_SPRING_PROPERTIES_LOADER_COMPLETED,
- new ApolloConfigPropertiesLoaderCompletedListener());
- }
- }
-}
diff --git a/agent/hippo4j-agent-plugin/apollo-plugin/src/main/java/cn/hippo4j/agent/plugin/apollo/listeners/ApolloConfigPropertiesLoaderCompletedListener.java b/agent/hippo4j-agent-plugin/apollo-plugin/src/main/java/cn/hippo4j/agent/plugin/apollo/listeners/ApolloConfigPropertiesLoaderCompletedListener.java
deleted file mode 100644
index 8bef9193..00000000
--- a/agent/hippo4j-agent-plugin/apollo-plugin/src/main/java/cn/hippo4j/agent/plugin/apollo/listeners/ApolloConfigPropertiesLoaderCompletedListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.apollo.listeners;
-
-import cn.hippo4j.agent.plugin.apollo.ApolloDynamicThreadPoolChangeHandler;
-import cn.hippo4j.common.extension.design.Observer;
-import cn.hippo4j.common.extension.design.ObserverMessage;
-import cn.hippo4j.threadpool.dynamic.api.ThreadPoolDynamicRefresh;
-
-/**
- * Apollo Config Properties Loader Completed Listener
- */
-public class ApolloConfigPropertiesLoaderCompletedListener implements Observer {
-
- @Override
- public void accept(ObserverMessage observerMessage) {
- ThreadPoolDynamicRefresh dynamicRefresh = new ApolloDynamicThreadPoolChangeHandler();
- dynamicRefresh.registerListener();
- }
-}
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/apollo-plugin/src/main/resources/META-INF/services/cn.hippo4j.agent.core.boot.BootService b/agent/hippo4j-agent-plugin/apollo-plugin/src/main/resources/META-INF/services/cn.hippo4j.agent.core.boot.BootService
deleted file mode 100644
index 8832c467..00000000
--- a/agent/hippo4j-agent-plugin/apollo-plugin/src/main/resources/META-INF/services/cn.hippo4j.agent.core.boot.BootService
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-cn.hippo4j.agent.plugin.apollo.boot.ApolloPluginBootService
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/apollo-plugin/src/main/resources/hippo4j-plugin.def b/agent/hippo4j-agent-plugin/apollo-plugin/src/main/resources/hippo4j-plugin.def
deleted file mode 100644
index ede6239b..00000000
--- a/agent/hippo4j-agent-plugin/apollo-plugin/src/main/resources/hippo4j-plugin.def
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-apollo-plugin=cn.hippo4j.agent.plugin.apollo.define.ApolloInstrumentation
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/nacos-plugin/pom.xml b/agent/hippo4j-agent-plugin/nacos-plugin/pom.xml
deleted file mode 100644
index 986f041e..00000000
--- a/agent/hippo4j-agent-plugin/nacos-plugin/pom.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
- 4.0.0
-
- cn.hippo4j
- hippo4j-agent-plugin
- ${revision}
-
-
- hippo4j-agent-nacos-plugin
-
-
- 2.2.1
-
-
-
-
- cn.hippo4j
- hippo4j-agent-spring-plugin-common
- ${project.version}
-
-
- cn.hippo4j
- hippo4j-threadpool-dynamic-mode-config
- ${project.version}
-
-
- org.springframework
- spring-context
- provided
-
-
- com.alibaba.nacos
- nacos-client
- ${nacos.version}
- provided
-
-
-
-
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/NacosDynamicThreadPoolChangeHandler.java b/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/NacosDynamicThreadPoolChangeHandler.java
deleted file mode 100644
index 691719ec..00000000
--- a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/NacosDynamicThreadPoolChangeHandler.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.nacos;
-
-import cn.hippo4j.agent.plugin.spring.common.conf.NacosCloudConfig;
-import cn.hippo4j.agent.plugin.spring.common.conf.NacosConfig;
-import cn.hippo4j.agent.plugin.spring.common.conf.SpringBootConfig;
-import cn.hippo4j.agent.plugin.spring.common.toolkit.SpringPropertyBinder;
-import cn.hippo4j.common.executor.ThreadFactoryBuilder;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.common.toolkit.StringUtil;
-import cn.hippo4j.threadpool.dynamic.mode.config.parser.ConfigParserHandler;
-import cn.hippo4j.threadpool.dynamic.mode.config.properties.BootstrapConfigProperties;
-import cn.hippo4j.threadpool.dynamic.mode.config.refresher.AbstractConfigThreadPoolDynamicRefresh;
-import com.alibaba.nacos.api.NacosFactory;
-import com.alibaba.nacos.api.PropertyKeyConst;
-import com.alibaba.nacos.api.config.ConfigService;
-import com.alibaba.nacos.api.config.listener.Listener;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Properties;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-
-import static cn.hippo4j.common.constant.Constants.DEFAULT_NAMESPACE_ID;
-
-/**
- * NacosDynamicThreadPoolChangeHandler is responsible for handling dynamic thread pool
- * configuration changes in a Spring environment by listening to configuration updates from Nacos.
- *
- * This class extends {@link AbstractConfigThreadPoolDynamicRefresh} and implements the logic
- * to register a Nacos listener, handle configuration changes, and dynamically refresh the thread pool
- * properties based on the new configuration.
- *
- */
-public class NacosDynamicThreadPoolChangeHandler extends AbstractConfigThreadPoolDynamicRefresh {
-
- private static final ILog LOGGER = LogManager.getLogger(NacosDynamicThreadPoolChangeHandler.class);
-
- /**
- * Registers a listener with Nacos to monitor for changes in the thread pool configuration.
- *
- * This method sets up the Nacos {@link ConfigService} with the server address and namespace
- * from the Spring Boot configuration. It then adds a listener that will receive and process
- * configuration updates, triggering a dynamic refresh of thread pool settings.
- */
- @Override
- public void registerListener() {
- // Retrieve necessary configuration properties
- String configFileType = SpringBootConfig.Spring.Dynamic.Thread_Pool.CONFIG_FILE_TYPE;
- String serverAddr = Optional.ofNullable(NacosCloudConfig.Spring.Cloud.Nacos.Config.SERVER_ADDR).filter(s -> !StringUtil.isEmpty(s))
- .orElse(Optional.ofNullable(NacosConfig.Nacos.Config.SERVER_ADDR).filter(s -> !StringUtil.isEmpty(s))
- .orElse(""));
- if (StringUtil.isEmpty(serverAddr)) {
- LOGGER.error("[Hippo4j-Agent] add Nacos listener failure. Nacos Registry address not configured");
- return;
- }
- String dataId = SpringBootConfig.Spring.Dynamic.Thread_Pool.Nacos.DATA_ID;
- String group = SpringBootConfig.Spring.Dynamic.Thread_Pool.Nacos.GROUP;
- String namespace = SpringBootConfig.Spring.Dynamic.Thread_Pool.Nacos.NAMESPACE.get(0);
- namespace = namespace.equals(DEFAULT_NAMESPACE_ID) ? "" : namespace;
- try {
- // Initialize Nacos ConfigService with the provided properties
- Properties properties = new Properties();
- properties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);
- properties.put(PropertyKeyConst.NAMESPACE, namespace);
- ConfigService configService = NacosFactory.createConfigService(properties);
-
- // Define the listener to handle configuration changes
- Listener configChangeListener = new Listener() {
-
- @Override
- public void receiveConfigInfo(String configInfo) {
- LOGGER.debug("Received configuration: " + configInfo);
- Map changeValueMap = new HashMap<>();
- try {
- // Parse the configuration and map the values to the appropriate keys
- Map configInfoMap = ConfigParserHandler.getInstance().parseConfig(configInfo, configFileType);
- configInfoMap.forEach((key, value) -> {
- if (key instanceof String) {
- changeValueMap.put((String) key, value);
- }
- });
- } catch (IOException e) {
- LOGGER.error(e, "[Hippo4j-Agent] Dynamic thread pool refresher, Failed to resolve configuration. configFileType: {} configInfo: {} ", configFileType, configInfo);
- }
- // Trigger the dynamic refresh with the parsed configuration
- dynamicRefresh(configFileType, configInfo, changeValueMap);
- }
-
- @Override
- public Executor getExecutor() {
- return new ScheduledThreadPoolExecutor(1, ThreadFactoryBuilder.builder().daemon(true).prefix("client.dynamic.refresh.agent").build());
- }
- };
- // Add the listener to the Nacos ConfigService
- configService.addListener(dataId, group, configChangeListener);
- LOGGER.info("[Hippo4j-Agent] Dynamic thread pool refresher, add Nacos listener successfully. serverAddr: {} namespace: {} data-id: {} group: {}", serverAddr, namespace, dataId, group);
- } catch (Exception e) {
- LOGGER.error(e, "[Hippo4j-Agent] Dynamic thread pool refresher, add Nacos listener failure. serverAddr: {} namespace: {} data-id: {} group: {}", serverAddr, namespace, dataId, group);
- }
- }
-
- /**
- * Builds and binds the {@link BootstrapConfigProperties} from the given configuration map.
- *
- * This method uses SpringPropertyBinder to bind the configuration values to an instance
- * of {@link BootstrapConfigProperties}, which can then be used to configure the thread pool
- * dynamically.
- *
- * @param configInfo the configuration map containing properties to bind.
- * @return the bound {@link BootstrapConfigProperties} instance.
- */
- @Override
- public BootstrapConfigProperties buildBootstrapProperties(Map configInfo) {
- BootstrapConfigProperties bindableBootstrapConfigProperties = SpringPropertyBinder.bindProperties(configInfo, BootstrapConfigProperties.PREFIX, BootstrapConfigProperties.class);
- return bindableBootstrapConfigProperties;
- }
-}
diff --git a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/boot/NacosPluginBootService.java b/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/boot/NacosPluginBootService.java
deleted file mode 100644
index 65fe2a47..00000000
--- a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/boot/NacosPluginBootService.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.nacos.boot;
-
-import cn.hippo4j.agent.core.boot.BootService;
-import cn.hippo4j.agent.core.boot.DefaultImplementor;
-
-/**
- * Nacos plugin boot service
- */
-@DefaultImplementor
-public class NacosPluginBootService implements BootService {
-
- @Override
- public void prepare() throws Throwable {
-
- }
-
- @Override
- public void boot() throws Throwable {
-
- }
-
- @Override
- public void onComplete() throws Throwable {
-
- }
-
- @Override
- public void shutdown() throws Throwable {
-
- }
-}
diff --git a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/define/NacosCloudAdapterInstrumentation.java b/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/define/NacosCloudAdapterInstrumentation.java
deleted file mode 100644
index 6fe99477..00000000
--- a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/define/NacosCloudAdapterInstrumentation.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.nacos.define;
-
-import cn.hippo4j.agent.core.plugin.WitnessMethod;
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
-import cn.hippo4j.agent.core.plugin.match.ClassMatch;
-import cn.hippo4j.agent.core.plugin.match.NameMatch;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-import java.util.Collections;
-import java.util.List;
-
-import static net.bytebuddy.matcher.ElementMatchers.named;
-
-public class NacosCloudAdapterInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
-
- private static final String ENHANCE_CLASS = "org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration";
-
- private static final String INSTANCE_METHODS_INTERCEPT_CLASS = "cn.hippo4j.agent.plugin.nacos.interceptor.NacosCloudAdapterConfigInstanceMethodInterceptor";
-
- @Override
- protected ClassMatch enhanceClass() {
- return NameMatch.byName(ENHANCE_CLASS);
- }
-
- @Override
- public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
- return new ConstructorInterceptPoint[0];
- }
-
- @Override
- public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
- return new InstanceMethodsInterceptPoint[]{new InstanceMethodsInterceptPoint() {
-
- @Override
- public ElementMatcher getMethodsMatcher() {
- return named("initialize");
- }
-
- @Override
- public String getMethodsInterceptor() {
- return INSTANCE_METHODS_INTERCEPT_CLASS;
- }
-
- @Override
- public boolean isOverrideArgs() {
- return false;
- }
- }};
- }
-
- @Override
- protected List witnessMethods() {
- return Collections.singletonList(new WitnessMethod("com.alibaba.cloud.nacos.client.NacosPropertySourceLocator", named("locate")));
- }
-}
diff --git a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/define/NacosInstrumentation.java b/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/define/NacosInstrumentation.java
deleted file mode 100644
index d33c6031..00000000
--- a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/define/NacosInstrumentation.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.nacos.define;
-
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
-import cn.hippo4j.agent.core.plugin.match.ClassMatch;
-import cn.hippo4j.agent.core.plugin.match.NameMatch;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-import static net.bytebuddy.matcher.ElementMatchers.any;
-
-/**
- * Nacos instrumentation
- */
-public class NacosInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
-
- private static final String ENHANCE_CLASS = "com.alibaba.nacos.client.config.NacosConfigService";
-
- private static final String CONSTRUCTOR_INTERCEPT_CLASS = "cn.hippo4j.agent.plugin.nacos.interceptor.NacosConfigConstructorInterceptor";
-
- @Override
- protected ClassMatch enhanceClass() {
- return NameMatch.byName(ENHANCE_CLASS);
- }
-
- @Override
- public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
- return new ConstructorInterceptPoint[]{
- new ConstructorInterceptPoint() {
-
- @Override
- public ElementMatcher getConstructorMatcher() {
- return any();
- }
-
- @Override
- public String getConstructorInterceptor() {
- return CONSTRUCTOR_INTERCEPT_CLASS;
- }
- }
- };
- }
-
- @Override
- public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
- return new InstanceMethodsInterceptPoint[0];
- }
-}
diff --git a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/interceptor/NacosCloudAdapterConfigInstanceMethodInterceptor.java b/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/interceptor/NacosCloudAdapterConfigInstanceMethodInterceptor.java
deleted file mode 100644
index 9a227edf..00000000
--- a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/interceptor/NacosCloudAdapterConfigInstanceMethodInterceptor.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.nacos.interceptor;
-
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
-import cn.hippo4j.agent.plugin.spring.common.support.SpringPropertiesLoader;
-import cn.hippo4j.agent.plugin.spring.common.support.SpringThreadPoolRegisterSupport;
-import cn.hippo4j.core.config.ApplicationContextHolder;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.core.env.ConfigurableEnvironment;
-
-import java.lang.reflect.Method;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * Nacos Cloud config constructor interceptor
- */
-public class NacosCloudAdapterConfigInstanceMethodInterceptor implements InstanceMethodsAroundInterceptor {
-
- private static final AtomicBoolean isExecuted = new AtomicBoolean(false);
-
- @Override
- public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
-
- }
-
- @Override
- public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Object ret) throws Throwable {
- // This logic will only be executed once
- if (isExecuted.compareAndSet(false, true)) {
- // Get the configurable Application Context
- ConfigurableApplicationContext configurableApplicationContext = (ConfigurableApplicationContext) allArguments[0];
- ConfigurableEnvironment environment = configurableApplicationContext.getEnvironment();
-
- // Remote Nacos configuration swiped into SpringPropertiesLoader
- SpringPropertiesLoader.loadSpringProperties(environment);
- // Refresh thread pool instances through configuration
- SpringThreadPoolRegisterSupport.registerThreadPoolInstances(ApplicationContextHolder.getInstance());
-
- }
- return ret;
- }
-
- @Override
- public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Throwable t) {
-
- }
-}
diff --git a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/interceptor/NacosConfigConstructorInterceptor.java b/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/interceptor/NacosConfigConstructorInterceptor.java
deleted file mode 100644
index e4379ce8..00000000
--- a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/interceptor/NacosConfigConstructorInterceptor.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.nacos.interceptor;
-
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
-import cn.hippo4j.agent.plugin.nacos.NacosDynamicThreadPoolChangeHandler;
-import cn.hippo4j.agent.plugin.nacos.listeners.NacosConfigPropertiesLoaderCompletedListener;
-import cn.hippo4j.agent.plugin.spring.common.support.SpringPropertiesLoader;
-import cn.hippo4j.common.extension.design.AbstractSubjectCenter;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * Nacos config constructor interceptor
- */
-public class NacosConfigConstructorInterceptor implements InstanceConstructorInterceptor {
-
- private static final AtomicBoolean isExecuted = new AtomicBoolean(false);
-
- @Override
- public void onConstruct(EnhancedInstance objInst, Object[] allArguments) throws Throwable {
- // This logic will only be executed once
- if (isExecuted.compareAndSet(false, true)) {
-
- // Determine whether SpringPropertiesLoader is initialized
- AtomicBoolean active = SpringPropertiesLoader.getActive();
-
- // For Nacos-Cloud, the SpringPropertiesLoader environment initialization is triggered first, and then the logic to register listeners is triggered
- // For Nacos-Boot, the listener is registered first, and the SpringPropertiesLoader environment is initialized
- if (Boolean.TRUE.equals(active.get())) {
- new NacosDynamicThreadPoolChangeHandler().registerListener();
- return;
- }
-
- // The Nacos plugin triggers before the Spring configuration plug-in.
- // This means that when the Nacos plugin executes, Spring's Environment is not yet ready,
- // so the configuration cannot be read
- // After listening to the AGENT_SPRING_PROPERTIES_LOADER_COMPLETED event, register the listener for Nacos
- AbstractSubjectCenter.register(AbstractSubjectCenter.SubjectType.AGENT_SPRING_PROPERTIES_LOADER_COMPLETED, new NacosConfigPropertiesLoaderCompletedListener());
- }
- }
-}
diff --git a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/listeners/NacosConfigPropertiesLoaderCompletedListener.java b/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/listeners/NacosConfigPropertiesLoaderCompletedListener.java
deleted file mode 100644
index fa7a795b..00000000
--- a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/java/cn/hippo4j/agent/plugin/nacos/listeners/NacosConfigPropertiesLoaderCompletedListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.nacos.listeners;
-
-import cn.hippo4j.agent.plugin.nacos.NacosDynamicThreadPoolChangeHandler;
-import cn.hippo4j.common.extension.design.Observer;
-import cn.hippo4j.common.extension.design.ObserverMessage;
-import cn.hippo4j.threadpool.dynamic.api.ThreadPoolDynamicRefresh;
-
-/**
- * Nacos Config Properties Loader Completed Listener
- */
-public class NacosConfigPropertiesLoaderCompletedListener implements Observer {
-
- @Override
- public void accept(ObserverMessage observerMessage) {
- ThreadPoolDynamicRefresh dynamicRefresh = new NacosDynamicThreadPoolChangeHandler();
- dynamicRefresh.registerListener();
- }
-}
diff --git a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/resources/META-INF/services/cn.hippo4j.agent.core.boot.BootService b/agent/hippo4j-agent-plugin/nacos-plugin/src/main/resources/META-INF/services/cn.hippo4j.agent.core.boot.BootService
deleted file mode 100644
index 5337b3b0..00000000
--- a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/resources/META-INF/services/cn.hippo4j.agent.core.boot.BootService
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-cn.hippo4j.agent.plugin.nacos.boot.NacosPluginBootService
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/resources/hippo4j-plugin.def b/agent/hippo4j-agent-plugin/nacos-plugin/src/main/resources/hippo4j-plugin.def
deleted file mode 100644
index fb175826..00000000
--- a/agent/hippo4j-agent-plugin/nacos-plugin/src/main/resources/hippo4j-plugin.def
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-nacos-plugin=cn.hippo4j.agent.plugin.nacos.define.NacosInstrumentation
-nacos-cloud-adapter-plugin=cn.hippo4j.agent.plugin.nacos.define.NacosCloudAdapterInstrumentation
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/pom.xml b/agent/hippo4j-agent-plugin/pom.xml
deleted file mode 100644
index b2bae3f4..00000000
--- a/agent/hippo4j-agent-plugin/pom.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
- 4.0.0
-
- cn.hippo4j
- hippo4j-agent
- ${revision}
-
-
- hippo4j-agent-plugin
- pom
-
- spring-plugins
- threadpool-plugin
- adapter-plugins
- apollo-plugin
- nacos-plugin
-
-
-
- UTF-8
-
- net.bytebuddy
- ${shade.package}.${shade.net.bytebuddy.source}
-
- ${project.build.directory}${sdk.plugin.related.dir}/../../../hippo4j-agent
-
- ${agent.package.dest.dir}/plugins
-
- 1.0b3
- 1.8.1
-
-
-
-
- cn.hippo4j
- hippo4j-agent-core
- ${project.version}
-
-
- org.springframework
- spring-core
-
-
- provided
-
-
- net.bytebuddy
- byte-buddy
- provided
-
-
-
-
-
-
- maven-shade-plugin
-
-
- package
-
- shade
-
-
- false
- true
- true
- true
-
-
- ${shade.net.bytebuddy.source}
- ${shade.net.bytebuddy.target}
-
-
-
-
-
-
-
- maven-antrun-plugin
-
-
- package
-
- run
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ant-contrib
- ant-contrib
- ${ant-contrib.version}
-
-
- ant
- ant
-
-
-
-
- org.apache.ant
- ant-nodeps
- ${ant-nodeps.version}
-
-
-
-
-
-
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/pom.xml b/agent/hippo4j-agent-plugin/spring-plugins/pom.xml
deleted file mode 100644
index f9ff2a2a..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/pom.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
- 4.0.0
-
- cn.hippo4j
- hippo4j-agent-plugin
- ${revision}
-
-
- hippo4j-agent-spring-plugins
- pom
-
-
- spring-boot-1x-plugin
- spring-boot-2x-plugin
- spring-boot-3x-plugin
- spring-plugin-common
-
-
-
- UTF-8
- /..
-
-
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/pom.xml b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/pom.xml
deleted file mode 100644
index 1a020f30..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/pom.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
- 4.0.0
-
- cn.hippo4j
- hippo4j-agent-spring-plugins
- ${revision}
-
-
- hippo4j-agent-spring-boot-1x-plugin
-
-
- 1.5.22.RELEASE
-
-
-
-
-
- org.springframework.boot
- spring-boot-dependencies
- ${spring.boot.version}
- pom
- import
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-starter
- ${spring.boot.version}
- provided
-
-
-
- cn.hippo4j
- hippo4j-agent-spring-plugin-common
- ${project.version}
-
-
-
- cn.hippo4j
- dubbo-plugin
-
-
-
-
-
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v1/boot/SpringBootV1PluginBootService.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v1/boot/SpringBootV1PluginBootService.java
deleted file mode 100644
index 2ab4a1c3..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v1/boot/SpringBootV1PluginBootService.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.boot.v1.boot;
-
-import cn.hippo4j.agent.core.boot.BootService;
-import cn.hippo4j.agent.core.boot.DefaultImplementor;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-
-/**
- * SpringBoot v1 plugin boot service
- */
-@DefaultImplementor
-public class SpringBootV1PluginBootService implements BootService {
-
- private static final ILog LOGGER = LogManager.getLogger(SpringBootV1PluginBootService.class);
-
- @Override
- public void prepare() throws Throwable {
-
- }
-
- @Override
- public void boot() throws Throwable {
- LOGGER.info("Loader SpringBootV1PluginBootService...");
- }
-
- @Override
- public void onComplete() throws Throwable {
-
- }
-
- @Override
- public void shutdown() throws Throwable {
-
- }
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v1/define/EventPublishingRunListenerInstrumentationV1.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v1/define/EventPublishingRunListenerInstrumentationV1.java
deleted file mode 100644
index a87dd732..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v1/define/EventPublishingRunListenerInstrumentationV1.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.boot.v1.define;
-
-import cn.hippo4j.agent.core.plugin.WitnessMethod;
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
-import cn.hippo4j.agent.core.plugin.match.ClassMatch;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-import java.util.Collections;
-import java.util.List;
-
-import static cn.hippo4j.agent.core.plugin.match.NameMatch.byName;
-import static net.bytebuddy.matcher.ElementMatchers.named;
-
-/**
- * SpringBoot v1 EventPublishingRunListener Finished instrumentation
- */
-public class EventPublishingRunListenerInstrumentationV1 extends ClassInstanceMethodsEnhancePluginDefine {
-
- private static final String ENHANCE_CLASS = "org.springframework.boot.context.event.EventPublishingRunListener";
-
- private static final String EVENT_PUBLISHING_FINISHED_INTERCEPTOR_V1 = "cn.hippo4j.agent.plugin.spring.boot.v1.interceptor.EventPublishingRunListenerFinishedInterceptorV1";
-
- @Override
- protected ClassMatch enhanceClass() {
- return byName(ENHANCE_CLASS);
- }
-
- @Override
- public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
- return new ConstructorInterceptPoint[0];
- }
-
- @Override
- public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
- return new InstanceMethodsInterceptPoint[]{new InstanceMethodsInterceptPoint() {
-
- @Override
- public ElementMatcher getMethodsMatcher() {
- return named("finished");
- }
-
- @Override
- public String getMethodsInterceptor() {
- return EVENT_PUBLISHING_FINISHED_INTERCEPTOR_V1;
- }
-
- @Override
- public boolean isOverrideArgs() {
- return false;
- }
- }};
- }
-
- @Override
- protected List witnessMethods() {
- return Collections.singletonList(new WitnessMethod("org.springframework.boot.context.event.EventPublishingRunListener", named("finished")));
- }
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v1/interceptor/EventPublishingRunListenerFinishedInterceptorV1.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v1/interceptor/EventPublishingRunListenerFinishedInterceptorV1.java
deleted file mode 100644
index 9d268d34..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v1/interceptor/EventPublishingRunListenerFinishedInterceptorV1.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.boot.v1.interceptor;
-
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
-import cn.hippo4j.agent.plugin.spring.common.event.DynamicThreadPoolRefreshListener;
-import cn.hippo4j.agent.plugin.spring.common.support.SpringPropertiesLoader;
-import cn.hippo4j.agent.plugin.spring.common.support.SpringThreadPoolRegisterSupport;
-import cn.hippo4j.common.extension.design.AbstractSubjectCenter;
-import cn.hippo4j.core.config.ApplicationContextHolder;
-import org.springframework.context.ApplicationListener;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.event.ContextRefreshedEvent;
-
-import java.lang.reflect.Method;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * EventPublishingRunListener Finished interceptor
- */
-public class EventPublishingRunListenerFinishedInterceptorV1 implements InstanceMethodsAroundInterceptor {
-
- private static final AtomicBoolean isExecuted = new AtomicBoolean(false);
-
- @Override
- public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
-
- }
-
- @Override
- public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Object ret) throws Throwable {
- // Since the finished() method is a method of the EventPublishingRunListener class,
- // the EventPublishingRunListener the first parameter is ConfigurableApplicationContext
- ConfigurableApplicationContext context = (ConfigurableApplicationContext) allArguments[0];
- if (context.getParent() != null) {
- // After the child container is started, the thread pool registration will be carried out
- // IDEA's runtime environment or debugging mechanisms make context refresh speeds different.
- // Ensure that thread pool registration logic is executed only after the context is fully started
- if (context.isActive()) {
- SpringThreadPoolRegisterSupport.registerThreadPoolInstances(context);
- return ret;
- }
- // However, the packaged JAR runtime may refresh the context faster
- // resulting in the context not being refreshed yet when registerThreadPoolInstances is called
- // Register listener to handle the registration after the context has been fully refreshed
- context.addApplicationListener((ApplicationListener) event -> {
- SpringThreadPoolRegisterSupport.registerThreadPoolInstances(event.getApplicationContext());
- });
- return ret;
- }
- // This logic will only be executed once
- if (isExecuted.compareAndSet(false, true)) {
- ApplicationContextHolder contextHolder = new ApplicationContextHolder();
- contextHolder.setApplicationContext(context);
- // Load Spring Properties
- SpringPropertiesLoader.loadSpringProperties(context.getEnvironment());
- // register Dynamic ThreadPool Refresh Listener
- if (AbstractSubjectCenter.get(AbstractSubjectCenter.SubjectType.THREAD_POOL_DYNAMIC_REFRESH) == null) {
- AbstractSubjectCenter.register(AbstractSubjectCenter.SubjectType.THREAD_POOL_DYNAMIC_REFRESH, new DynamicThreadPoolRefreshListener());
- }
- }
- return ret;
- }
-
- @Override
- public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Throwable t) {
-
- }
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/src/main/resources/META-INF/services/cn.hippo4j.agent.core.boot.BootService b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/src/main/resources/META-INF/services/cn.hippo4j.agent.core.boot.BootService
deleted file mode 100644
index 589da575..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/src/main/resources/META-INF/services/cn.hippo4j.agent.core.boot.BootService
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-cn.hippo4j.agent.plugin.spring.boot.v1.boot.SpringBootV1PluginBootService
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/src/main/resources/hippo4j-plugin.def b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/src/main/resources/hippo4j-plugin.def
deleted file mode 100644
index eb4a0376..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-1x-plugin/src/main/resources/hippo4j-plugin.def
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-spring-boot-1.x=cn.hippo4j.agent.plugin.spring.boot.v1.define.EventPublishingRunListenerInstrumentationV1
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/pom.xml b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/pom.xml
deleted file mode 100644
index 6fac2cc4..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
- 4.0.0
-
- cn.hippo4j
- hippo4j-agent-spring-plugins
- ${revision}
-
-
- hippo4j-agent-spring-boot-2x-plugin
- jar
-
-
- 2.3.2.RELEASE
-
-
-
-
- org.springframework.boot
- spring-boot-starter
- ${spring.boot.version}
- provided
-
-
-
- cn.hippo4j
- hippo4j-agent-spring-plugin-common
- ${project.version}
-
-
-
- cn.hippo4j
- hippo4j-threadpool-dynamic-mode-config
- ${project.version}
-
-
-
-
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v2/boot/SpringBootV2PluginBootService.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v2/boot/SpringBootV2PluginBootService.java
deleted file mode 100644
index 8a97116b..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v2/boot/SpringBootV2PluginBootService.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.boot.v2.boot;
-
-import cn.hippo4j.agent.core.boot.BootService;
-import cn.hippo4j.agent.core.boot.DefaultImplementor;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-
-/**
- * SpringBoot v2 plugin boot service
- */
-@DefaultImplementor
-public class SpringBootV2PluginBootService implements BootService {
-
- private static final ILog LOGGER = LogManager.getLogger(SpringBootV2PluginBootService.class);
-
- @Override
- public void prepare() throws Throwable {
-
- }
-
- @Override
- public void boot() throws Throwable {
- LOGGER.info("Loader SpringBootV2PluginBootService...");
- }
-
- @Override
- public void onComplete() throws Throwable {
-
- }
-
- @Override
- public void shutdown() throws Throwable {
-
- }
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v2/define/EventPublishingRunListenerInstrumentationV2.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v2/define/EventPublishingRunListenerInstrumentationV2.java
deleted file mode 100644
index f305b2d2..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v2/define/EventPublishingRunListenerInstrumentationV2.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.boot.v2.define;
-
-import cn.hippo4j.agent.core.plugin.WitnessMethod;
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
-import cn.hippo4j.agent.core.plugin.match.ClassMatch;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-import java.util.Arrays;
-import java.util.List;
-
-import static net.bytebuddy.matcher.ElementMatchers.named;
-import static cn.hippo4j.agent.core.plugin.match.NameMatch.byName;
-import static net.bytebuddy.matcher.ElementMatchers.not;
-
-/**
- * SpringBoot v2 Event publishing run listener instrumentation
- */
-public class EventPublishingRunListenerInstrumentationV2 extends ClassInstanceMethodsEnhancePluginDefine {
-
- private static final String ENHANCE_CLASS = "org.springframework.boot.context.event.EventPublishingRunListener";
-
- private static final String EVENT_PUBLISHING_STARTED_INTERCEPTOR_V2 = "cn.hippo4j.agent.plugin.spring.boot.v2.interceptor.EventPublishingStartedInterceptorV2";
- private static final String EVENT_PUBLISHING_ENVIRONMENT_PREPARED_INTERCEPTOR = "cn.hippo4j.agent.plugin.spring.common.interceptor.EventPublishingRunListenerEnvironmentPreparedInterceptor";
-
- @Override
- protected ClassMatch enhanceClass() {
- return byName(ENHANCE_CLASS);
- }
-
- @Override
- public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
- return new ConstructorInterceptPoint[0];
- }
-
- @Override
- public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
- return new InstanceMethodsInterceptPoint[]{
- new InstanceMethodsInterceptPoint() {
-
- @Override
- public ElementMatcher getMethodsMatcher() {
- return named("started");
- }
-
- @Override
- public String getMethodsInterceptor() {
- return EVENT_PUBLISHING_STARTED_INTERCEPTOR_V2;
- }
-
- @Override
- public boolean isOverrideArgs() {
- return false;
- }
- },
- new InstanceMethodsInterceptPoint() {
-
- @Override
- public ElementMatcher getMethodsMatcher() {
- return named("environmentPrepared");
- }
-
- @Override
- public String getMethodsInterceptor() {
- return EVENT_PUBLISHING_ENVIRONMENT_PREPARED_INTERCEPTOR;
- }
-
- @Override
- public boolean isOverrideArgs() {
- return false;
- }
- }
- };
- }
-
- @Override
- protected List witnessMethods() {
- return Arrays.asList(
- new WitnessMethod("org.springframework.boot.context.event.EventPublishingRunListener", named("started")),
- new WitnessMethod("org.springframework.boot.context.event.EventPublishingRunListener", named("running")),
- new WitnessMethod("org.springframework.boot.context.event.EventPublishingRunListener", not(named("ready")))
- // new WitnessMethod("org.springframework.boot.context.properties.ConstructorBinding", not(isAnnotatedWith(Deprecated.class)))
- );
- }
-
- @Override
- protected String[] witnessClasses() {
- return new String[]{"org.springframework.boot.context.properties.ConstructorBinding"};
- }
-
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v2/interceptor/EventPublishingStartedInterceptorV2.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v2/interceptor/EventPublishingStartedInterceptorV2.java
deleted file mode 100644
index cf8cab9d..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v2/interceptor/EventPublishingStartedInterceptorV2.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.boot.v2.interceptor;
-
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
-import cn.hippo4j.agent.plugin.spring.common.event.DynamicThreadPoolRefreshListener;
-import cn.hippo4j.agent.plugin.spring.common.support.SpringPropertiesLoader;
-import cn.hippo4j.agent.plugin.spring.common.support.SpringThreadPoolRegisterSupport;
-import cn.hippo4j.common.extension.design.AbstractSubjectCenter;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.core.config.ApplicationContextHolder;
-import org.springframework.context.ConfigurableApplicationContext;
-
-import java.lang.reflect.Method;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * Event publishing started interceptor
- */
-public class EventPublishingStartedInterceptorV2 implements InstanceMethodsAroundInterceptor {
-
- private static final AtomicBoolean isExecuted = new AtomicBoolean(false);
-
- private static final ILog LOGGER = LogManager.getLogger(EventPublishingStartedInterceptorV2.class);
-
- @Override
- public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
-
- }
-
- @Override
- public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Object ret) throws Throwable {
- ConfigurableApplicationContext context = (ConfigurableApplicationContext) allArguments[0];
- if (context.getParent() != null) {
- // After the child container is started, the thread pool registration will be carried out
- SpringThreadPoolRegisterSupport.registerThreadPoolInstances(context);
- return ret;
- }
- // This logic will only be executed once
- if (isExecuted.compareAndSet(false, true)) {
- ApplicationContextHolder contextHolder = new ApplicationContextHolder();
- contextHolder.setApplicationContext(context);
- // Load Spring Properties
- SpringPropertiesLoader.loadSpringProperties(context.getEnvironment());
- // register Dynamic ThreadPool Refresh Listener
- if (AbstractSubjectCenter.get(AbstractSubjectCenter.SubjectType.THREAD_POOL_DYNAMIC_REFRESH) == null) {
- AbstractSubjectCenter.register(AbstractSubjectCenter.SubjectType.THREAD_POOL_DYNAMIC_REFRESH, new DynamicThreadPoolRefreshListener());
- }
- }
-
- return ret;
- }
-
- @Override
- public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Throwable t) {
-
- }
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/resources/META-INF/services/cn.hippo4j.agent.core.boot.BootService b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/resources/META-INF/services/cn.hippo4j.agent.core.boot.BootService
deleted file mode 100644
index 687ec9f8..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/resources/META-INF/services/cn.hippo4j.agent.core.boot.BootService
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-cn.hippo4j.agent.plugin.spring.boot.v2.boot.SpringBootV2PluginBootService
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/resources/hippo4j-plugin.def b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/resources/hippo4j-plugin.def
deleted file mode 100644
index 029e7955..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-2x-plugin/src/main/resources/hippo4j-plugin.def
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-spring-boot-2.x=cn.hippo4j.agent.plugin.spring.boot.v2.define.EventPublishingRunListenerInstrumentationV2
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/pom.xml b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/pom.xml
deleted file mode 100644
index c3a32e47..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/pom.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
- 4.0.0
-
- cn.hippo4j
- hippo4j-agent-spring-plugins
- ${revision}
-
-
- hippo4j-agent-spring-boot-3x-plugin
-
-
- 3.0.2
-
-
-
-
-
- org.springframework.boot
- spring-boot-starter
- ${spring-boot.version}
- provided
-
-
-
- cn.hippo4j
- hippo4j-agent-spring-plugin-common
- ${project.version}
-
-
-
-
-
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v3/boot/SpringBootV3PluginBootService.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v3/boot/SpringBootV3PluginBootService.java
deleted file mode 100644
index 29cb0c2a..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v3/boot/SpringBootV3PluginBootService.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.boot.v3.boot;
-
-import cn.hippo4j.agent.core.boot.BootService;
-import cn.hippo4j.agent.core.boot.DefaultImplementor;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-
-/**
- * SpringBoot v3 plugin boot service
- */
-@DefaultImplementor
-public class SpringBootV3PluginBootService implements BootService {
-
- private static final ILog LOGGER = LogManager.getLogger(SpringBootV3PluginBootService.class);
-
- @Override
- public void prepare() throws Throwable {
-
- }
-
- @Override
- public void boot() throws Throwable {
- LOGGER.info("Loader SpringBootV3PluginBootService...");
- }
-
- @Override
- public void onComplete() throws Throwable {
-
- }
-
- @Override
- public void shutdown() throws Throwable {
-
- }
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v3/define/EventPublishingRunListenerInstrumentationV3.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v3/define/EventPublishingRunListenerInstrumentationV3.java
deleted file mode 100644
index f5ee63cc..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v3/define/EventPublishingRunListenerInstrumentationV3.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.boot.v3.define;
-
-import cn.hippo4j.agent.core.plugin.WitnessMethod;
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
-import cn.hippo4j.agent.core.plugin.match.ClassMatch;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-import java.util.Collections;
-import java.util.List;
-
-import static cn.hippo4j.agent.core.plugin.match.NameMatch.byName;
-import static net.bytebuddy.matcher.ElementMatchers.named;
-
-/**
- * SpringBoot v3 Event publishing run listener instrumentation
- */
-public class EventPublishingRunListenerInstrumentationV3 extends ClassInstanceMethodsEnhancePluginDefine {
-
- private static final String ENHANCE_CLASS = "org.springframework.boot.context.event.EventPublishingRunListener";
-
- private static final String EVENT_PUBLISHING_STARTED_INTERCEPTOR_V3 = "cn.hippo4j.agent.plugin.spring.boot.v3.interceptor.EventPublishingStartedInterceptorV3";
-
- @Override
- protected ClassMatch enhanceClass() {
- return byName(ENHANCE_CLASS);
- }
-
- @Override
- public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
- return new ConstructorInterceptPoint[0];
- }
-
- @Override
- public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
- return new InstanceMethodsInterceptPoint[]{
- new InstanceMethodsInterceptPoint() {
-
- @Override
- public ElementMatcher getMethodsMatcher() {
- return named("ready");
- }
-
- @Override
- public String getMethodsInterceptor() {
- return EVENT_PUBLISHING_STARTED_INTERCEPTOR_V3;
- }
-
- @Override
- public boolean isOverrideArgs() {
- return false;
- }
- }
- };
- }
-
- @Override
- protected List witnessMethods() {
- return Collections.singletonList(new WitnessMethod("org.springframework.boot.context.event.EventPublishingRunListener",
- named("ready")));
- }
-
- @Override
- protected String[] witnessClasses() {
- return new String[]{"org.springframework.boot.context.properties.bind.ConstructorBinding"};
- }
-
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v3/interceptor/EventPublishingStartedInterceptorV3.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v3/interceptor/EventPublishingStartedInterceptorV3.java
deleted file mode 100644
index c4c02a0d..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/src/main/java/cn/hippo4j/agent/plugin/spring/boot/v3/interceptor/EventPublishingStartedInterceptorV3.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.boot.v3.interceptor;
-
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
-import cn.hippo4j.agent.plugin.spring.common.event.DynamicThreadPoolRefreshListener;
-import cn.hippo4j.agent.plugin.spring.common.support.SpringPropertiesLoader;
-import cn.hippo4j.agent.plugin.spring.common.support.SpringThreadPoolRegisterSupport;
-import cn.hippo4j.common.extension.design.AbstractSubjectCenter;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.core.config.ApplicationContextHolder;
-import org.springframework.context.ConfigurableApplicationContext;
-
-import java.lang.reflect.Method;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * Event publishing started interceptor
- */
-public class EventPublishingStartedInterceptorV3 implements InstanceMethodsAroundInterceptor {
-
- private static final AtomicBoolean isExecuted = new AtomicBoolean(false);
-
- private static final ILog LOGGER = LogManager.getLogger(EventPublishingStartedInterceptorV3.class);
-
- @Override
- public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
-
- }
-
- @Override
- public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Object ret) throws Throwable {
- ConfigurableApplicationContext context = (ConfigurableApplicationContext) allArguments[0];
- // This logic will only be executed once
- if (isExecuted.compareAndSet(false, true)) {
- ApplicationContextHolder contextHolder = new ApplicationContextHolder();
- contextHolder.setApplicationContext(context);
- // Load Spring Properties
- SpringPropertiesLoader.loadSpringProperties(context.getEnvironment());
- // the thread pool registration will be carried out
- SpringThreadPoolRegisterSupport.registerThreadPoolInstances(context);
- // register Dynamic ThreadPool Refresh Listener
- if (AbstractSubjectCenter.get(AbstractSubjectCenter.SubjectType.THREAD_POOL_DYNAMIC_REFRESH) == null) {
- AbstractSubjectCenter.register(AbstractSubjectCenter.SubjectType.THREAD_POOL_DYNAMIC_REFRESH, new DynamicThreadPoolRefreshListener());
- }
- }
-
- return ret;
- }
-
- @Override
- public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Throwable t) {
-
- }
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/src/main/resources/META-INF/services/cn.hippo4j.agent.core.boot.BootService b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/src/main/resources/META-INF/services/cn.hippo4j.agent.core.boot.BootService
deleted file mode 100644
index 5685fd16..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/src/main/resources/META-INF/services/cn.hippo4j.agent.core.boot.BootService
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-cn.hippo4j.agent.plugin.spring.boot.v3.boot.SpringBootV3PluginBootService
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/src/main/resources/hippo4j-plugin.def b/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/src/main/resources/hippo4j-plugin.def
deleted file mode 100644
index 7d27b358..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-boot-3x-plugin/src/main/resources/hippo4j-plugin.def
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-spring-boot-3.x=cn.hippo4j.agent.plugin.spring.boot.v3.define.EventPublishingRunListenerInstrumentationV3
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/pom.xml b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/pom.xml
deleted file mode 100644
index 5552d5e1..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/pom.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-
-
- 4.0.0
-
- cn.hippo4j
- hippo4j-agent-spring-plugins
- ${revision}
-
-
- hippo4j-agent-spring-plugin-common
-
-
-
- org.springframework
- spring-core
- provided
-
-
- org.springframework
- spring-context
- provided
-
-
- org.projectlombok
- lombok
- provided
-
-
- org.slf4j
- slf4j-api
-
-
- cn.hippo4j
- hippo4j-threadpool-dynamic-api
- ${project.version}
-
-
- cn.hippo4j
- hippo4j-threadpool-dynamic-core
- ${project.version}
-
-
- cn.hippo4j
- hippo4j-threadpool-kernel-alarm
- ${project.version}
-
-
- org.springframework
- spring-core
-
-
-
-
- cn.hippo4j
- hippo4j-threadpool-core
- ${project.version}
-
-
- org.springframework.boot
- spring-boot-starter
-
-
-
-
- cn.hippo4j
- hippo4j-threadpool-dynamic-mode-config
- ${project.version}
-
-
- org.springframework
- spring-core
-
-
-
-
- cn.hippo4j
- hippo4j-threadpool-adapter-web
- ${project.version}
-
-
- org.springframework.boot
- spring-boot-starter
-
-
-
-
- cn.hippo4j
- hippo4j-threadpool-infra-common
- ${project.version}
-
-
- cn.hippo4j
- hippo4j-threadpool-monitor-elasticsearch
- ${project.version}
-
-
- cn.hippo4j
- hippo4j-threadpool-monitor-local-log
- ${project.version}
-
-
- cn.hippo4j
- hippo4j-threadpool-monitor-micrometer
- ${project.version}
-
-
- io.micrometer
- micrometer-registry-prometheus
-
-
-
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/alarm/AgentModeNotifyConfigBuilder.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/alarm/AgentModeNotifyConfigBuilder.java
deleted file mode 100644
index 8a77f7d0..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/alarm/AgentModeNotifyConfigBuilder.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.common.alarm;
-
-import cn.hippo4j.adapter.web.WebThreadPoolService;
-import cn.hippo4j.agent.plugin.spring.common.support.ThreadPoolCheckAlarmSupport;
-import cn.hippo4j.common.api.IExecutorProperties;
-import cn.hippo4j.common.model.executor.ExecutorNotifyProperties;
-import cn.hippo4j.common.model.executor.ExecutorProperties;
-import cn.hippo4j.common.toolkit.CollectionUtil;
-import cn.hippo4j.common.toolkit.StringUtil;
-import cn.hippo4j.threadpool.dynamic.mode.config.properties.NotifyPlatformProperties;
-import cn.hippo4j.threadpool.dynamic.mode.config.properties.WebExecutorProperties;
-import cn.hippo4j.threadpool.message.api.NotifyConfigBuilder;
-import cn.hippo4j.threadpool.message.api.NotifyConfigDTO;
-import cn.hippo4j.threadpool.message.core.service.AlarmControlHandler;
-import lombok.AllArgsConstructor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.stream.Collectors;
-
-import static cn.hippo4j.agent.plugin.spring.common.support.SpringPropertiesLoader.BOOTSTRAP_CONFIG_PROPERTIES;
-import static cn.hippo4j.common.constant.Constants.DEFAULT_INTERVAL;
-
-/**
- * This class is responsible for building the notification configurations for thread pools in an agent mode.
- * It implements the {@link NotifyConfigBuilder} interface and provides methods to build and initialize
- * notification configurations for various platforms and types (e.g., ALARM, CONFIG).
- *
- * The configuration is based on the properties loaded from the bootstrap configuration and includes
- * handling for alarm control and notification intervals.
- *
- * TODO: This is copied from {@link cn.hippo4j.config.springboot.starter.notify.ConfigModeNotifyConfigBuilder} and can be refactored later
- */
-@AllArgsConstructor
-public class AgentModeNotifyConfigBuilder implements NotifyConfigBuilder {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(ThreadPoolCheckAlarmSupport.class);
-
- private final AlarmControlHandler alarmControlHandler;
-
- private final WebThreadPoolService webThreadPoolService;
-
- /**
- * Builds the notification configurations for all executors defined in the bootstrap configuration.
- *
- * This method filters the executors based on their alarm settings and constructs the notification
- * configurations accordingly. If global alarm settings are disabled and there are no specific alarms
- * configured for any executor, the method returns an empty map.
- *
- * @return A map containing the notification configurations, keyed by the notification type (e.g., ALARM, CONFIG).
- */
- public Map> buildNotify() {
- Map> resultMap = new HashMap<>();
- boolean globalAlarm = Optional.ofNullable(BOOTSTRAP_CONFIG_PROPERTIES.getDefaultExecutor())
- .map(ExecutorProperties::getAlarm)
- .orElse(true);
- List executors = BOOTSTRAP_CONFIG_PROPERTIES.getExecutors();
- if (CollectionUtil.isEmpty(executors)) {
- LOGGER.warn("Failed to build notify, executors configuration is empty.");
- return resultMap;
- }
- List actual = executors.stream()
- .filter(each -> Optional.ofNullable(each.getAlarm())
- .orElse(false))
- .collect(Collectors.toList());
- if (!globalAlarm && CollectionUtil.isEmpty(actual)) {
- return resultMap;
- }
- for (ExecutorProperties executorProperties : executors) {
- Map> buildSingleNotifyConfig = buildSingleNotifyConfig(executorProperties);
- initCacheAndLock(buildSingleNotifyConfig);
- resultMap.putAll(buildSingleNotifyConfig);
- }
- // register notify config for web
- WebExecutorProperties webProperties = BOOTSTRAP_CONFIG_PROPERTIES.getWeb();
- if (webProperties == null) {
- return resultMap;
- }
- if (StringUtil.isBlank(webProperties.getThreadPoolId())) {
- webProperties.setThreadPoolId(webThreadPoolService.getWebContainerType().getName());
- }
- Map> webSingleNotifyConfigMap = buildSingleNotifyConfig(webProperties);
- initCacheAndLock(webSingleNotifyConfigMap);
- resultMap.putAll(webSingleNotifyConfigMap);
-
- return resultMap;
- }
-
- /**
- * Builds the notification configurations for a single executor.
- *
- * This method generates two types of notifications: ALARM and CONFIG. For each type, it creates
- * notification configurations based on the platforms defined in the bootstrap configuration.
- *
- * @param executorProperties The properties of the executor for which to build the notification configurations.
- * @return A map containing the notification configurations for the given executor, keyed by the notification type.
- */
- public Map> buildSingleNotifyConfig(IExecutorProperties executorProperties) {
- String threadPoolId = executorProperties.getThreadPoolId();
- Map> resultMap = new HashMap<>();
- String alarmBuildKey = threadPoolId + "+ALARM";
- List alarmNotifyConfigs = new ArrayList<>();
- List notifyPlatforms = BOOTSTRAP_CONFIG_PROPERTIES.getNotifyPlatforms();
- for (NotifyPlatformProperties platformProperties : notifyPlatforms) {
- NotifyConfigDTO notifyConfig = new NotifyConfigDTO();
- notifyConfig.setPlatform(platformProperties.getPlatform());
- notifyConfig.setTpId(threadPoolId);
- notifyConfig.setType("ALARM");
- notifyConfig.setSecret(platformProperties.getSecret());
- notifyConfig.setSecretKey(getToken(platformProperties));
- notifyConfig.setInterval(buildInterval(executorProperties));
- notifyConfig.setReceives(buildReceive(executorProperties));
- alarmNotifyConfigs.add(notifyConfig);
- }
- resultMap.put(alarmBuildKey, alarmNotifyConfigs);
- String changeBuildKey = threadPoolId + "+CONFIG";
- List changeNotifyConfigs = new ArrayList<>();
- for (NotifyPlatformProperties platformProperties : notifyPlatforms) {
- NotifyConfigDTO notifyConfig = new NotifyConfigDTO();
- notifyConfig.setPlatform(platformProperties.getPlatform());
- notifyConfig.setTpId(threadPoolId);
- notifyConfig.setType("CONFIG");
- notifyConfig.setSecretKey(getToken(platformProperties));
- notifyConfig.setSecret(platformProperties.getSecret());
- notifyConfig.setReceives(buildReceive(executorProperties));
- changeNotifyConfigs.add(notifyConfig);
- }
- resultMap.put(changeBuildKey, changeNotifyConfigs);
- return resultMap;
- }
-
- /**
- * Retrieves the token for the given notification platform properties.
- *
- * If the token is not explicitly set, the method returns the secret key as the fallback.
- *
- * @param platformProperties The platform properties from which to retrieve the token.
- * @return The token or secret key associated with the given platform properties.
- */
- private String getToken(NotifyPlatformProperties platformProperties) {
- return StringUtil.isNotBlank(platformProperties.getToken()) ? platformProperties.getToken() : platformProperties.getSecretKey();
- }
-
- /**
- * Builds the notification interval for the given executor properties.
- *
- * This method first checks the executor's specific notify configuration. If not set, it falls back
- * to the default executor configuration in the bootstrap properties.
- *
- * @param executorProperties The properties of the executor for which to build the notification interval.
- * @return The notification interval in seconds.
- */
- private int buildInterval(IExecutorProperties executorProperties) {
- return Optional.ofNullable(executorProperties.getNotify())
- .map(ExecutorNotifyProperties::getInterval)
- .orElse(Optional.ofNullable(BOOTSTRAP_CONFIG_PROPERTIES.getDefaultExecutor())
- .map(ExecutorProperties::getNotify)
- .map(ExecutorNotifyProperties::getInterval)
- .orElse(DEFAULT_INTERVAL));
- }
-
- /**
- * Builds the notification recipients for the given executor properties.
- *
- * This method first checks the executor's specific notify configuration. If not set, it falls back
- * to the default executor configuration in the bootstrap properties.
- *
- * @param executorProperties The properties of the executor for which to build the notification recipients.
- * @return A string containing the recipients of the notifications.
- */
- private String buildReceive(IExecutorProperties executorProperties) {
- return Optional.ofNullable(executorProperties.getNotify())
- .map(ExecutorNotifyProperties::getReceives)
- .orElse(Optional.ofNullable(BOOTSTRAP_CONFIG_PROPERTIES.getDefaultExecutor())
- .map(ExecutorProperties::getNotify)
- .map(ExecutorNotifyProperties::getReceives).orElse(""));
- }
-
- /**
- * Initializes the cache and lock mechanisms for the given notification configurations.
- *
- * This method is primarily responsible for setting up alarm controls based on the notification
- * configurations, ensuring that the appropriate cache and lock mechanisms are initialized for
- * each thread pool and platform combination.
- *
- * @param buildSingleNotifyConfig A map containing the notification configurations that need cache and lock initialization.
- */
- public void initCacheAndLock(Map> buildSingleNotifyConfig) {
- buildSingleNotifyConfig.forEach(
- (key, val) -> val.stream()
- .filter(each -> Objects.equals("ALARM", each.getType()))
- .forEach(each -> alarmControlHandler.initCacheAndLock(each.getTpId(), each.getPlatform(), each.getInterval())));
- }
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/conf/NacosCloudConfig.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/conf/NacosCloudConfig.java
deleted file mode 100644
index 62019812..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/conf/NacosCloudConfig.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.common.conf;
-
-import cn.hippo4j.agent.core.boot.SpringBootConfigNode;
-
-/**
- * Nacos Cloud config
- */
-public class NacosCloudConfig {
-
- public static class Spring {
-
- /**
- * Cloud
- */
- public static class Cloud {
-
- /**
- * Nacos
- */
- public static class Nacos {
-
- /**
- * Config
- */
- @SpringBootConfigNode(root = NacosConfig.class)
- public static class Config {
-
- public static String SERVER_ADDR = "";
-
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/conf/NacosConfig.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/conf/NacosConfig.java
deleted file mode 100644
index 07227530..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/conf/NacosConfig.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.common.conf;
-
-import cn.hippo4j.agent.core.boot.SpringBootConfigNode;
-
-/**
- * nacos config
- */
-public class NacosConfig {
-
- /**
- * Nacos
- */
- public static class Nacos {
-
- /**
- * Config
- */
- @SpringBootConfigNode(root = NacosCloudConfig.class)
- public static class Config {
-
- public static String SERVER_ADDR = "";
-
- }
- }
-}
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/conf/SpringBootConfig.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/conf/SpringBootConfig.java
deleted file mode 100644
index 48e05894..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/conf/SpringBootConfig.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.common.conf;
-
-import cn.hippo4j.agent.core.boot.SpringBootConfigNode;
-
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Spring boot config
- */
-public class SpringBootConfig {
-
- /**
- * Spring
- */
- @SpringBootConfigNode(root = SpringBootConfig.class)
- public static class Spring {
-
- /**
- * Dynamic
- */
- @SpringBootConfigNode(root = SpringBootConfig.class)
- public static class Dynamic {
-
- /**
- * ThreadPool
- */
- @SpringBootConfigNode(root = SpringBootConfig.class)
- public static class Thread_Pool {
-
- /**
- * Apollo
- */
- @SpringBootConfigNode(root = SpringBootConfig.class)
- public static class Apollo {
-
- public static List NAMESPACE = Arrays.asList("application");
- }
-
- @SpringBootConfigNode(root = SpringBootConfig.class)
- public static class Nacos {
-
- public static String SERVER_ADDR = "localhost";
-
- public static List NAMESPACE = Arrays.asList("");
-
- public static String DATA_ID = "";
-
- public static String GROUP = "DEFAULT_GROUP";
- }
-
- /**
- * Monitor
- */
- @SpringBootConfigNode(root = SpringBootConfig.class)
- public static class Monitor {
-
- public static Boolean enable = Boolean.TRUE;
-
- public static String collectTypes = "micrometer";
-
- public static String threadPoolTypes = "dynamic";
-
- public static Long initialDelay = 10000L;
-
- public static Long collectInterval = 5000L;
-
- public static Integer AGENT_MICROMETER_PORT;
-
- }
-
- public static String CONFIG_FILE_TYPE;
- }
- }
-
- @SpringBootConfigNode(root = SpringBootConfig.class)
- public static class Application {
-
- public static String name = "";
-
- }
-
- @SpringBootConfigNode(root = SpringBootConfig.class)
- public static class Profiles {
-
- public static String active = "";
-
- }
- }
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/define/SpringApplicationInstrumentation.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/define/SpringApplicationInstrumentation.java
deleted file mode 100644
index bcd7f5c3..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/define/SpringApplicationInstrumentation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.common.define;
-
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
-import cn.hippo4j.agent.core.plugin.match.ClassMatch;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-import static cn.hippo4j.agent.core.plugin.match.NameMatch.byName;
-import static net.bytebuddy.matcher.ElementMatchers.named;
-
-public class SpringApplicationInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
-
- private static final String ENHANCE_CLASS = "org.springframework.boot.SpringApplication";
-
- private static final String RUN_INTERCEPTOR = "cn.hippo4j.agent.plugin.spring.common.interceptor.SpringApplicationRunInterceptor";
-
- @Override
- protected ClassMatch enhanceClass() {
- return byName(ENHANCE_CLASS);
- }
-
- @Override
- public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
- return new ConstructorInterceptPoint[0];
- }
-
- @Override
- public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
- return new InstanceMethodsInterceptPoint[]{
- new InstanceMethodsInterceptPoint() {
-
- @Override
- public ElementMatcher getMethodsMatcher() {
- return named("run");
- }
-
- @Override
- public String getMethodsInterceptor() {
- return RUN_INTERCEPTOR;
- }
-
- @Override
- public boolean isOverrideArgs() {
- return false;
- }
- }
- };
- }
-
- @Override
- protected String[] witnessClasses() {
- return new String[]{"org.springframework.boot.SpringApplication"};
- }
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/event/DynamicThreadPoolRefreshListener.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/event/DynamicThreadPoolRefreshListener.java
deleted file mode 100644
index 836ab712..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/event/DynamicThreadPoolRefreshListener.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.common.event;
-
-import cn.hippo4j.agent.core.util.CollectionUtil;
-import cn.hippo4j.agent.plugin.spring.common.alarm.AgentModeNotifyConfigBuilder;
-import cn.hippo4j.agent.plugin.spring.common.support.ThreadPoolCheckAlarmSupport;
-import cn.hippo4j.common.executor.ThreadPoolExecutorHolder;
-import cn.hippo4j.common.executor.ThreadPoolExecutorRegistry;
-import cn.hippo4j.common.executor.support.BlockingQueueTypeEnum;
-import cn.hippo4j.common.executor.support.RejectedPolicyTypeEnum;
-import cn.hippo4j.common.executor.support.ResizableCapacityLinkedBlockingQueue;
-import cn.hippo4j.common.extension.design.Observer;
-import cn.hippo4j.common.extension.design.ObserverMessage;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.common.model.executor.ExecutorProperties;
-import cn.hippo4j.common.toolkit.ThreadPoolExecutorUtil;
-import cn.hippo4j.threadpool.dynamic.mode.config.properties.BootstrapConfigProperties;
-import cn.hippo4j.threadpool.message.api.NotifyConfigDTO;
-import cn.hippo4j.threadpool.message.core.request.ChangeParameterNotifyRequest;
-import cn.hippo4j.threadpool.message.core.service.GlobalNotifyAlarmManage;
-import cn.hippo4j.threadpool.message.core.service.ThreadPoolBaseSendMessageService;
-import cn.hippo4j.threadpool.message.core.service.ThreadPoolNotifyAlarm;
-import lombok.RequiredArgsConstructor;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.concurrent.RejectedExecutionHandler;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-
-import static cn.hippo4j.common.constant.ChangeThreadPoolConstants.CHANGE_DELIMITER;
-import static cn.hippo4j.common.constant.ChangeThreadPoolConstants.CHANGE_THREAD_POOL_TEXT;
-
-/**
- * Dynamic thread-pool refresh listener.
- */
-@RequiredArgsConstructor
-public class DynamicThreadPoolRefreshListener implements Observer {
-
- private static final ILog LOG = LogManager.getLogger(DynamicThreadPoolRefreshListener.class);
-
- @Override
- public void accept(ObserverMessage observerMessage) {
- BootstrapConfigProperties bindableConfigProperties = observerMessage.message();
- List executors = bindableConfigProperties.getExecutors();
- for (ExecutorProperties properties : executors) {
- String threadPoolId = properties.getThreadPoolId();
- // Check whether the thread pool configuration is empty and whether the parameters have changed
- ThreadPoolExecutorHolder executorHolder = ThreadPoolExecutorRegistry.getHolder(threadPoolId);
- /*
- * Check whether the notification configuration is consistent, this operation will not trigger the notification.
- */
- checkNotifyConsistencyAndReplace(properties);
- if (executorHolder.isEmpty() || !checkPropertiesConsistency(executorHolder, properties)) {
- continue;
- }
- dynamicRefreshThreadPool(executorHolder, properties);
- sendChangeNotificationMessage(executorHolder, properties);
- executorHolder.setExecutorProperties(properties);
- }
- }
-
- /**
- * Check notify consistency and replace.
- *
- * @param executorProperties
- */
- private void checkNotifyConsistencyAndReplace(ExecutorProperties executorProperties) {
- boolean checkNotifyConfig = false;
- boolean checkNotifyAlarm = false;
- ThreadPoolBaseSendMessageService threadPoolBaseSendMessageService = ThreadPoolCheckAlarmSupport.getThreadPoolBaseSendMessageService();
- AgentModeNotifyConfigBuilder agentNotifyConfigBuilder = ThreadPoolCheckAlarmSupport.getAgentNotifyConfigBuilder();
- // Build a new notification configuration for the Agent
- Map> newDynamicThreadPoolNotifyMap = agentNotifyConfigBuilder.buildSingleNotifyConfig(executorProperties);
- Map> notifyConfigs = threadPoolBaseSendMessageService.getNotifyConfigs();
- if (CollectionUtil.isNotEmpty(notifyConfigs)) {
- for (Map.Entry> each : newDynamicThreadPoolNotifyMap.entrySet()) {
- if (checkNotifyConfig) {
- break;
- }
- List notifyConfigDTOS = notifyConfigs.get(each.getKey());
- for (NotifyConfigDTO notifyConfig : each.getValue()) {
- if (!notifyConfigDTOS.contains(notifyConfig)) {
- checkNotifyConfig = true;
- break;
- }
- }
- }
- }
- if (checkNotifyConfig) {
- agentNotifyConfigBuilder.initCacheAndLock(newDynamicThreadPoolNotifyMap);
- threadPoolBaseSendMessageService.putPlatform(newDynamicThreadPoolNotifyMap);
- }
- ThreadPoolNotifyAlarm threadPoolNotifyAlarm = GlobalNotifyAlarmManage.get(executorProperties.getThreadPoolId());
- if (threadPoolNotifyAlarm != null) {
- Boolean isAlarm = executorProperties.getAlarm();
- Integer activeAlarm = executorProperties.getActiveAlarm();
- Integer capacityAlarm =
- executorProperties.getCapacityAlarm();
- if ((isAlarm != null && !Objects.equals(isAlarm, threadPoolNotifyAlarm.getAlarm())) || (activeAlarm != null && !Objects.equals(activeAlarm,
- threadPoolNotifyAlarm.getActiveAlarm())) || (capacityAlarm != null && !Objects.equals(capacityAlarm, threadPoolNotifyAlarm.getCapacityAlarm()))) {
- checkNotifyAlarm = true;
- threadPoolNotifyAlarm.setAlarm(Optional.ofNullable(isAlarm).orElse(threadPoolNotifyAlarm.getAlarm()));
- threadPoolNotifyAlarm.setActiveAlarm(Optional.ofNullable(activeAlarm).orElse(threadPoolNotifyAlarm.getActiveAlarm()));
- threadPoolNotifyAlarm.setCapacityAlarm(Optional.ofNullable(capacityAlarm).orElse(threadPoolNotifyAlarm.getCapacityAlarm()));
- }
- }
- if (checkNotifyConfig || checkNotifyAlarm) {
- LOG.info("[{}] Dynamic thread pool notification property changes.", executorProperties.getThreadPoolId());
- }
- }
-
- /**
- * Check consistency.
- *
- * @param executorHolder executor holder
- * @param properties properties after dynamic thread pool change
- */
- private boolean checkPropertiesConsistency(ThreadPoolExecutorHolder executorHolder, ExecutorProperties properties) {
- ExecutorProperties beforeProperties = executorHolder.getExecutorProperties();
- ThreadPoolExecutor executor = executorHolder.getExecutor();
- boolean result = (properties.getCorePoolSize() != null && !Objects.equals(beforeProperties.getCorePoolSize(), properties.getCorePoolSize()))
- || (properties.getMaximumPoolSize() != null && !Objects.equals(beforeProperties.getMaximumPoolSize(), properties.getMaximumPoolSize()))
- || (properties.getAllowCoreThreadTimeOut() != null && !Objects.equals(beforeProperties.getAllowCoreThreadTimeOut(), properties.getAllowCoreThreadTimeOut()))
- || (properties.getExecuteTimeOut() != null && !Objects.equals(beforeProperties.getExecuteTimeOut(), properties.getExecuteTimeOut()))
- || (properties.getKeepAliveTime() != null && !Objects.equals(beforeProperties.getKeepAliveTime(), properties.getKeepAliveTime()))
- || (properties.getRejectedHandler() != null && !Objects.equals(beforeProperties.getRejectedHandler(), properties.getRejectedHandler()))
- ||
- ((properties.getQueueCapacity() != null && !Objects.equals(beforeProperties.getQueueCapacity(), properties.getQueueCapacity())
- && Objects.equals(BlockingQueueTypeEnum.RESIZABLE_LINKED_BLOCKING_QUEUE.getName(), executor.getQueue().getClass().getSimpleName())));
- return result;
- }
-
- /**
- * Dynamic refresh thread-pool.
- *
- * @param executorHolder executor holder
- * @param properties properties after dynamic thread pool change
- */
- private void dynamicRefreshThreadPool(ThreadPoolExecutorHolder executorHolder, ExecutorProperties properties) {
- ExecutorProperties beforeProperties = executorHolder.getExecutorProperties();
- ThreadPoolExecutor executor = executorHolder.getExecutor();
- if (properties.getMaximumPoolSize() != null && properties.getCorePoolSize() != null) {
- ThreadPoolExecutorUtil.safeSetPoolSize(executor, properties.getCorePoolSize(), properties.getMaximumPoolSize());
- } else {
- if (properties.getMaximumPoolSize() != null) {
- executor.setMaximumPoolSize(properties.getMaximumPoolSize());
- }
- if (properties.getCorePoolSize() != null) {
- executor.setCorePoolSize(properties.getCorePoolSize());
- }
- }
- if (properties.getAllowCoreThreadTimeOut() != null && !Objects.equals(beforeProperties.getAllowCoreThreadTimeOut(), properties.getAllowCoreThreadTimeOut())) {
- executor.allowCoreThreadTimeOut(properties.getAllowCoreThreadTimeOut());
- }
- // TODO
- if (properties.getExecuteTimeOut() != null && !Objects.equals(beforeProperties.getExecuteTimeOut(), properties.getExecuteTimeOut())) {
- // if (executor instanceof DynamicThreadPoolExecutor) {
- // ((DynamicThreadPoolExecutor) executor).setExecuteTimeOut(properties.getExecuteTimeOut());
- // }
- }
- if (properties.getRejectedHandler() != null && !Objects.equals(beforeProperties.getRejectedHandler(), properties.getRejectedHandler())) {
- RejectedExecutionHandler rejectedExecutionHandler = RejectedPolicyTypeEnum.createPolicy(properties.getRejectedHandler());
- executor.setRejectedExecutionHandler(rejectedExecutionHandler);
- }
- if (properties.getKeepAliveTime() != null && !Objects.equals(beforeProperties.getKeepAliveTime(), properties.getKeepAliveTime())) {
- executor.setKeepAliveTime(properties.getKeepAliveTime(), TimeUnit.SECONDS);
- }
- if (properties.getQueueCapacity() != null && !Objects.equals(beforeProperties.getQueueCapacity(), properties.getQueueCapacity())
- && Objects.equals(BlockingQueueTypeEnum.RESIZABLE_LINKED_BLOCKING_QUEUE.getName(), executor.getQueue().getClass().getSimpleName())) {
- if (executor.getQueue() instanceof ResizableCapacityLinkedBlockingQueue) {
- ResizableCapacityLinkedBlockingQueue> queue = (ResizableCapacityLinkedBlockingQueue>) executor.getQueue();
- queue.setCapacity(properties.getQueueCapacity());
- } else {
- LOG.warn("The queue length cannot be modified. Queue type mismatch. Current queue type: {}", executor.getQueue().getClass().getSimpleName());
- }
- }
- }
-
- /**
- * Sends a change notification message for a thread pool when its properties are updated.
- * This method logs the changes in thread pool properties and sends a notification to the platform
- * with the updated configuration details.
- *
- * @param executorHolder The holder object for the thread pool executor, containing its current state and properties.
- * @param properties The new properties for the thread pool that are being applied.
- */
- private void sendChangeNotificationMessage(ThreadPoolExecutorHolder executorHolder, ExecutorProperties properties) {
- ExecutorProperties beforeProperties = executorHolder.getExecutorProperties();
- LOG.info(CHANGE_THREAD_POOL_TEXT,
- executorHolder.getThreadPoolId(),
- String.format(CHANGE_DELIMITER, beforeProperties.getCorePoolSize(), properties.getCorePoolSize()),
- String.format(CHANGE_DELIMITER, beforeProperties.getMaximumPoolSize(), properties.getMaximumPoolSize()),
- String.format(CHANGE_DELIMITER, beforeProperties.getQueueCapacity(), properties.getQueueCapacity()),
- String.format(CHANGE_DELIMITER, beforeProperties.getKeepAliveTime(), properties.getKeepAliveTime()),
- String.format(CHANGE_DELIMITER, beforeProperties.getExecuteTimeOut(), properties.getExecuteTimeOut()),
- String.format(CHANGE_DELIMITER, beforeProperties.getRejectedHandler(), properties.getRejectedHandler()),
- String.format(CHANGE_DELIMITER, beforeProperties.getAllowCoreThreadTimeOut(), properties.getAllowCoreThreadTimeOut()));
-
- // Send platform configuration notification
- ChangeParameterNotifyRequest changeRequest = buildChangeRequest(beforeProperties, properties);
- ThreadPoolCheckAlarmSupport.getThreadPoolConfigChangeHandler().sendPoolConfigChange(changeRequest);
- }
-
- /**
- * Construct change parameter notify request instance.
- *
- * @param beforeProperties old properties
- * @param properties new properties
- * @return instance
- */
- private ChangeParameterNotifyRequest buildChangeRequest(ExecutorProperties beforeProperties, ExecutorProperties properties) {
- ChangeParameterNotifyRequest changeParameterNotifyRequest = ChangeParameterNotifyRequest.builder()
- .beforeCorePoolSize(beforeProperties.getCorePoolSize())
- .beforeMaximumPoolSize(beforeProperties.getMaximumPoolSize())
- .beforeAllowsCoreThreadTimeOut(beforeProperties.getAllowCoreThreadTimeOut())
- .beforeKeepAliveTime(beforeProperties.getKeepAliveTime())
- .beforeQueueCapacity(beforeProperties.getQueueCapacity())
- .beforeRejectedName(beforeProperties.getRejectedHandler())
- .beforeExecuteTimeOut(beforeProperties.getExecuteTimeOut())
- .blockingQueueName(properties.getBlockingQueue())
- .nowCorePoolSize(Optional.ofNullable(properties.getCorePoolSize()).orElse(beforeProperties.getCorePoolSize()))
- .nowMaximumPoolSize(Optional.ofNullable(properties.getMaximumPoolSize()).orElse(beforeProperties.getMaximumPoolSize()))
- .nowAllowsCoreThreadTimeOut(Optional.ofNullable(properties.getAllowCoreThreadTimeOut()).orElse(beforeProperties.getAllowCoreThreadTimeOut()))
- .nowKeepAliveTime(Optional.ofNullable(properties.getKeepAliveTime()).orElse(beforeProperties.getKeepAliveTime()))
- .nowQueueCapacity(Optional.ofNullable(properties.getQueueCapacity()).orElse(beforeProperties.getQueueCapacity()))
- .nowRejectedName(Optional.ofNullable(properties.getRejectedHandler()).orElse(beforeProperties.getRejectedHandler()))
- .nowExecuteTimeOut(Optional.ofNullable(properties.getExecuteTimeOut()).orElse(beforeProperties.getExecuteTimeOut()))
- .build();
- changeParameterNotifyRequest.setThreadPoolId(beforeProperties.getThreadPoolId());
- return changeParameterNotifyRequest;
- }
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/interceptor/EventPublishingRunListenerEnvironmentPreparedInterceptor.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/interceptor/EventPublishingRunListenerEnvironmentPreparedInterceptor.java
deleted file mode 100644
index e148c96b..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/interceptor/EventPublishingRunListenerEnvironmentPreparedInterceptor.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.common.interceptor;
-
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
-import cn.hippo4j.agent.plugin.spring.common.support.SpringEnvironmentSupport;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.core.env.ConfigurableEnvironment;
-
-import java.lang.reflect.Method;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * Event publishing run listener environment prepared interceptor
- */
-public class EventPublishingRunListenerEnvironmentPreparedInterceptor implements InstanceMethodsAroundInterceptor {
-
- private static final AtomicBoolean isExecuted = new AtomicBoolean(false);
-
- private static final Logger LOGGER = LoggerFactory.getLogger(EventPublishingRunListenerEnvironmentPreparedInterceptor.class);
-
- @Override
- public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
-
- }
-
- @Override
- public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Object ret) throws Throwable {
- if (isExecuted.compareAndSet(false, true)) {
- ConfigurableEnvironment environment = null;
- try {
- environment = (ConfigurableEnvironment) allArguments[0];
- } catch (Exception e) {
- environment = (ConfigurableEnvironment) allArguments[1];
- }
- SpringEnvironmentSupport.disableNonAgentSwitch(environment);
- LOGGER.info("[Hippo4j-Agent] Switch off in non-Agent mode.");
- }
- return ret;
- }
-
- @Override
- public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Throwable t) {
-
- }
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/monitor/MonitorHandlersConfigurator.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/monitor/MonitorHandlersConfigurator.java
deleted file mode 100644
index 76509cdd..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/monitor/MonitorHandlersConfigurator.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.common.monitor;
-
-import cn.hippo4j.agent.plugin.spring.common.support.SpringPropertiesLoader;
-import cn.hippo4j.common.extension.spi.ServiceLoaderRegistry;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.common.monitor.MonitorCollectTypeEnum;
-import cn.hippo4j.common.monitor.MonitorHandlerTypeEnum;
-import cn.hippo4j.core.executor.state.ThreadPoolRunStateHandler;
-import cn.hippo4j.monitor.elasticsearch.AdapterThreadPoolElasticSearchMonitorHandler;
-import cn.hippo4j.monitor.elasticsearch.DynamicThreadPoolElasticSearchMonitorHandler;
-import cn.hippo4j.monitor.elasticsearch.WebThreadPoolElasticSearchMonitorHandler;
-import cn.hippo4j.monitor.local.log.AdapterThreadPoolLocalLogMonitorHandler;
-import cn.hippo4j.monitor.local.log.DynamicThreadPoolLocalLogMonitorHandler;
-import cn.hippo4j.monitor.local.log.WebThreadPoolLocalLogMonitorHandler;
-import cn.hippo4j.monitor.micrometer.AdapterThreadPoolMicrometerMonitorHandler;
-import cn.hippo4j.monitor.micrometer.DynamicThreadPoolMicrometerMonitorHandler;
-import cn.hippo4j.monitor.micrometer.WebThreadPoolMicrometerMonitorHandler;
-import cn.hippo4j.threadpool.dynamic.mode.config.properties.MonitorProperties;
-import cn.hippo4j.threadpool.monitor.api.ThreadPoolMonitor;
-import org.springframework.core.env.ConfigurableEnvironment;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.function.BiConsumer;
-
-/**
- * This class is responsible for configuring and initializing monitoring handlers
- * for various types of thread pools. It maps specific monitoring types (e.g., Micrometer,
- * Log, Elasticsearch) to their corresponding handler initializers and manages the
- * setup process based on the provided configuration.
- */
-public class MonitorHandlersConfigurator {
-
- private static final ILog LOGGER = LogManager.getLogger(MonitorHandlersConfigurator.class);
-
- // Maps thread pool types to their corresponding handler constructors
- private static final Map> handlerMap = new HashMap<>();
-
- static {
- // Initialize the handler map with specific monitoring types
- handlerMap.put(MonitorCollectTypeEnum.MICROMETER.getValue(), MonitorHandlersConfigurator::handleMicrometer);
- handlerMap.put(MonitorCollectTypeEnum.LOG.getValue(), MonitorHandlersConfigurator::handleLog);
- handlerMap.put(MonitorCollectTypeEnum.ELASTICSEARCH.getValue(), MonitorHandlersConfigurator::handleElasticSearch);
- }
-
- /**
- * Initializes the monitoring handlers based on the provided monitoring configuration.
- *
- * This method performs the following tasks:
- *
- * Parses the configured monitoring types and thread pool types.
- * Initializes a monitoring context with the necessary thread pool monitors and state handler.
- * For each configured monitoring type, invokes the corresponding handler initializer
- * for each relevant thread pool type.
- * Logs a warning if an unrecognized monitoring type is encountered.
- * Registers and adds thread pool monitors that match the configured monitoring types.
- *
- *
- * @param monitor The monitoring properties configuration.
- * @param environment The application environment from which additional configuration can be loaded.
- * @param threadPoolMonitors A list to hold the initialized thread pool monitors.
- */
- public static void initializeMonitorHandlers(MonitorProperties monitor, ConfigurableEnvironment environment, List threadPoolMonitors) {
- List collectTypes = Arrays.asList(monitor.getCollectTypes().split(","));
- List threadPoolTypes = Arrays.asList(monitor.getThreadPoolTypes().split(","));
- ThreadPoolRunStateHandler threadPoolRunStateHandler = new ThreadPoolRunStateHandler(
- SpringPropertiesLoader.inetUtils, environment);
-
- MonitorHandlerContext context = new MonitorHandlerContext(threadPoolMonitors, threadPoolRunStateHandler);
-
- // Initialize handlers for each configured monitoring type and thread pool type
- for (String collectType : collectTypes) {
- if (handlerMap.containsKey(collectType)) {
- for (MonitorHandlerTypeEnum type : MonitorHandlerTypeEnum.values()) {
- if (threadPoolTypes.contains(type.name().toLowerCase())) {
- handlerMap.get(collectType).accept(type, context);
- }
- }
- } else {
- LOGGER.warn("[Hippo4j-Agent] MonitorConfigurator initialize Unrecognized collect type: [{}]", collectType);
- }
- }
-
- // Register and add dynamic thread pool monitors matching the configured types
- Collection dynamicThreadPoolMonitors = ServiceLoaderRegistry.getSingletonServiceInstances(ThreadPoolMonitor.class);
- dynamicThreadPoolMonitors.stream().filter(each -> collectTypes.contains(each.getType())).forEach(threadPoolMonitors::add);
- }
-
- /**
- * Initializes Micrometer-based monitoring handlers for the specified thread pool type.
- *
- * @param type The type of thread pool to be monitored.
- * @param context The context containing the monitors and state handler.
- */
- private static void handleMicrometer(MonitorHandlerTypeEnum type, MonitorHandlerContext context) {
- switch (type) {
- case DYNAMIC:
- context.monitors.add(new DynamicThreadPoolMicrometerMonitorHandler(context.threadPoolRunStateHandler));
- break;
- case WEB:
- context.monitors.add(new WebThreadPoolMicrometerMonitorHandler());
- break;
- case ADAPTER:
- context.monitors.add(new AdapterThreadPoolMicrometerMonitorHandler());
- break;
- }
- }
-
- /**
- * Initializes Log-based monitoring handlers for the specified thread pool type.
- *
- * @param type The type of thread pool to be monitored.
- * @param context The context containing the monitors and state handler.
- */
- private static void handleLog(MonitorHandlerTypeEnum type, MonitorHandlerContext context) {
- switch (type) {
- case DYNAMIC:
- context.monitors.add(new DynamicThreadPoolLocalLogMonitorHandler(context.threadPoolRunStateHandler));
- break;
- case WEB:
- context.monitors.add(new WebThreadPoolLocalLogMonitorHandler());
- break;
- case ADAPTER:
- context.monitors.add(new AdapterThreadPoolLocalLogMonitorHandler());
- break;
- }
- }
-
- /**
- * Initializes Elasticsearch-based monitoring handlers for the specified thread pool type.
- *
- * @param type The type of thread pool to be monitored.
- * @param context The context containing the monitors and state handler.
- */
- private static void handleElasticSearch(MonitorHandlerTypeEnum type, MonitorHandlerContext context) {
- switch (type) {
- case DYNAMIC:
- context.monitors.add(new DynamicThreadPoolElasticSearchMonitorHandler(context.threadPoolRunStateHandler));
- break;
- case WEB:
- context.monitors.add(new WebThreadPoolElasticSearchMonitorHandler());
- break;
- case ADAPTER:
- context.monitors.add(new AdapterThreadPoolElasticSearchMonitorHandler());
- break;
- }
- }
-
- /**
- * A helper class to manage the context in which monitoring handlers are initialized.
- */
- private static class MonitorHandlerContext {
-
- List monitors;
- ThreadPoolRunStateHandler threadPoolRunStateHandler;
-
- MonitorHandlerContext(List monitors, ThreadPoolRunStateHandler handler) {
- this.monitors = monitors;
- this.threadPoolRunStateHandler = handler;
- }
- }
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/monitor/MonitorMetricEndpoint.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/monitor/MonitorMetricEndpoint.java
deleted file mode 100644
index e5276104..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/monitor/MonitorMetricEndpoint.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.common.monitor;
-
-import cn.hippo4j.agent.plugin.spring.common.conf.SpringBootConfig;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import com.sun.net.httpserver.HttpExchange;
-import com.sun.net.httpserver.HttpHandler;
-import com.sun.net.httpserver.HttpServer;
-import io.micrometer.core.instrument.Metrics;
-import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
-import io.micrometer.prometheus.PrometheusConfig;
-import io.micrometer.prometheus.PrometheusMeterRegistry;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.InetSocketAddress;
-
-/**
- * This class is responsible for exposing Prometheus metrics via an HTTP endpoint.
- * It initializes the Prometheus registry, binds it to the global metrics registry,
- * and starts an HTTP server to serve the metrics data.
- */
-public class MonitorMetricEndpoint {
-
- private static final ILog LOGGER = LogManager.getLogger(MonitorHandlersConfigurator.class);
-
- /**
- * Starts the Prometheus metrics HTTP server.
- *
- * This method performs the following steps:
- *
- * Initializes the PrometheusMeterRegistry with the default configuration.
- * Binds the Prometheus registry to the global CompositeMeterRegistry.
- * Attempts to start an HTTP server on the configured port to expose the Prometheus metrics.
- *
- * If the port is not configured, or if there is an error starting the server, appropriate error messages
- * are logged, and the method returns without starting the server.
- *
- */
- public static void startPrometheusEndpoint() {
-
- // Initialize the Prometheus registry
- PrometheusMeterRegistry prometheusRegistry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
-
- // Bind the Prometheus registry to the global Metrics registry
- CompositeMeterRegistry globalRegistry = Metrics.globalRegistry;
- globalRegistry.add(prometheusRegistry);
-
- // Get the configured port for the Prometheus metrics HTTP server
- Integer port = SpringBootConfig.Spring.Dynamic.Thread_Pool.Monitor.AGENT_MICROMETER_PORT;
- if (port == null) {
- LOGGER.error(
- "[Hippo4j-Agent] Failed to start Prometheus metrics endpoint server. Please configure the exposed endpoint by adding: spring.dynamic.thread-pool.monitor.agent-micrometer-port=xxx to the configuration file");
- return;
- }
-
- // Create the HTTP server
- HttpServer server = null;
- try {
- server = HttpServer.create(new InetSocketAddress(port), 0);
- } catch (IOException e) {
- LOGGER.error("[Hippo4j-Agent] Failed to start Prometheus metrics endpoint server", e);
- return;
- }
-
- // Register the /actuator/prometheus context to handle metrics requests
- server.createContext("/actuator/prometheus", exchange -> {
- String response = prometheusRegistry.scrape(); // Get metrics data in Prometheus format
- exchange.sendResponseHeaders(200, response.getBytes().length);
- try (OutputStream os = exchange.getResponseBody()) {
- os.write(response.getBytes());
- }
- });
-
- // Start the server
- server.start();
- LOGGER.info("[Hippo4j-Agent] Prometheus metrics server started on port {}", port);
- }
-
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/support/SpringEnvironmentSupport.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/support/SpringEnvironmentSupport.java
deleted file mode 100644
index d4b7e619..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/support/SpringEnvironmentSupport.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.common.support;
-
-import org.springframework.core.env.ConfigurableEnvironment;
-import org.springframework.core.env.MapPropertySource;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Spring environment support
- */
-public class SpringEnvironmentSupport {
-
- public static void disableNonAgentSwitch(ConfigurableEnvironment environment) {
- Map map = new HashMap<>();
- map.put("spring.dynamic.thread-pool.enable", false); // Switch off in non-Agent mode
- MapPropertySource propertySource = new MapPropertySource("Hippo4j-Agent-Properties", map);
- environment.getPropertySources().addLast(propertySource);
- }
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/support/SpringPropertiesLoader.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/support/SpringPropertiesLoader.java
deleted file mode 100644
index 907b2074..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/support/SpringPropertiesLoader.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.common.support;
-
-import cn.hippo4j.agent.core.boot.SpringBootConfigInitializer;
-import cn.hippo4j.agent.plugin.spring.common.toolkit.SpringPropertyBinder;
-import cn.hippo4j.common.extension.design.AbstractSubjectCenter;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-import cn.hippo4j.core.toolkit.inet.InetUtils;
-import cn.hippo4j.core.toolkit.inet.InetUtilsProperties;
-import cn.hippo4j.threadpool.dynamic.mode.config.properties.BootstrapConfigProperties;
-import lombok.Getter;
-import org.springframework.core.env.ConfigurableEnvironment;
-import org.springframework.core.env.EnumerablePropertySource;
-import org.springframework.core.env.PropertiesPropertySource;
-import org.springframework.core.env.PropertySource;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import static cn.hippo4j.threadpool.dynamic.mode.config.properties.BootstrapConfigProperties.PREFIX;
-
-/**
- * Spring properties loader
- */
-public class SpringPropertiesLoader {
-
- private static final ILog LOGGER = LogManager.getLogger(SpringPropertiesLoader.class);
-
- /**
- * A flag used to indicate whether loadSpringProperties() method has been called,
- * Used to determine whether the SpringPropertiesLoader has been initialized
- */
- @Getter
- private static final AtomicBoolean active = new AtomicBoolean(Boolean.FALSE);
-
- public static BootstrapConfigProperties BOOTSTRAP_CONFIG_PROPERTIES = new BootstrapConfigProperties();
-
- public static InetUtilsProperties INET_UTILS_PROPERTIES = new InetUtilsProperties();
-
- public static InetUtils inetUtils;
-
- public static void loadSpringProperties(ConfigurableEnvironment environment) {
- Iterator> iterator = environment.getPropertySources().iterator();
- Properties properties = new Properties();
- List> propertySourceList = new ArrayList<>();
- while (iterator.hasNext()) {
- propertySourceList.add(iterator.next());
- }
- // Sort to ensure that the configuration in the configuration center is after the array
- // To get the latest configuration information
- propertySourceList.sort(Comparator.comparing(
- // Make sure that Nacos boot's propertySource is placed first in the propertySourceList
- item -> !item.getClass().getName().equals("com.alibaba.nacos.spring.core.env.NacosPropertySource")));
-
- for (int i = propertySourceList.size() - 1; i >= 0; i--) {
- PropertySource> propertySource = propertySourceList.get(i);
- if (!(propertySource instanceof EnumerablePropertySource)) {
- LOGGER.warn("Skip propertySource[{}] because {} not enumerable.", propertySource.getName(), propertySource.getClass());
- continue;
- }
- LOGGER.info("Load propertySource[{}] into SpringProperties.", propertySource.getName());
- EnumerablePropertySource> enumerablePropertySource = (EnumerablePropertySource>) propertySource;
- String[] keys = enumerablePropertySource.getPropertyNames();
- for (String key : keys) {
- Object value = null;
- try {
- value = enumerablePropertySource.getProperty(key);
- if (value != null) {
- properties.put(key.toLowerCase(), value.toString());
- }
- } catch (Throwable e) {
- LOGGER.warn("Put property to spring properties failed, key=[{}], value=[{}]", key, value);
- }
- }
- }
- SpringBootConfigInitializer.setSpringProperties(properties);
- PropertiesPropertySource propertySource = new PropertiesPropertySource("customPropertySource", properties);
- environment.getPropertySources().addFirst(propertySource);
- // initialize BootstrapConfigProperties
- BOOTSTRAP_CONFIG_PROPERTIES = SpringPropertyBinder.bindProperties(environment, PREFIX, BootstrapConfigProperties.class);
- INET_UTILS_PROPERTIES = SpringPropertyBinder.bindProperties(environment, InetUtilsProperties.PREFIX, InetUtilsProperties.class);
- // Send AGENT_SPRING_PROPERTIES_LOADER_COMPLETED notification event Before active is false
- if (AbstractSubjectCenter.get(AbstractSubjectCenter.SubjectType.AGENT_SPRING_PROPERTIES_LOADER_COMPLETED) != null && Boolean.FALSE.equals(active.get())) {
- AbstractSubjectCenter.notify(AbstractSubjectCenter.SubjectType.AGENT_SPRING_PROPERTIES_LOADER_COMPLETED, () -> "");
- }
- active.set(Boolean.TRUE);
- // Enable the thread pool check alert handler
- ThreadPoolCheckAlarmSupport.enableThreadPoolCheckAlarmHandler();
- // Enable thread pool monitor handler
- ThreadPoolMonitorSupport.enableThreadPoolMonitorHandler(environment);
- }
-
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/support/SpringThreadPoolRegisterSupport.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/support/SpringThreadPoolRegisterSupport.java
deleted file mode 100644
index 4aba9498..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/support/SpringThreadPoolRegisterSupport.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.common.support;
-
-import cn.hippo4j.agent.core.util.ReflectUtil;
-import cn.hippo4j.common.executor.ThreadPoolExecutorRegistry;
-import cn.hippo4j.common.executor.support.BlockingQueueTypeEnum;
-import cn.hippo4j.common.executor.support.RejectedPolicyTypeEnum;
-import cn.hippo4j.common.handler.DynamicThreadPoolAdapterChoose;
-import cn.hippo4j.common.model.executor.ExecutorNotifyProperties;
-import cn.hippo4j.common.model.executor.ExecutorProperties;
-import cn.hippo4j.common.toolkit.StringUtil;
-import cn.hippo4j.common.toolkit.ThreadPoolExecutorUtil;
-import cn.hippo4j.threadpool.dynamic.mode.config.properties.BootstrapConfigProperties;
-import cn.hippo4j.threadpool.message.core.service.GlobalNotifyAlarmManage;
-import cn.hippo4j.threadpool.message.core.service.ThreadPoolNotifyAlarm;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.ApplicationContext;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-
-import static cn.hippo4j.common.constant.Constants.DYNAMIC_THREAD_POOL_EXECUTOR;
-
-/**
- * Spring thread pool register support
- */
-public class SpringThreadPoolRegisterSupport {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(SpringThreadPoolRegisterSupport.class);
-
- private static final int DEFAULT_ACTIVE_ALARM = 80;
-
- private static final int DEFAULT_CAPACITY_ALARM = 80;
-
- private static final int DEFAULT_INTERVAL = 5;
-
- private static final String DEFAULT_RECEIVES = "";
-
- public static void registerThreadPoolInstances(ApplicationContext context) {
- Map> referencedClassMap = ThreadPoolExecutorRegistry.REFERENCED_CLASS_MAP;
- for (Map.Entry> entry : referencedClassMap.entrySet()) {
- ThreadPoolExecutor enhancedInstance = entry.getKey();
- Class> declaredClass = entry.getValue();
- List declaredFields = ReflectUtil.getStaticFieldsFromType(declaredClass, ThreadPoolExecutor.class);
- for (Field field : declaredFields) {
- try {
- Object value = field.get(null);
- if (value == enhancedInstance) {
- String threadPoolId = declaredClass.getName() + "#" + field.getName();
- register(threadPoolId, enhancedInstance, Boolean.TRUE);
- break;
- }
- } catch (IllegalAccessException e) {
- LOGGER.error("Get static field error.", e);
- }
- }
- }
-
- Map beansWithAnnotation = context.getBeansOfType(Executor.class);
- beansWithAnnotation.forEach((beanName, bean) -> {
- ThreadPoolExecutor executor = null;
- // Get ThreadPoolExecutor Instance
- if (DynamicThreadPoolAdapterChoose.match(bean)) {
- executor = DynamicThreadPoolAdapterChoose.unwrap(bean);
- } else if (bean instanceof ThreadPoolTaskExecutor) {
- ThreadPoolTaskExecutor taskExecutor = (ThreadPoolTaskExecutor) bean;
- // Get a real instance of ThreadPoolExecutor
- executor = taskExecutor.getThreadPoolExecutor();
- } else if (bean instanceof ThreadPoolExecutor) {
- executor = (ThreadPoolExecutor) bean;
- } else {
- LOGGER.warn("[Hippo4j-Agent] Thread pool ignore registered beanName={}, Now Unsupported thread pool executor type:{} ", beanName, bean.getClass().getName());
- }
- if (executor == null) {
- LOGGER.warn("[Hippo4j-Agent] Thread pool is null, ignore bean registration. beanName={}, beanClass={}", beanName, bean.getClass().getName());
- } else {
- register(beanName, executor, Boolean.FALSE);
- }
- });
-
- LOGGER.info("[Hippo4j-Agent] Registered thread pool instances successfully.");
- }
-
- public static void register(String threadPoolId, ThreadPoolExecutor executor, Boolean isAgentScanEnhancePool) {
- if (executor == null) {
- return;
- }
- ExecutorProperties executorProperties =
- SpringPropertiesLoader.BOOTSTRAP_CONFIG_PROPERTIES.getExecutors().stream().filter(each -> Objects.equals(threadPoolId, each.getThreadPoolId())).findFirst().orElse(null);
-
- // Determines the thread pool that is currently obtained by bean scanning
- if (Objects.isNull(executorProperties)) {
- if (isAgentScanEnhancePool) {
- throw new RuntimeException(String.format("The thread pool id [%s] does not exist in the configuration.", threadPoolId));
- } else {
- // Thread pool that do not require enhancement are skipped by the agent
- return;
- }
- }
-
- try {
- executorProperties = buildActualExecutorProperties(executorProperties);
- // Replace the original configuration and refresh the thread pool
- threadPoolParamReplace(executor, executorProperties);
- } catch (Exception ex) {
- LOGGER.error("[Hippo4j-Agent] Failed to initialize thread pool configuration.", ex);
- }
- // Build notification information entity
- ThreadPoolNotifyAlarm threadPoolNotifyAlarm = buildThreadPoolNotifyAlarm(executorProperties);
- GlobalNotifyAlarmManage.put(threadPoolId, threadPoolNotifyAlarm);
-
- ThreadPoolExecutorRegistry.putHolder(threadPoolId, executor, executorProperties);
- }
-
- /**
- * Thread-pool param replace.
- *
- * @param executor dynamic thread-pool executor
- * @param executorProperties executor properties
- */
- private static void threadPoolParamReplace(ThreadPoolExecutor executor, ExecutorProperties executorProperties) {
- BlockingQueue workQueue = BlockingQueueTypeEnum.createBlockingQueue(executorProperties.getBlockingQueue(), executorProperties.getQueueCapacity());
- cn.hippo4j.common.toolkit.ReflectUtil.setFieldValue(executor, "workQueue", workQueue);
- ThreadPoolExecutorUtil.safeSetPoolSize(executor, executorProperties.getCorePoolSize(), executorProperties.getMaximumPoolSize());
- executor.setKeepAliveTime(executorProperties.getKeepAliveTime(), TimeUnit.SECONDS);
- executor.allowCoreThreadTimeOut(executorProperties.getAllowCoreThreadTimeOut());
- executor.setRejectedExecutionHandler(RejectedPolicyTypeEnum.createPolicy(executorProperties.getRejectedHandler()));
- // Reflection sets the thread pool setExecuteTimeOut
- if (DYNAMIC_THREAD_POOL_EXECUTOR.equals(executor.getClass().getName())) {
- try {
- Method setExecuteTimeOutMethod = executor.getClass().getMethod("setExecuteTimeOut", Long.class);
- Long executeTimeOut = executorProperties.getExecuteTimeOut();
- if (executeTimeOut != null) {
- setExecuteTimeOutMethod.invoke(executor, executeTimeOut);
- }
- } catch (Exception e) {
- LOGGER.error("[Hippo4j-Agent] Failed to set executeTimeOut.", e);
- }
- }
- }
-
- /**
- * Build actual executor properties.
- *
- * @param executorProperties executor properties
- * @return executor properties
- */
- private static ExecutorProperties buildActualExecutorProperties(ExecutorProperties executorProperties) {
- return Optional.ofNullable(SpringPropertiesLoader.BOOTSTRAP_CONFIG_PROPERTIES.getDefaultExecutor()).map(each -> buildExecutorProperties(executorProperties)).orElse(executorProperties);
- }
-
- /**
- * Build executor properties.
- *
- * @param executorProperties executor properties
- * @return executor properties
- */
- private static ExecutorProperties buildExecutorProperties(ExecutorProperties executorProperties) {
- BootstrapConfigProperties configProperties = SpringPropertiesLoader.BOOTSTRAP_CONFIG_PROPERTIES;
- return ExecutorProperties.builder()
- .corePoolSize(Optional.ofNullable(executorProperties.getCorePoolSize())
- .orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getCorePoolSize).get()))
- .maximumPoolSize(Optional.ofNullable(executorProperties.getMaximumPoolSize())
- .orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getMaximumPoolSize).get()))
- .allowCoreThreadTimeOut(Optional.ofNullable(executorProperties.getAllowCoreThreadTimeOut())
- .orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getAllowCoreThreadTimeOut).get()))
- .keepAliveTime(Optional.ofNullable(executorProperties.getKeepAliveTime())
- .orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getKeepAliveTime).get()))
- .blockingQueue(Optional.ofNullable(executorProperties.getBlockingQueue())
- .orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getBlockingQueue).get()))
- .executeTimeOut(Optional.ofNullable(executorProperties.getExecuteTimeOut())
- .orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getExecuteTimeOut).orElse(0L)))
- .queueCapacity(Optional.ofNullable(executorProperties.getQueueCapacity())
- .orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getQueueCapacity).get()))
- .rejectedHandler(Optional.ofNullable(executorProperties.getRejectedHandler())
- .orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getRejectedHandler).get()))
- .threadNamePrefix(StringUtil.isBlank(executorProperties.getThreadNamePrefix()) ? executorProperties.getThreadPoolId() : executorProperties.getThreadNamePrefix())
- .threadPoolId(executorProperties.getThreadPoolId())
- .alarm(Optional.ofNullable(executorProperties.getAlarm()).orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getAlarm).orElse(null)))
- .activeAlarm(Optional.ofNullable(executorProperties.getActiveAlarm())
- .orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getActiveAlarm).orElse(null)))
- .capacityAlarm(Optional.ofNullable(executorProperties.getCapacityAlarm())
- .orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getCapacityAlarm).orElse(null)))
- .notify(Optional.ofNullable(executorProperties.getNotify()).orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getNotify).orElse(null)))
- .nodes(Optional.ofNullable(executorProperties.getNodes()).orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getNodes).orElse(null)))
- .build();
- }
-
- /**
- * Build thread-pool notify alarm
- *
- * @param executorProperties executor properties
- * @return thread-pool notify alarm
- */
- private static ThreadPoolNotifyAlarm buildThreadPoolNotifyAlarm(ExecutorProperties executorProperties) {
- BootstrapConfigProperties configProperties = SpringPropertiesLoader.BOOTSTRAP_CONFIG_PROPERTIES;
- ExecutorNotifyProperties notify = Optional.ofNullable(executorProperties).map(ExecutorProperties::getNotify).orElse(null);
- boolean isAlarm = Optional.ofNullable(executorProperties.getAlarm()).orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getAlarm).orElse(true));
- int activeAlarm = Optional.ofNullable(executorProperties.getActiveAlarm())
- .orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getActiveAlarm).orElse(DEFAULT_ACTIVE_ALARM));
- int capacityAlarm = Optional.ofNullable(executorProperties.getCapacityAlarm())
- .orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getCapacityAlarm).orElse(DEFAULT_CAPACITY_ALARM));
- int interval = Optional.ofNullable(notify).map(ExecutorNotifyProperties::getInterval)
- .orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getNotify).map(ExecutorNotifyProperties::getInterval).orElse(DEFAULT_INTERVAL));
- String receive = Optional.ofNullable(notify).map(ExecutorNotifyProperties::getReceives)
- .orElseGet(() -> Optional.ofNullable(configProperties.getDefaultExecutor()).map(ExecutorProperties::getNotify).map(ExecutorNotifyProperties::getReceives).orElse(DEFAULT_RECEIVES));
- ThreadPoolNotifyAlarm threadPoolNotifyAlarm = new ThreadPoolNotifyAlarm(isAlarm, activeAlarm, capacityAlarm);
- threadPoolNotifyAlarm.setInterval(interval);
- threadPoolNotifyAlarm.setReceives(receive);
- return threadPoolNotifyAlarm;
- }
-
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/support/ThreadPoolCheckAlarmSupport.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/support/ThreadPoolCheckAlarmSupport.java
deleted file mode 100644
index 58cd2131..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/support/ThreadPoolCheckAlarmSupport.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.common.support;
-
-import cn.hippo4j.agent.plugin.spring.common.alarm.AgentModeNotifyConfigBuilder;
-import cn.hippo4j.agent.plugin.spring.common.conf.SpringBootConfig;
-import cn.hippo4j.agent.plugin.spring.common.toolkit.SpringPropertyBinder;
-import cn.hippo4j.common.propertie.EnvironmentProperties;
-import cn.hippo4j.core.config.ApplicationContextHolder;
-import cn.hippo4j.core.toolkit.IdentifyUtil;
-import cn.hippo4j.core.toolkit.inet.InetUtils;
-import cn.hippo4j.core.toolkit.inet.InetUtilsProperties;
-import cn.hippo4j.threadpool.alarm.handler.DefaultThreadPoolCheckAlarmHandler;
-import cn.hippo4j.threadpool.message.api.NotifyConfigDTO;
-import cn.hippo4j.threadpool.message.core.platform.DingSendMessageHandler;
-import cn.hippo4j.threadpool.message.core.platform.LarkSendMessageHandler;
-import cn.hippo4j.threadpool.message.core.platform.WeChatSendMessageHandler;
-import cn.hippo4j.threadpool.message.core.service.AlarmControlHandler;
-import cn.hippo4j.threadpool.message.core.service.DefaultThreadPoolConfigChangeHandler;
-import cn.hippo4j.threadpool.message.core.service.SendMessageHandler;
-import cn.hippo4j.threadpool.message.core.service.ThreadPoolBaseSendMessageService;
-import lombok.Getter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.core.env.ConfigurableEnvironment;
-
-import java.util.List;
-import java.util.Map;
-
-import static cn.hippo4j.agent.plugin.spring.common.support.SpringPropertiesLoader.BOOTSTRAP_CONFIG_PROPERTIES;
-
-/**
- * The {@code ThreadPoolCheckAlarmSupport} class provides functionality to enable and configure
- * a thread pool check alarm handler. This is typically used to monitor thread pools for potential
- * issues and send notifications based on the configured alert mechanisms.
- */
-public class ThreadPoolCheckAlarmSupport {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(ThreadPoolCheckAlarmSupport.class);
-
- @Getter
- private static ThreadPoolBaseSendMessageService threadPoolBaseSendMessageService;
-
- @Getter
- private static DefaultThreadPoolConfigChangeHandler threadPoolConfigChangeHandler;
-
- @Getter
- private static AgentModeNotifyConfigBuilder agentNotifyConfigBuilder;
-
- private static DefaultThreadPoolCheckAlarmHandler checkAlarmHandler;
-
- /**
- * Enables the thread pool check alarm handler if the corresponding configuration property is set to {@code true}.
- *
- * This method performs the following actions:
- *
- * Checks the value of the {@code enable} property in the bootstrap configuration. If it is {@code true}, it proceeds.
- * Initializes environment properties needed for the monitoring process.
- * Creates an instance of {@link AlarmControlHandler} and {@link ThreadPoolBaseSendMessageService} with necessary dependencies.
- * Initializes and registers message handlers and notification configurations.
- * Creates an instance of {@link DefaultThreadPoolCheckAlarmHandler} and schedules it to start monitoring the thread pool.
- *
- */
- public static void enableThreadPoolCheckAlarmHandler() {
- // Check if the thread pool checker is enabled in the bootstrap configuration properties
- if (Boolean.TRUE.equals(BOOTSTRAP_CONFIG_PROPERTIES.getEnable())) {
-
- // Initialize EnvironmentProperties
- initializeEnvironmentProperties();
-
- // Initialize the AlarmControlHandler and ThreadPoolBaseSendMessageService
- AlarmControlHandler alarmControlHandler = new AlarmControlHandler();
- threadPoolBaseSendMessageService = createThreadPoolBaseSendMessageService(alarmControlHandler);
- threadPoolConfigChangeHandler = new DefaultThreadPoolConfigChangeHandler(threadPoolBaseSendMessageService);
-
- // Initialize the alarm platform information
- initializeSendMessageHandlers(threadPoolBaseSendMessageService, alarmControlHandler);
-
- // Execute scheduled task to check an alarm
- scheduleExecute(threadPoolBaseSendMessageService);
-
- LOGGER.info("[Hippo4j-Agent] Start Check AlarmHandler the running status of dynamic thread pools.");
-
- }
- }
-
- /**
- * Initializes environment properties used for thread pool monitoring.
- *
- * This method sets the state check interval, item ID, application name, and active profile from the bootstrap configuration.
- */
- private static void initializeEnvironmentProperties() {
- EnvironmentProperties.checkStateInterval = Long.valueOf(BOOTSTRAP_CONFIG_PROPERTIES.getCheckStateInterval());
- EnvironmentProperties.itemId = BOOTSTRAP_CONFIG_PROPERTIES.getItemId();
- EnvironmentProperties.applicationName = SpringBootConfig.Spring.Application.name;
- EnvironmentProperties.active = SpringBootConfig.Spring.Profiles.active;
- ConfigurableEnvironment environment = ApplicationContextHolder.getBean(ConfigurableEnvironment.class);
- InetUtilsProperties inetUtilsProperties = SpringPropertyBinder.bindProperties(environment, InetUtilsProperties.PREFIX, InetUtilsProperties.class);
- SpringPropertiesLoader.inetUtils = new InetUtils(inetUtilsProperties);
- IdentifyUtil.generate(environment, SpringPropertiesLoader.inetUtils);
- }
-
- /**
- * Creates and returns a new instance of {@link ThreadPoolBaseSendMessageService} with the specified {@link AlarmControlHandler}.
- *
- * @param alarmControlHandler The {@link AlarmControlHandler} used to control and handle alarms.
- * @return A new instance of {@link ThreadPoolBaseSendMessageService}.
- */
- private static ThreadPoolBaseSendMessageService createThreadPoolBaseSendMessageService(AlarmControlHandler alarmControlHandler) {
- return new ThreadPoolBaseSendMessageService(alarmControlHandler);
- }
-
- /**
- * Initializes and registers the message handlers and notification configurations in the specified
- * {@link ThreadPoolBaseSendMessageService}.
- *
- * This method creates instances of various {@link SendMessageHandler} implementations and registers them.
- * It also constructs and registers notification configurations using the {@link AgentModeNotifyConfigBuilder}.
- *
- * @param threadPoolBaseSendMessageService The {@link ThreadPoolBaseSendMessageService} in which message handlers and notification configurations will be registered.
- * @param alarmControlHandler The {@link AlarmControlHandler} used to handle alarms and notifications.
- */
- private static void initializeSendMessageHandlers(ThreadPoolBaseSendMessageService threadPoolBaseSendMessageService, AlarmControlHandler alarmControlHandler) {
- // Initialize message handlers
- DingSendMessageHandler dingSendMessageHandler = new DingSendMessageHandler();
- WeChatSendMessageHandler weChatSendMessageHandler = new WeChatSendMessageHandler();
- LarkSendMessageHandler larkSendMessageHandler = new LarkSendMessageHandler();
-
- // Register message handlers
- threadPoolBaseSendMessageService.getSendMessageHandlers().put(dingSendMessageHandler.getType(), dingSendMessageHandler);
- threadPoolBaseSendMessageService.getSendMessageHandlers().put(weChatSendMessageHandler.getType(), weChatSendMessageHandler);
- threadPoolBaseSendMessageService.getSendMessageHandlers().put(larkSendMessageHandler.getType(), larkSendMessageHandler);
-
- // Construct and register notification configurations
- // TODO : register notify config for web , null Can be replaced with tomcat, jetty, undertow, etc. implementation classes
- agentNotifyConfigBuilder = new AgentModeNotifyConfigBuilder(alarmControlHandler, null);
- Map> notifyConfigs = agentNotifyConfigBuilder.buildNotify();
- threadPoolBaseSendMessageService.getNotifyConfigs().putAll(notifyConfigs);
- }
-
- // 启动或重新启动检查任务
- public static void scheduleExecute(ThreadPoolBaseSendMessageService threadPoolBaseSendMessageService) {
- // If a task is already running, cancel it first
- if (checkAlarmHandler != null) {
- // Shut down the thread pool and prepare to regenerate the listener thread pool
- checkAlarmHandler.destroyScheduleExecute();
- }
- // Initialize the thread pool check alarm handler with necessary services
- checkAlarmHandler = new DefaultThreadPoolCheckAlarmHandler(threadPoolBaseSendMessageService);
- // Run the check alarm handler to start monitoring the thread pool
- checkAlarmHandler.scheduleExecute();
- }
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/support/ThreadPoolMonitorSupport.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/support/ThreadPoolMonitorSupport.java
deleted file mode 100644
index a45c4fa9..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/support/ThreadPoolMonitorSupport.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.common.support;
-
-import cn.hippo4j.agent.plugin.spring.common.monitor.MonitorHandlersConfigurator;
-import cn.hippo4j.agent.plugin.spring.common.monitor.MonitorMetricEndpoint;
-import cn.hippo4j.common.executor.ThreadPoolExecutorRegistry;
-import cn.hippo4j.common.extension.spi.ServiceLoaderRegistry;
-import cn.hippo4j.common.monitor.MonitorCollectTypeEnum;
-import cn.hippo4j.common.toolkit.StringUtil;
-import cn.hippo4j.threadpool.dynamic.mode.config.properties.BootstrapConfigProperties;
-import cn.hippo4j.threadpool.dynamic.mode.config.properties.MonitorProperties;
-import cn.hippo4j.threadpool.monitor.api.ThreadPoolMonitor;
-import lombok.Getter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.core.env.ConfigurableEnvironment;
-import org.springframework.core.env.Environment;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import static cn.hippo4j.agent.plugin.spring.common.support.SpringPropertiesLoader.BOOTSTRAP_CONFIG_PROPERTIES;
-
-/**
- * This class provides support for monitoring dynamic thread pools in an application.
- * It includes methods to initialize and enable monitoring components, and schedules
- * periodic data collection from the thread pools.
- */
-public class ThreadPoolMonitorSupport {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(ThreadPoolMonitorSupport.class);
-
- /**
- * A flag used to indicate whether enableThreadPoolMonitorHandler() method has been called,
- * Used to determine whether the ThreadPoolMonitorHandler has been enable
- */
- @Getter
- private static final AtomicBoolean active = new AtomicBoolean(Boolean.FALSE);
-
- private static final ScheduledExecutorService collectScheduledExecutor = new ScheduledThreadPoolExecutor(1, r -> new Thread(r, "client.agent.scheduled.collect.data"));
-
- private static final List threadPoolMonitors = new ArrayList<>();
-
- static {
- // Register the ThreadPoolMonitor service with the ServiceLoaderRegistry
- ServiceLoaderRegistry.register(ThreadPoolMonitor.class);
- }
-
- /**
- * Enables the dynamic thread pool monitoring handler.
- *
- * This method performs the following steps:
- *
- * Validates the monitoring configuration from the environment properties.
- * Initializes monitoring components for the dynamic thread pools.
- * Exposes metric endpoints, such as Prometheus, if configured.
- * Schedules periodic collection of metrics from the thread pools.
- *
- * If the monitoring configuration is invalid or disabled, the method returns without
- * enabling the monitoring handler.
- *
- *
- * @param environment The environment from which the monitoring configuration is loaded.
- */
- public static void enableThreadPoolMonitorHandler(Environment environment) {
- BootstrapConfigProperties properties = BOOTSTRAP_CONFIG_PROPERTIES;
- MonitorProperties monitor = properties.getMonitor();
- if (Objects.isNull(monitor) || !monitor.getEnable() || StringUtil.isBlank(monitor.getThreadPoolTypes()) || StringUtil.isBlank(monitor.getCollectTypes())) {
- return;
- }
-
- LOGGER.info("[Hippo4j-Agent] Start monitoring the running status of dynamic thread pools.");
-
- // Initialize monitoring components for the dynamic thread pools
- MonitorHandlersConfigurator.initializeMonitorHandlers(monitor, (ConfigurableEnvironment) environment, threadPoolMonitors);
-
- // Determine whether the task is successfully enabled
- // return directly if it has been enabled, and do not start the thread pool repeatedly
- if (Boolean.TRUE.equals(active.get()))
- return;
-
- // Expose metric endpoints based on the configured collect types
- List collectTypes = Arrays.asList(monitor.getCollectTypes().split(","));
- if (collectTypes.contains(MonitorCollectTypeEnum.MICROMETER.getValue())) {
- MonitorMetricEndpoint.startPrometheusEndpoint();
- }
-
- // Schedule periodic collection of metrics from the thread pools
- Runnable scheduledTask = scheduleRunnable();
- collectScheduledExecutor.scheduleWithFixedDelay(scheduledTask, monitor.getInitialDelay(), monitor.getCollectInterval(), TimeUnit.MILLISECONDS);
-
- active.set(true);
- if (ThreadPoolExecutorRegistry.getThreadPoolExecutorSize() > 0) {
- LOGGER.info("[Hippo4j-Agent] Dynamic thread pool: [{}]. The dynamic thread pool starts data collection and reporting.", ThreadPoolExecutorRegistry.getThreadPoolExecutorSize());
- }
- }
-
- /**
- * Returns a Runnable task that collects metrics from the dynamic thread pools.
- *
- * This method is used to create a task that periodically iterates over the
- * registered thread pool monitors and collects their metrics. If an exception
- * occurs during the collection, it is logged.
- *
- *
- * @return A Runnable task that performs the metrics collection.
- */
- private static Runnable scheduleRunnable() {
- return () -> {
- for (ThreadPoolMonitor each : threadPoolMonitors) {
- try {
- each.collect();
- } catch (Throwable ex) {
- LOGGER.error("[Hippo4j-Agent] Error monitoring the running status of dynamic thread pool. Type: {}", each.getType(), ex);
- }
- }
- };
- }
-
-}
diff --git a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/toolkit/SpringPropertyBinder.java b/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/toolkit/SpringPropertyBinder.java
deleted file mode 100644
index 22a6bc62..00000000
--- a/agent/hippo4j-agent-plugin/spring-plugins/spring-plugin-common/src/main/java/cn/hippo4j/agent/plugin/spring/common/toolkit/SpringPropertyBinder.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.spring.common.toolkit;
-
-import cn.hippo4j.threadpool.dynamic.mode.config.parser.ConfigFileTypeEnum;
-import org.springframework.beans.BeanWrapper;
-import org.springframework.beans.BeanWrapperImpl;
-import org.springframework.core.env.Environment;
-import org.springframework.core.env.PropertySource;
-import org.springframework.core.env.ConfigurableEnvironment;
-import org.springframework.core.env.MapPropertySource;
-
-import java.beans.PropertyEditorSupport;
-import java.util.*;
-
-/**
- * CustomPropertyBinder is a utility class for binding properties from Spring's Environment
- * to Java objects based on a given prefix. This is useful for dynamically binding configurations
- * in Spring applications where configuration properties are organized hierarchically and need to be
- * mapped to corresponding Java objects.
- *
- * This class handles complex property structures, including nested properties and collections,
- * ensuring that all properties prefixed with the specified string are correctly bound to the target
- * Java object.
- */
-public class SpringPropertyBinder {
-
- /**
- * Binds properties from the Spring Environment to an instance of the specified configuration class.
- *
- * @param environment the Spring Environment containing property sources.
- * @param prefix the prefix to filter properties for binding (e.g., "spring.dynamic.thread-pool").
- * @param clazz the class type of the configuration object to bind properties to.
- * @param the type of the configuration class.
- * @return an instance of the configuration class with properties bound from the environment.
- * @throws RuntimeException if there is an error instantiating the configuration class or binding properties.
- */
- public static T bindProperties(Environment environment, String prefix, Class clazz) {
- try {
- // Create an instance of the target class
- T instance = clazz.getDeclaredConstructor().newInstance();
- BeanWrapper beanWrapper = new BeanWrapperImpl(instance);
-
- // Register custom editor for ConfigFileTypeEnum to handle specific type conversions
- beanWrapper.registerCustomEditor(ConfigFileTypeEnum.class, new ConfigFileTypeEnumEditor());
-
- // Iterate over all property keys that match the given prefix
- for (String key : getAllPropertyKeys(environment, prefix)) {
- String propertyName = key.substring(prefix.length() + 1); // Remove prefix from the property key
- String[] tokens = propertyName.split("\\."); // Split the property name by dot for nested properties
- setPropertyValue(tokens, beanWrapper, environment.getProperty(key)); // Set the property value recursively
- }
-
- return instance;
- } catch (Exception e) {
- throw new RuntimeException("Unable to bind properties to " + clazz.getName(), e);
- }
- }
-
- /**
- * Binds properties from a map to an instance of the specified configuration class.
- *
- * @param configInfo a map containing property paths and their values.
- * @param prefix the prefix to filter properties for binding (e.g., "spring.dynamic.thread-pool").
- * @param clazz the class type of the configuration object to bind properties to.
- * @param the type of the configuration class.
- * @return an instance of the configuration class with properties bound from the configInfo map.
- */
- public static T bindProperties(Map configInfo, String prefix, Class clazz) {
- try {
- // Create an instance of the target class
- T instance = clazz.getDeclaredConstructor().newInstance();
- BeanWrapper beanWrapper = new BeanWrapperImpl(instance);
-
- // Register custom editor for specific type conversions (if needed)
- beanWrapper.registerCustomEditor(ConfigFileTypeEnum.class, new ConfigFileTypeEnumEditor());
-
- // Iterate over all property keys that match the given prefix in the configInfo map
- for (Map.Entry entry : configInfo.entrySet()) {
- String key = entry.getKey().toString();
- if (key.startsWith(prefix)) {
- String propertyName = key.substring(prefix.length() + 1); // Remove prefix from the property key
- String[] tokens = propertyName.split("\\."); // Split the property name by dot for nested properties
- setPropertyValue(tokens, beanWrapper, entry.getValue().toString()); // Set the property value recursively
- }
- }
- return instance;
- } catch (Exception e) {
- throw new RuntimeException("Unable to bind properties to " + clazz.getName(), e);
- }
- }
-
- /**
- * Recursively sets property values on the target object, handling nested properties and collections.
- *
- * @param tokens an array of property path tokens (e.g., ["nested", "property", "name"]).
- * @param beanWrapper the BeanWrapper instance used to manipulate the target object.
- * @param value the value to set on the target property.
- */
- private static void setPropertyValue(String[] tokens, BeanWrapper beanWrapper, String value) {
- for (int i = 0; i < tokens.length - 1; i++) {
- String token = tokens[i];
-
- if (token.matches(".*\\[\\d+\\]$")) { // Handle array/list property
- token = token.substring(0, token.indexOf('['));
- int index = Integer.parseInt(tokens[i].substring(token.length() + 1, tokens[i].length() - 1));
-
- token = convertToCamelCase(token); // Convert token to camelCase if necessary
- List list = (List) beanWrapper.getPropertyValue(token);
- if (list == null) {
- list = new ArrayList<>();
- beanWrapper.setPropertyValue(convertToCamelCase(token), list); // Initialize the list if it's null
- }
-
- // Ensure the list has enough size to accommodate the index
- if (list.size() <= index) {
- try {
- // Instantiate the list element if it does not exist
- list.add(index, beanWrapper.getPropertyTypeDescriptor(token)
- .getElementTypeDescriptor().getType().newInstance());
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- // Move the beanWrapper context to the current list element
- beanWrapper = new BeanWrapperImpl(list.get(index));
- } else { // Handle simple or nested property
- Object nestedObject = beanWrapper.getPropertyValue(token);
- if (nestedObject == null) {
- Class> nestedClass = beanWrapper.getPropertyType(token);
- if (Map.class.isAssignableFrom(nestedClass)) {
- nestedObject = new HashMap<>(); // Initialize nested Map if necessary
- } else {
- try {
- nestedObject = nestedClass.getDeclaredConstructor().newInstance();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- beanWrapper.setPropertyValue(convertToCamelCase(token), nestedObject);
- }
- // Move the beanWrapper context to the nested object
- beanWrapper = new BeanWrapperImpl(nestedObject);
- }
- }
-
- // Finally, set the actual property value on the resolved object
- String finalPropertyName = tokens[tokens.length - 1];
- Object currentObject = beanWrapper.getWrappedInstance();
- if (currentObject instanceof Map) {
- // If the current object is a Map, set the value as a key-value pair
- ((Map) currentObject).put(finalPropertyName, value);
- } else {
- // Otherwise, set it as a simple property
- beanWrapper.setPropertyValue(convertToCamelCase(finalPropertyName), value);
- }
- }
-
- /**
- * Retrieves all property keys from the environment that start with the given prefix.
- *
- * @param environment the Spring Environment containing property sources.
- * @param prefix the prefix to filter property keys.
- * @return a set of property keys that match the prefix.
- */
- private static Set getAllPropertyKeys(Environment environment, String prefix) {
- Set keys = new HashSet<>();
- // Iterate through all property sources in the environment
- for (PropertySource> propertySource : ((ConfigurableEnvironment) environment).getPropertySources()) {
- if (propertySource instanceof MapPropertySource) {
- Map source = ((MapPropertySource) propertySource).getSource();
- // Collect keys that start with the specified prefix
- for (String key : source.keySet()) {
- if (key.startsWith(prefix)) {
- keys.add(key);
- }
- }
- }
- }
- return keys;
- }
-
- /**
- * Converts a dashed-separated string to camelCase.
- *
- * For example, "my-property-name" -> "myPropertyName".
- *
- * @param dashed the dashed-separated string to be converted.
- * @return the camelCase representation of the input string.
- */
- private static String convertToCamelCase(String dashed) {
- String[] parts = dashed.split("-");
- return Arrays.stream(parts)
- .map(part -> part.substring(0, 1).toUpperCase() + part.substring(1)) // Capitalize each part
- .reduce((first, second) -> first + second) // Concatenate all parts together
- .map(result -> result.substring(0, 1).toLowerCase() + result.substring(1)) // Lowercase the first letter
- .orElse(dashed);
- }
-
- /**
- * ConfigFileTypeEnumEditor is a custom property editor for converting string representations
- * of {@link ConfigFileTypeEnum} into the corresponding enum instances.
- *
- * This editor is useful in scenarios where properties are read as strings but need to be
- * converted to enum types for further processing.
- */
- public static class ConfigFileTypeEnumEditor extends PropertyEditorSupport {
-
- /**
- * Converts the given text value to the corresponding {@link ConfigFileTypeEnum} instance.
- *
- * This method overrides the default implementation to parse the input string and convert
- * it into a {@link ConfigFileTypeEnum}. If the input string does not match any known enum
- * value, an {@link IllegalArgumentException} will be thrown.
- *
- * @param text the string representation of the enum to be converted.
- * @throws IllegalArgumentException if the text does not match any known enum value.
- */
- @Override
- public void setAsText(String text) throws IllegalArgumentException {
- setValue(ConfigFileTypeEnum.of(text));
- }
- }
-
-}
diff --git a/agent/hippo4j-agent-plugin/threadpool-plugin/pom.xml b/agent/hippo4j-agent-plugin/threadpool-plugin/pom.xml
deleted file mode 100644
index 16517f4c..00000000
--- a/agent/hippo4j-agent-plugin/threadpool-plugin/pom.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
- 4.0.0
-
- cn.hippo4j
- hippo4j-agent-plugin
- ${revision}
-
-
- hippo4j-agent-threadpool-plugin
-
-
-
- cn.hippo4j
- hippo4j-threadpool-core
- ${project.version}
-
-
- cn.hippo4j
- hippo4j-threadpool-infra-common
- ${project.version}
-
-
-
\ No newline at end of file
diff --git a/agent/hippo4j-agent-plugin/threadpool-plugin/src/main/java/cn/hippo4j/agent/plugin/thread/pool/define/ThreadPoolExecutorInstrumentation.java b/agent/hippo4j-agent-plugin/threadpool-plugin/src/main/java/cn/hippo4j/agent/plugin/thread/pool/define/ThreadPoolExecutorInstrumentation.java
deleted file mode 100644
index 0480cdc7..00000000
--- a/agent/hippo4j-agent-plugin/threadpool-plugin/src/main/java/cn/hippo4j/agent/plugin/thread/pool/define/ThreadPoolExecutorInstrumentation.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.thread.pool.define;
-
-import cn.hippo4j.agent.core.plugin.interceptor.ConstructorInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
-import cn.hippo4j.agent.core.plugin.match.ClassMatch;
-import cn.hippo4j.agent.core.plugin.match.NameMatch;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-
-import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
-
-/**
- * Thread pool executor instrumentation
- */
-public class ThreadPoolExecutorInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
-
- private static final String ENHANCE_CLASS = "java.util.concurrent.ThreadPoolExecutor";
-
- private static final String CONSTRUCTOR_INTERCEPT_CLASS = "cn.hippo4j.agent.plugin.thread.pool.interceptor.ThreadPoolExecutorConstructorMethodInterceptor";
-
- private static final int CONSTRUCTOR_INTERCEPT_PARAMETER_LENGTH = 7;
-
- @Override
- protected ClassMatch enhanceClass() {
- return NameMatch.byName(ENHANCE_CLASS);
- }
-
- @Override
- public boolean isBootstrapInstrumentation() {
- return true;
- }
-
- /**
- * The constructor method that only intercepts all parameters prevents repeated interception.
- */
- @Override
- public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
- return new ConstructorInterceptPoint[]{
- new ConstructorInterceptPoint() {
-
- @Override
- public ElementMatcher getConstructorMatcher() {
- return takesArguments(CONSTRUCTOR_INTERCEPT_PARAMETER_LENGTH);
- }
-
- @Override
- public String getConstructorInterceptor() {
- return CONSTRUCTOR_INTERCEPT_CLASS;
- }
- }
- };
- }
-
- @Override
- public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
- return new InstanceMethodsInterceptPoint[0];
- }
-}
diff --git a/agent/hippo4j-agent-plugin/threadpool-plugin/src/main/java/cn/hippo4j/agent/plugin/thread/pool/interceptor/ThreadPoolExecutorConstructorMethodInterceptor.java b/agent/hippo4j-agent-plugin/threadpool-plugin/src/main/java/cn/hippo4j/agent/plugin/thread/pool/interceptor/ThreadPoolExecutorConstructorMethodInterceptor.java
deleted file mode 100644
index db1019d4..00000000
--- a/agent/hippo4j-agent-plugin/threadpool-plugin/src/main/java/cn/hippo4j/agent/plugin/thread/pool/interceptor/ThreadPoolExecutorConstructorMethodInterceptor.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package cn.hippo4j.agent.plugin.thread.pool.interceptor;
-
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import cn.hippo4j.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
-import cn.hippo4j.agent.core.util.CollectionUtil;
-import cn.hippo4j.agent.core.util.StringUtil;
-import cn.hippo4j.common.conf.Config;
-import cn.hippo4j.common.executor.ThreadPoolExecutorRegistry;
-import cn.hippo4j.common.logging.api.ILog;
-import cn.hippo4j.common.logging.api.LogManager;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.ThreadPoolExecutor;
-
-/**
- * Thread pool executor constructor method interceptor
- */
-public class ThreadPoolExecutorConstructorMethodInterceptor implements InstanceConstructorInterceptor {
-
- private static final ILog LOGGER = LogManager.getLogger(ThreadPoolExecutorConstructorMethodInterceptor.class);
-
- private static final List EXCLUDE_STACK_TRACE_ELEMENT_CLASS_PREFIX = Arrays.asList("java", "cn.hippo4j.agent");
-
- private static final int INITIAL_CAPACITY = 3;
-
- @Override
- public void onConstruct(EnhancedInstance objInst, Object[] allArguments) throws Throwable {
-
- List stackTraceElements = getStackTraceElements();
- if (CollectionUtil.isEmpty(stackTraceElements)) {
- return;
- }
- StackTraceElement declaredClassStackTraceElement = stackTraceElements.get(0);
- String declaredClassName = declaredClassStackTraceElement.getClassName();
- Class> declaredClass = null;
- try {
- declaredClass = Thread.currentThread().getContextClassLoader().loadClass(declaredClassName);
- } catch (ClassNotFoundException e) {
- // The thread pool in the Agent plug-in is loaded by AgentclassLodaer.
- // Due to the delegation model, it can only be searched upwards, so searching here will result in ClassNotFount.
- // Because the parent of AgentClassLoader is AppclassLoder, it is ignored here ,skip the enhancement logic
- LOGGER.debug("searching {} result in ClassNotFount , so skip the enhancement logic", declaredClassName);
- return;
- }
- ThreadPoolExecutorRegistry.REFERENCED_CLASS_MAP.put((ThreadPoolExecutor) objInst, declaredClass);
- }
-
- private List getStackTraceElements() {
- StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
- int i;
- for (i = 0; i < stackTraceElements.length; i++) {
- String fullClassName = stackTraceElements[i].getClassName();
- if (isBusinessStackTraceClassName(fullClassName)) {
- if (isExcludeThreadPoolClass(fullClassName)) {
- return Collections.emptyList();
- } else {
- break;
- }
- }
- }
-
- List result = new ArrayList<>(INITIAL_CAPACITY); // Find up to three layers
- for (int j = 0; i < stackTraceElements.length && j < INITIAL_CAPACITY; i++, j++) {
- String fullClassName = stackTraceElements[i].getClassName();
- if (isExcludeThreadPoolClass(fullClassName)) {
- break;
- } else {
- result.add(stackTraceElements[i]);
- }
- }
-
- return result;
- }
-
- private boolean isBusinessStackTraceClassName(String className) {
- for (String prefix : EXCLUDE_STACK_TRACE_ELEMENT_CLASS_PREFIX) {
- if (className.startsWith(prefix)) {
- return false;
- }
- }
- return true;
- }
- private boolean isExcludeThreadPoolClass(String className) {
- if (StringUtil.isBlank(className)) {
- return true;
- }
- List excludePackagePrefix = Config.Plugin.ThreadPool.EXCLUDE_PACKAGE_PREFIX;
- for (String excludePrefix : excludePackagePrefix) {
- if (className.startsWith(excludePrefix)) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/agent/hippo4j-agent-plugin/threadpool-plugin/src/main/resources/hippo4j-plugin.def b/agent/hippo4j-agent-plugin/threadpool-plugin/src/main/resources/hippo4j-plugin.def
deleted file mode 100644
index d84d9489..00000000
--- a/agent/hippo4j-agent-plugin/threadpool-plugin/src/main/resources/hippo4j-plugin.def
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-thread-pool-plugin=cn.hippo4j.agent.plugin.thread.pool.define.ThreadPoolExecutorInstrumentation
\ No newline at end of file
diff --git a/agent/pom.xml b/agent/pom.xml
deleted file mode 100644
index 4f7c0abb..00000000
--- a/agent/pom.xml
+++ /dev/null
@@ -1,270 +0,0 @@
-
-
- 4.0.0
-
- cn.hippo4j
- hippo4j-all
- ${revision}
-
- hippo4j-agent
- pom
-
-
- hippo4j-agent-core
- hippo4j-agent-plugin
- hippo4j-agent-bootstrap
-
-
-
- cn.hippo4j.agent.dependencies
- 1.8
- 4.13.1
- 2.0.7
- 3.5.13
- 1.18.34
-
-
- 1.12.13
- 1.44.0
- 4.1.79.Final
- 2.8.9
- 1.6.2
- 1.3.2
- 3.1
-
- 6.0.53
-
-
- 0.6.1
- 1.6.0
- 1.8
- 2.10
- 2.8.2
- 3.1.0
- 2.22.0
- 3.2.0
- 3.1.0
- 3.1.1
- 3.0.0-M2
- 3.8.0
- 3.1.0
- 3.0.1
- 2.5
- 4.3.0
- 3.1.0
- 1.33
- 1.5
- true
- 1.7.25
- 32.0.0-jre
- 2.16.0
-
-
-
-
-
- cn.hippo4j
- hippo4j-agent-core
- ${project.version}
-
-
- cn.hippo4j
- hippo4j-threadpool-common
- ${project.version}
- provided
-
-
- com.google.code.gson
- gson
- ${gson.version}
-
-
- com.google.guava
- guava
- ${guava.version}
-
-
- net.bytebuddy
- byte-buddy
- ${bytebuddy.version}
-
-
- org.slf4j
- slf4j-api
- ${slf4j.version}
-
-
- org.openjdk.jmh
- jmh-core
- ${jmh.version}
- test
-
-
- org.projectlombok
- lombok
- ${lombok.version}
- provided
-
-
- javax.annotation
- javax.annotation-api
- ${javax.annotation-api.version}
- provided
-
-
- junit
- junit
- ${junit.version}
- test
-
-
- org.powermock
- powermock-module-junit4
- ${powermock.version}
- test
-
-
- org.powermock
- powermock-api-mockito2
- ${powermock.version}
- test
-
-
- net.bytebuddy
- byte-buddy-agent
- ${bytebuddy.version}
-
-
- org.objenesis
- objenesis
- ${objenesis.version}
-
-
- com.github.tomakehurst
- wiremock
- ${wiremock.version}
- test
-
-
- org.openjdk.jmh
- jmh-generator-annprocess
- ${jmh.version}
- test
-
-
- cn.hippo4j
- dubbo-plugin
- ${project.version}
-
-
-
-
-
- ${project.artifactId}-${project.version}
-
-
-
-
-
- io.takari
- maven
- ${takari-maven-plugin.version}
-
-
- maven-antrun-plugin
- ${maven-antrun-plugin.version}
-
-
- maven-deploy-plugin
- ${maven-deploy-plugin.version}
-
-
- maven-assembly-plugin
- ${maven-assembly-plugin.version}
-
-
- maven-failsafe-plugin
- ${maven-failsafe-plugin.version}
-
-
- maven-jar-plugin
- ${maven-jar-plugin.version}
-
- true
-
-
-
- maven-shade-plugin
- ${maven-shade-plugin.version}
-
-
-
-
-
- kr.motd.maven
- os-maven-plugin
- ${os-maven-plugin.version}
-
-
- initialize
-
- detect
-
-
-
-
-
- maven-enforcer-plugin
- ${maven-enforcer-plugin.version}
-
-
- enforce-java
-
- enforce
-
- validate
-
-
-
-
- 1.8
-
-
-
-
-
-
-
- maven-compiler-plugin
- ${maven-compiler-plugin.version}
-
- ${compiler.version}
- ${compiler.version}
- ${project.build.sourceEncoding}
-
-
-
- maven-resources-plugin
- ${maven-resource-plugin.version}
-
- ${project.build.sourceEncoding}
-
-
-
- maven-source-plugin
- ${maven-source-plugin.version}
-
-
- attach-sources
- none
-
- jar
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/checkstyle/hippo4j_checkstyle.xml b/checkstyle/hippo4j_checkstyle.xml
deleted file mode 100644
index c45a921f..00000000
--- a/checkstyle/hippo4j_checkstyle.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/checkstyle/hippo4j_checkstyle_suppression.xml b/checkstyle/hippo4j_checkstyle_suppression.xml
deleted file mode 100644
index 59487b95..00000000
--- a/checkstyle/hippo4j_checkstyle_suppression.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/dependencies/pom.xml b/dependencies/pom.xml
deleted file mode 100644
index af91cef3..00000000
--- a/dependencies/pom.xml
+++ /dev/null
@@ -1,221 +0,0 @@
-
-
- 4.0.0
- cn.hippo4j
- hippo4j-dependencies
- ${revision}
- pom
- Hippo4j Dependencies
-
-
- 2.0.0-SNAPSHOT
- 6.5.0
- 2.9.3
- 6.1.5.Final
- 0.9.0
- 2.11.1
- 2.1.214
- 3.12.4
- 3.0.5
- 2.6.12
- 1.7.7
- 1.8.4
- 2.0.4
- 3.4.2
- 2.3.2.RELEASE
- 1.9.1
- 2.2.4.RELEASE
- 0.7.3
- 1.7.2
- 2.2.2
- 4.1.56.Final
- 6.8.17
- 9.0.55
- 5.1.0
- 2.2.6.RELEASE
- 3.1.0
- 2.2.9.RELEASE
- 2.2.5.RELEASE
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-dependencies
- ${spring-boot.version}
- pom
- import
-
-
- com.baomidou
- mybatis-plus-boot-starter
- ${mybatis-plus.version}
-
-
- com.github.dozermapper
- dozer-core
- ${dozer.version}
-
-
- org.slf4j
- slf4j-api
- ${slf4j-api.version}
-
-
- org.apache.dubbo
- dubbo
- ${dubbo.version}
- true
-
-
- com.alibaba.nacos
- nacos-client
- ${nacos-client.version}
-
-
- com.alibaba
- dubbo
- ${alibaba-dubbo.version}
-
-
- io.micrometer
- micrometer-core
- ${micrometer-core.version}
-
-
- com.ctrip.framework.apollo
- apollo-client
- ${apollo.version}
-
-
- com.github.ben-manes.caffeine
- caffeine
- ${caffeine.version}
-
-
- org.hibernate.validator
- hibernate-validator
- ${hibernate-validator.version}
-
-
- io.jsonwebtoken
- jjwt
- ${jjwt.version}
-
-
- com.h2database
- h2
- ${h2.version}
- runtime
-
-
- org.springframework.cloud
- spring-cloud-starter-consul-config
- ${consul.version}
-
-
- io.etcd
- jetcd-core
- ${jetcd.version}
-
-
- com.tencent.polaris
- polaris-configuration-factory
- ${polaris.version}
-
-
- com.tencent.polaris
- router-rule
-
-
- com.tencent.polaris
- router-nearby
-
-
- com.tencent.polaris
- router-metadata
-
-
- com.tencent.polaris
- router-canary
-
-
- com.tencent.polaris
- router-set
-
-
- com.tencent.polaris
- router-isolated
-
-
- com.tencent.polaris
- router-healthy
-
-
- io.grpc
- grpc-all
-
-
-
-
- org.apache.rocketmq
- rocketmq-spring-boot-starter
- ${rocketmq.version}
-
-
- io.netty
- netty-all
- ${netty.version}
-
-
- org.elasticsearch
- elasticsearch
- ${elasticsearch.version}
-
-
- org.elasticsearch.client
- transport
- ${elasticsearch.version}
-
-
- org.elasticsearch.client
- elasticsearch-rest-high-level-client
- ${elasticsearch.version}
-
-
- org.apache.tomcat.embed
- tomcat-embed-core
- ${tomcat-embed-core.version}
-
-
- org.apache.curator
- curator-framework
- ${curator-framework.version}
-
-
- com.alibaba.cloud
- spring-cloud-starter-stream-rocketmq
- ${spring-cloud-starter-stream-rocketmq.version}
-
-
- org.springframework.cloud
- spring-cloud-starter-stream-rabbit
- ${spring-cloud-starter-stream-rabbitmq.version}
-
-
- org.springframework.cloud
- spring-cloud-starter-netflix-hystrix
- ${spring-cloud-starter-netflix-hystrix.version}
-
-
- com.alibaba.cloud
- spring-cloud-starter-alibaba-nacos-config
- ${spring-cloud-starter-alibaba-nacos-config.version}
-
-
-
-
\ No newline at end of file
diff --git a/docker/Dockerfile b/docker/Dockerfile
deleted file mode 100644
index bb14f76c..00000000
--- a/docker/Dockerfile
+++ /dev/null
@@ -1,41 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-FROM openjdk:8-jre-slim
-MAINTAINER lijianxin
-
-ENV DATASOURCE_MODE="h2" \
- DATASOURCE_HOST="127.0.0.1" \
- DATASOURCE_PORT="3306" \
- DATASOURCE_DB="hippo4j_manager" \
- DATASOURCE_USERNAME="root" \
- DATASOURCE_PASSWORD="root" \
- BASE_DIR="/opt/hippo4j"
-
-ENV TZ=PRC
-RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-
-ADD conf/hippo4j-logback.xml ${BASE_DIR}/conf/hippo4j-logback.xml
-ADD conf/application.properties ${BASE_DIR}/conf/application.properties
-ADD conf/application-h2.properties ${BASE_DIR}/conf/application-h2.properties
-ADD target/hippo4j-server.jar ${BASE_DIR}/hippo4j-server.jar
-ADD docker-startup.sh ${BASE_DIR}/docker-startup.sh
-
-WORKDIR ${BASE_DIR}
-RUN chmod +x docker-startup.sh
-
-ENTRYPOINT ["./docker-startup.sh"]
-
\ No newline at end of file
diff --git a/docker/docker-startup.sh b/docker/docker-startup.sh
deleted file mode 100644
index ccbda789..00000000
--- a/docker/docker-startup.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/bash
-
-export JAVA_HOME
-export JAVA="$JAVA_HOME/bin/java"
-
-export SERVER="hippo4j-server"
-
-JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext"
-JAVA_OPT="${JAVA_OPT} -Xloggc:${BASE_DIR}/logs/hippo4j_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M"
-
-JAVA_OPT="${JAVA_OPT} -Xms1024m -Xmx1024m -Xmn512m"
-JAVA_OPT="${JAVA_OPT} -Dhippo4j.standalone=true"
-JAVA_OPT="${JAVA_OPT} -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${BASE_DIR}/logs/java_heapdump.hprof"
-JAVA_OPT="${JAVA_OPT} -Dhippo4j.home=${BASE_DIR}"
-
-JAVA_OPT="${JAVA_OPT} ${JAVA_OPT_EXT}"
-JAVA_OPT="${JAVA_OPT} --logging.config=${BASE_DIR}/conf/hippo4j-logback.xml"
-JAVA_OPT="${JAVA_OPT} --server.max-http-header-size=524288"
-JAVA_OPT="${JAVA_OPT} --server.tomcat.basedir=${BASE_DIR}/bin"
-
-if [[ "${DATASOURCE_MODE}" == "mysql" ]]; then
- JAVA_OPT="${JAVA_OPT} --spring.profiles.active=mysql --hippo4j.database.init_enable=false "
- JAVA_OPT="${JAVA_OPT} --spring.datasource.url=jdbc:mysql://${DATASOURCE_HOST}:${DATASOURCE_PORT}/${DATASOURCE_DB}?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 "
- JAVA_OPT="${JAVA_OPT} --spring.datasource.username=${DATASOURCE_USERNAME} --spring.datasource.password=${DATASOURCE_PASSWORD} "
-elif [[ "${DATASOURCE_MODE}" == "h2" ]]; then
- JAVA_OPT="${JAVA_OPT} --spring.profiles.active=h2 --spring.datasource.url=jdbc:h2:file:${BASE_DIR}/h2_hippo4j;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL"
-else
- echo "hippo4j DATASOURCE_MODE is error, value ${DATASOURCE_MODE}, use default h2"
-fi
-
-if [ ! -d "${BASE_DIR}/logs" ]; then
- mkdir ${BASE_DIR}/logs
-fi
-
-echo "$JAVA ${JAVA_OPT}"
-
-echo "hippo4j is starting with standalone"
-
-if [ ! -f "${BASE_DIR}/logs/start.out" ]; then
- touch "${BASE_DIR}/logs/start.out"
-fi
-
-echo "$JAVA ${JAVA_OPT}" > ${BASE_DIR}/logs/start.out 2>&1 &
-java -jar hippo4j-server.jar ${JAVA_OPT}
-echo "hippo4j is starting,you can check the ${BASE_DIR}/logs/"
diff --git a/docs/README.md b/docs/README.md
deleted file mode 100644
index 03c9d56e..00000000
--- a/docs/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-
-## 启动
-
-> 依赖 node 版本 16+
-
-```shell script
-npm i
-npm run start
-```
-
-## 部署
-
-```shell script
-GIT_SSH_COMMAND="ssh -i ~/.ssh/hippo4j" USE_SSH=true docusaurus deploy
-```
diff --git a/docs/babel.config.js b/docs/babel.config.js
deleted file mode 100644
index e00595da..00000000
--- a/docs/babel.config.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = {
- presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
-};
diff --git a/docs/blog/2022-06-06-hippo4j/index.md b/docs/blog/2022-06-06-hippo4j/index.md
deleted file mode 100644
index e5aaba49..00000000
--- a/docs/blog/2022-06-06-hippo4j/index.md
+++ /dev/null
@@ -1,145 +0,0 @@
----
-slug: Hippo-4J发布1.3.0版本
-title: Hippo-4J发布1.3.0版本
-authors: [xiaomage]
-tags: [hippo4j, release, 1.3.0]
----
-
-大家好,我是 **小马哥**。
-
-Hippo4j 距离上一个版本 1.2.1 已经过去一个月的时间。在此期间,由 **8 位贡献者** 提交了 **170+ commits**,正式发布 **1.3.0** 版本。
-
-注:这是一个 **兼容历史版本** 的重大升级。
-
-## HIPPO-4J 1.3.0
-
-### Feature
-
-1. 添加 RabbitMQ 线程池监控及动态变更
-2. 添加 RocketMQ 线程池监控及动态变更
-3. 添加 Dubbo 线程池监控及动态变更
-4. 添加 SpringCloud Stream RocketMQ 消费线程池监控及动态变更
-
-### Refactor
-
-1. 重构容器线程池查询及修改功能
-2. 优化配置中心触发监听后,所执行的数据变更逻辑
-
-### Optimize
-
-1. 前端控制台删除无用组件
-2. 服务端页面字段未显示中文
-3. 控制台 UI 优化
-4. 修改线程池实例后实时刷新列表参数
-5. 容器线程池编辑仅限 Admin 权限
-6. SpringBoot Starter 变更包路径
-
-### BUG
-
-1. 修复 SpringBoot Nacos 动态刷新不生效
-2. 报警配置 alarm=false 不配置通知报警平台和接收人报错
-
-## 三方框架线程池适配
-
-Hippo4j 1.3.0 最大的功能发布就是开发出了 **适配三方框架的基础框架**。
-
-目前已完成 **Dubbo、RabbitMQ、RocketMQ、RocketMQSpringCloudStream** 的线程池适配,后续还会接入 **Kafka、Hystrix** 等框架或中间件的线程池适配。
-
-### 引入适配三方框架 Jar 包
-
-引入 Hippo4j server 或 core 的 maven jar 坐标后,还需要引入对应的框架适配 jar:
-
-```xml
-
- cn.hippo4j
-
- hippo4j-spring-boot-starter-adapter-dubbo
-
- hippo4j-spring-boot-starter-adapter-rabbitmq
-
- hippo4j-spring-boot-starter-adapter-rocketmq
-
- hippo4j-spring-boot-starter-adapter-spring-cloud-stream-rocketmq
- 1.3.0
-
-```
-
-如果想觉得引入多个 jar 包繁琐,可以仅需引入一个全量包,Hippo4j 框架底层会根据各中间件的条件,判断加载具体线程池适配器。
-
-```xml
-
- cn.hippo4j
- hippo4j-spring-boot-starter-adapter-all
- 1.3.0
-
-```
-
-### HIPPO-4J Server
-
-Hippo4j server 引入上述适配 jar 包后,即可在 Hippo4j server 的控制台进行查看及修改三方框架线程池。
-
-
-
-
-
-点击编辑即可修改该 Java 应用对应的框架底层线程池。
-
-
-
-
-
-点击 **全部修改** 按钮可以修改当前组下所有应用实例的线程池配置。
-
-修改成功后,应用控制台打印以下日志,即为修改成功。
-
-```java
-[input] RocketMQ consumption thread pool parameter change. coreSize :: 1 => 10, maximumSize :: 1 => 10
-```
-
-### HIPPO-4J Core
-
-Hippo4j core 除了依赖上述适配 Jar 包外,还需要在配置中心添加以下配置项。
-
-```yaml
-spring:
- dynamic:
- thread-pool:
- # 省略其它配置
- adapter-executors:
- # threadPoolKey 代表线程池标识
- - threadPoolKey: 'input'
- # mark 为三方线程池框架类型,参见文初已支持框架集合
- mark: 'RocketMQSpringCloudStream'
- corePoolSize: 10
- maximumPoolSize: 10
-```
-
-## Gitee GVP
-
-Hippo4j 获得了一些宝贵的荣誉,这属于每一位对 Hippo4j 做出过贡献的成员。
-
-
-
-
-
-感谢所有为 Hippo4j 做出贡献的开发者!
-
-https://github.com/opengoofy/hippo4j/graphs/contributors
-
-
-
-
-
-## 最后总结
-
-开源不易,如果各位小伙伴看了 Hippo4j 框架后有所收获,希望能帮忙在 Github、Gitee 点个 star,谢谢。
-
-**Github**:https://github.com/opengoofy/hippo4j
-
-**Gitee**:https://gitee.com/mabaiwancn/hippo4j
-
-目前已有 **10+** 公司在生产环境使用 Hippo4j,如果贵公司使用了 Hippo4j,请在下方 Issue 登记,谢谢。
-
-**Issue**:https://github.com/opengoofy/hippo4j/issues/13
-
-登记使用不会对公司有任何影响,仅为了扩大 Hippo4j 影响力,帮助它能走得更远。
diff --git a/docs/blog/authors.yml b/docs/blog/authors.yml
deleted file mode 100644
index ffffe8d4..00000000
--- a/docs/blog/authors.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-xiaomage:
- name: 小马哥
- title: hippo4j 作者
- url: https://github.com/magegoofy
- image_url: https://avatars.githubusercontent.com/u/77398366?v=4
diff --git a/docs/community/_category_.json b/docs/community/_category_.json
deleted file mode 100644
index bcd256c9..00000000
--- a/docs/community/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "社区",
- "position": 1,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/docs/community/contributor.md b/docs/community/contributor.md
deleted file mode 100644
index f40d60b1..00000000
--- a/docs/community/contributor.md
+++ /dev/null
@@ -1,16 +0,0 @@
----
-id: contributor-guide
-sidebar_position: 1
-title: 贡献指南
----
-
-Git Commit Log 尽量使用英文。
-
-Pull Request 尽量保持单一,不同语义的代码贡献应拆分多个 Pull Request。
-
-为了让您的 GitHub ID 显示在 Contributor 列表中,别忘了以下设置:
-
-```shell
-git config --global user.name "username"
-git config --global user.email "GitHub 账号邮箱"
-```
diff --git a/docs/community/dev_convention/_category_.json b/docs/community/dev_convention/_category_.json
deleted file mode 100644
index cb875453..00000000
--- a/docs/community/dev_convention/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "贡献规约",
- "position": 2,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/docs/community/dev_convention/code.md b/docs/community/dev_convention/code.md
deleted file mode 100644
index ce3d6018..00000000
--- a/docs/community/dev_convention/code.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-sidebar_position: 2
-title: 代码规约
----
-
-1. 代码提交前,执行 `mvn spotless:apply` 保证代码格式符合规范。
-2. 代码中不要出现无意义的空行。
diff --git a/docs/community/dev_convention/document.md b/docs/community/dev_convention/document.md
deleted file mode 100644
index 7f0d65a2..00000000
--- a/docs/community/dev_convention/document.md
+++ /dev/null
@@ -1,226 +0,0 @@
----
-sidebar_position: 1
-title: 文档规约
----
-
-文档引用自:[中文文案排版指北](https://github.com/sparanoid/chinese-copywriting-guidelines)
-
-## 空格
-
-> 「有研究顯示,打字的時候不喜歡在中文和英文之間加空格的人,感情路都走得很辛苦,有七成的比例會在 34 歲的時候跟自己不愛的人結婚,而其餘三成的人最後只能把遺產留給自己的貓。畢竟愛情跟書寫都需要適時地留白。
->
-> 與大家共勉之。」——[vinta/paranoid-auto-spacing](https://github.com/vinta/pangu.js)
-
-### 中英文之間需要增加空格
-
-正確:
-
-> 在 LeanCloud 上,數據儲存是圍繞 `AVObject` 進行的。
-
-錯誤:
-
-> 在LeanCloud上,數據儲存是圍繞`AVObject`進行的。
-
-> 在 LeanCloud上,數據儲存是圍繞`AVObject` 進行的。
-
-完整的正確用法:
-
-> 在 LeanCloud 上,數據儲存是圍繞 `AVObject` 進行的。每個 `AVObject` 都包含了與 JSON 兼容的 key-value 對應的數據。數據是 schema-free 的,你不需要在每個 `AVObject` 上提前指定存在哪些键,只要直接設定對應的 key-value 即可。
-
-例外:「豆瓣FM」等產品名詞,按照官方所定義的格式書寫。
-
-### 中文與數字之間需要增加空格
-
-正確:
-
-> 今天出去買菜花了 5000 元。
-
-錯誤:
-
-> 今天出去買菜花了 5000元。
-
-> 今天出去買菜花了5000元。
-
-### 數字與單位之間需要增加空格
-
-正確:
-
-> 我家的光纖入屋寬頻有 10 Gbps,SSD 一共有 20 TB。
-
-錯誤:
-
-> 我家的光纖入屋寬頻有 10Gbps,SSD 一共有 20TB。
-
-例外:度數/百分比與數字之間不需要增加空格:
-
-正確:
-
-> 角度為 90° 的角,就是直角。
-
-> 新 MacBook Pro 有 15% 的 CPU 性能提升。
-
-錯誤:
-
-> 角度為 90 ° 的角,就是直角。
-
-> 新 MacBook Pro 有 15 % 的 CPU 性能提升。
-
-### 全形標點與其他字符之間不加空格
-
-正確:
-
-> 剛剛買了一部 iPhone,好開心!
-
-錯誤:
-
-> 剛剛買了一部 iPhone ,好開心!
-
-> 剛剛買了一部 iPhone, 好開心!
-
-### `text-spacing` to the rescue?
-
-CSS Text Module Level 4 的 [`text-spacing`](https://www.w3.org/TR/css-text-4/#text-spacing-property) 和 Microsoft 的 [`-ms-text-autospace`](https://msdn.microsoft.com/library/ms531164(v=vs.85).aspx) 可以實現自動為中英文之間增加空白。不過目前並未普及,另外在其他應用場景,例如 macOS、iOS、Windows 等用戶介面目前並不存在這個特性,所以請繼續保持隨手加空格的習慣。
-
-## 標點符號
-
-### 不重複使用標點符號
-
-即使中國大陸的標點符號用法允許重複使用標點符號,但是這麼做會破壞句子的美觀性。
-
-正確:
-
-> 德國隊竟然戰勝了巴西隊!
-
-> 她竟然對你說「喵」?!
-
-錯誤:
-
-> 德國隊竟然戰勝了巴西隊!!
-
-> 德國隊竟然戰勝了巴西隊!!!!!!!!
-
-> 她竟然對你說「喵」??!!
-
-> 她竟然對你說「喵」?!?!??!!
-
-## 全形和半形
-
-不明白什麼是全形(全角)與半形(半角)符號?請查看維基百科條目『[全形和半形](https://zh.wikipedia.org/wiki/%E5%85%A8%E5%BD%A2%E5%92%8C%E5%8D%8A%E5%BD%A2)』。
-
-### 使用全形中文標點
-
-正確:
-
-> 嗨!你知道嘛?今天前台的小妹跟我說「喵」了哎!
-
-> 核磁共振成像(NMRI)是什麼原理都不知道?JFGI!
-
-錯誤:
-
-> 嗨! 你知道嘛? 今天前台的小妹跟我說 "喵" 了哎!
-
-> 嗨!你知道嘛?今天前台的小妹跟我說"喵"了哎!
-
-> 核磁共振成像 (NMRI) 是什麼原理都不知道? JFGI!
-
-> 核磁共振成像(NMRI)是什麼原理都不知道?JFGI!
-
-### 數字使用半形字符
-
-正確:
-
-> 這件蛋糕只賣 1000 元。
-
-錯誤:
-
-> 這件蛋糕只賣 1000 元。
-
-例外:在設計稿、宣傳海報中如出現極少量數字的情形時,為方便文字對齊,是可以使用全形數字的。
-
-### 遇到完整的英文整句、特殊名詞,其內容使用半形標點
-
-正確:
-
-> 賈伯斯那句話是怎麼說的?「Stay hungry, stay foolish.」
-
-> 推薦你閱讀《Hackers & Painters: Big Ideas from the Computer Age》,非常的有趣。
-
-錯誤:
-
-> 賈伯斯那句話是怎麼說的?「Stay hungry,stay foolish。」
-
-> 推薦你閱讀《Hackers&Painters:Big Ideas from the Computer Age》,非常的有趣。
-
-## 名詞
-
-### 專有名詞使用正確的大小寫
-
-大小寫相關用法原屬於英文書寫範疇,不屬於本 wiki 討論內容,在這裡只對部分易錯用法進行簡述。
-
-正確:
-
-> 使用 GitHub 登錄
-
-> 我們的客戶有 GitHub、Foursquare、Microsoft Corporation、Google、Facebook, Inc.。
-
-錯誤:
-
-> 使用 github 登錄
-
-> 使用 GITHUB 登錄
-
-> 使用 Github 登錄
-
-> 使用 gitHub 登錄
-
-> 使用 gイんĤЦ8 登錄
-
-> 我們的客戶有 github、foursquare、microsoft corporation、google、facebook, inc.。
-
-> 我們的客戶有 GITHUB、FOURSQUARE、MICROSOFT CORPORATION、GOOGLE、FACEBOOK, INC.。
-
-> 我們的客戶有 Github、FourSquare、MicroSoft Corporation、Google、FaceBook, Inc.。
-
-> 我們的客戶有 gitHub、fourSquare、microSoft Corporation、google、faceBook, Inc.。
-
-> 我們的客戶有 gイんĤЦ8、キouЯƧquムгє、๓เςг๏ร๏Ŧt ς๏гק๏гคtเ๏ภn、900913、ƒ4ᄃëв๏๏к, IПᄃ.。
-
-注意:當網頁中需要配合整體視覺風格而出現全部大寫/小寫的情形,HTML 中請使用標準的大小寫規範進行書寫;並通過 `text-transform: uppercase;`/`text-transform: lowercase;` 對表現形式進行定義。
-
-### 不要使用不道地的縮寫
-
-正確:
-
-> 我們需要一位熟悉 TypeScript、HTML5,至少理解一種框架(如 React、Next.js)的前端開發者。
-
-錯誤:
-
-> 我們需要一位熟悉 Ts、h5,至少理解一種框架(如 RJS、nextjs)的 FED。
-
-## 爭議
-
-以下用法略帶有個人色彩,即:無論是否遵循下述規則,從語法的角度來講都是**正確**的。
-
-### 超連結之間增加空格
-
-用法:
-
-> 請 [提交一個 issue](#) 並分配给相關同事。
-
-> 訪問我們網站的最新動態,請 [點擊這裡](#) 進行訂閱!
-
-對比用法:
-
-> 請[提交一個 issue](#) 並分配给相關同事。
-
-> 訪問我們網站的最新動態,請[點擊這裡](#)進行訂閱!
-
-### 簡體中文使用直角引號
-
-用法:
-
-> 「老师,『有条不紊』的『紊』是什么意思?」
-
-對比用法:
-
-> “老师,‘有条不紊’的‘紊’是什么意思?”
diff --git a/docs/community/faq.md b/docs/community/faq.md
deleted file mode 100644
index 0f0fb830..00000000
--- a/docs/community/faq.md
+++ /dev/null
@@ -1,90 +0,0 @@
----
-sidebar_position: 5
-title: 常见问题
----
-
-# 常见问题
-
-- 租户和项目在 Hippo4j 中是什么意思
-- 控制台线程池管理和线程池实例的区别
-- 示例项目为什么会有跨域请求
-- 更新代码后运行时服务端SQL报错
-- 生产环境如何不启用动态线程池
-- Server 端宕机会影响 Client 运行么
-- Hippo4j 的发布方式是怎样的?如何选择正确的版本
-- 群机器人接受不到通知报警
-- 设置线程池参数优先级问题
-- 线程池实例中修改队列容量参数问题
-- 控制台 SocketTimeoutException: connect timed out
-
-## 租户和项目在 Hippo4j 中是什么意思
-
-Hippo4j 按照租户、项目、线程池的维度划分。
-
-举个例子,小编在一家公司的公共组件团队,团队中负责消息、短链接网关等项目。公共组件是租户,消息或短链接就是项目。
-
-## 控制台线程池管理和线程池实例的区别
-
-在线程池管理中修改线程池参数,客户端并不能实时感知到并变更参数,需要重启客户端。而线程池实例中去对具体的实例修改参数时,客户端无需重启,可以实时感知到参数变化。如果二者针对同一线程池的参数配置不同,则在重启客户端时,客户端会去拉去线程池管理中的参数配置。
-
-二者对应的定位:线程池管理中的配置是常态化配置。而线程池实例里的配置变更像是一种临时修改,比如突发的流量激增等场景,并不具备普适性。
-
-## 示例项目为什么会有跨域请求
-
-~~正常大家在部署时,服务端项目和客户端都在同一网络下,进行内网通信,是没有问题的。~~
-
-~~因为示例项目中,服务端部署在外网,而客户端注册到服务端 IP 是内网的,所以不通。~~
-
-~~涉及功能:线程池实例-查看、编辑,容器线程池。~~
-
-1.2.0 版本后,服务端访问客户端已变成,浏览器访问服务端,服务端转发客户端的形式完成调用,跨域问题已解决。
-
-## 更新代码后运行时服务端SQL报错
-
-如果更新代码运行功能出错,大概率是因为项目新增或修改了表结构。如版本升级迭代涉及数据库表变更,会额外提供 SQL 变更文件。
-
-如若第一次使用,初始化 SQL 脚本地址:[Hippo4j_manager.sql](https://github.com/longtai-cn/hippo4j/blob/develop/hippo4j-server/conf/hippo4j_manager.sql)。
-
-> 友情提示:每次执行数据库表或数据变更时,一定要保持提前备份的好习惯。
-
-## 生产环境如何不启用动态线程池
-
-测试环境已经引入 Hippo4j,暂时不打算上线生产环境。
-
-生产环境指定配置 `spring.dynamic.thread-pool.enable=false`,测试环境和生产环境配置就会隔离。
-
-## Server 端宕机会影响 Client 运行么
-
-不会。Client 端包含对 Server 端的健康检查机制,Server 端不可用时会停止交互,检查到可用时重新建立连接交互。
-
-## Hippo4j 的发布方式是怎样的?如何选择正确的版本
-
-Hippo4j 发布时可能会涉及到两端发布,分别是 Server 和 Starter。如无特殊说明,**每一次的版本升级将兼容上一版本代码**。
-
-- 如涉及 Server 发布,会在 [发布列表页面](https://github.com/longtai-cn/hippo4j/releases) 创建最新的发行版本;
-- 如涉及 Starter 发布,将直接推送 Starter Jar 至中央仓库,Server 包版本不变。
-
-## 群机器人接受不到通知报警
-
-如果是钉钉机器人,需在机器人配置自定义关键字,才可发送成功。如下所示:
-
-
-
-如果使用 hippo4j-server,请检查在 hippo4j-server 添加的报警通知记录,是否在客户端项目启动前,因为客户端只有在启动时会去 hippo4j-server 拉取报警通知记录。
-
-重启客户端项目,会重新拉取最新报警推送配置,问题解决。
-
-## 设置线程池参数优先级问题
-
-- 当使用 `@DynamicThreadPool` 进行修饰的方法中和在管理界面设置中同时存在的话,则管理界面设置的优先级最高;
-- 如果连接 server 端失败的话,使用 `@DynamicThreadPool` 进行修饰设置的优先级最高。
-
-## 线程池实例中修改队列容量参数问题
-
-在线程池管理中添加时,只有当选择队列类型为 `ResizableCapacityLinkedBlockingQueue` 时,后续再进行修改容量大小时才会实时的刷新修改成功。
-
-## 控制台 SocketTimeoutException: connect timed out
-
-控制台中触发的某些操作涉及到 hippo4j-server 调用客户端项目。如果 hippo4j-server 部署在测试环境,而客户端项目为本地启动,则会触发该问题。
-
-为什么编辑线程池参数不报错?因为线程池的动态变更是客户端主动发起连接,和服务端保持了一个长轮询,所以不存在服务端主动调用客户端行为。
diff --git a/docs/community/sponsor.md b/docs/community/sponsor.md
deleted file mode 100644
index 903e3bb8..00000000
--- a/docs/community/sponsor.md
+++ /dev/null
@@ -1,22 +0,0 @@
----
-sidebar_position: 6
-title: 支持开源
----
-
-如果您正在使用这个项目并感觉良好,或者是想支持我继续开发,通过以下二维码一次性捐款。
-
-在这里承诺将,将收到的所有赞助支持资金完全公开化,且后续资金用途仅 Hippo4j 项目的运转。
-
-
-
-感谢给予支持的朋友,您的支持是 Hippo4j 社区前进的动力 🎉
-
-| | ID | 赞赏金额 | 时间 | 备注 |
-|-----|--|-------|------------|--------------------|
-| 1 | 六月飞雪 | 30.00 | 2021-12-30 | 代码设计很优雅的一款框架,继续加油! |
-| 2 | 孙大圣 | 26.6 | 2022-03-23 | 学习一下😁😁 |
-| 3 | Easy 点 | 66.00 | 2022-04-09 | 好货好技术当加赏 |
-| 4 | 捷克 | 30.00 | 2022-05-21 | 非常不错的框架,点赞 |
-| 5 | 吃猫的饼干 | 88.00 | 2022-08-21 | 👍 |
-| 6 | 不忘初心· | 66.00 | 2022-10-28 | Nice! |
-| 7 | 时刻· | 6.00 | 2022-10-30 | -! |
diff --git a/docs/community/team.md b/docs/community/team.md
deleted file mode 100644
index ae24340a..00000000
--- a/docs/community/team.md
+++ /dev/null
@@ -1,151 +0,0 @@
----
-sidebar_position: 3
-title: 团队成员
----
-
-## Hippo4j 团队
-
-非常感谢通过开源对 Hippo4j 贡献的开发者,项目始终保持高质量编码,以社区的力量去发展项目,并以项目反馈社区成员。我们期待对开源有兴趣的小伙伴加入团队,与社区共同成长。
-
-## 开发者角色
-
-Hippo4j 开发者包含 Maintainer、Committer、Contributor 三种角色,每种角色的标准定义如下。
-
-### 1. Maintainer
-
-Maintainer 是对 Hippo4j 项目的演进和发展做出显著贡献的个人。具体包含以下的标准:
-
-- 完成多个关键模块或者工程的设计与开发,是项目的核心开发人员;
-- 持续的投入和激情,能够积极参与社区、官网、Issue、PR 等项目相关事项的维护;
-- 在社区中具有有目共睹的影响力,能够代表 Hippo4j 参加重要的社区会议和活动;
-- 具有培养 Committer 和 Contributor 的意识和能力。
-
-### 2. Committer
-
-Committer 是具有 Hippo4j 仓库写权限的个人,包含以下的标准:
-
-- 能够在长时间内做持续贡献 Issue、PR 的个人;
-- 参与 Issue 列表的维护及重要 Feature 的讨论;
-- 参与 Code review。
-
-### 3. Contributor
-
-Contributor 是对 Hippo4j 项目有贡献的个人,标准为:
-
-- 提交过 PR(代码或者文档)并被合并。
-
-### 4. 开发者权利及义务
-
-
-
-## 开发团队
-
-本页面展示了 Hippo4j 的开发团队,并且还在持续扩充中。
-
-
-
-
- 姓名
- GitHub ID
- 角色
- 联系方式
-
-
-
- 马称
- magestacks
- Maintainer
- machen@apache.org
-
-
-
- 陆宽
- shining-stars-lk
- Committer
- 1031900093@qq.com
-
-
-
- 王杰
- iwangjie
- Committer
- wangchenmo1025@gmail.com
-
-
-
- 魏虎
- weihubeats
- Committer
- weihu@apache.org
-
-
-
- 李剑鑫
- BigXin0109
- Committer
- 1064730540@qq.com
-
-
-
- 刘文浩
- pizihao
- Committer
- hao3073liu@163.com
-
-
-
- 叶炜
- shanjianq
- Committer
- 17855368071@163.com
-
-
-
- 黄成兴
- Createsequence
- Committer
- 841396397@qq.com
-
-
-
- 吴浪
- wulangcode
- Committer
- sanliangitch@foxmail.com
-
-
- a>
- 黎金星
- road2master
- Committer
- lijinxingerm@gmail.com
-
-
- a>
- 严荣振
- yanrongzhen
- Committer
- bruceyan@didiglobal.com
-
-
-
-## 成为 Committer
-
-持续对 Hippo4j 进行贡献,粗略评估,至少完成 20+ PR 贡献可成为核心开发者。 其中包括完成 2
-个 [good pro issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+pro+issue%22)
-或以上,以及若干个 [good first issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)。
-
-:::note
-会根据 PR 质量提供个性化评估,有可能一个或两个质量较高 PR
-即可成为核心开发者。参考:[重构 DynamicThreadPoolExecutor 功能扩展逻辑](https://github.com/opengoofy/hippo4j/pull/854)
-:::
-
-成为 Committer 后,会为该 GitHub 账号获取 Jetbrains 全家桶 Licenses,有效期为 1 年。不用再为破解而烦恼,感受随时升级的快乐。
-
-:::note
-距离到期两周前,会再次申请 Jetbrains Licenses。有点类似于无限续约的感觉,在此感谢 Jetbrains 公司对开源的支持。
-:::
-
-截至 `2022-10-30` 当天,已为登记的 7 位 Committer 成功申请 Licenses。
-
-
diff --git a/docs/community/update-log.md b/docs/community/update-log.md
deleted file mode 100644
index aec894c8..00000000
--- a/docs/community/update-log.md
+++ /dev/null
@@ -1,411 +0,0 @@
----
-title: 更新日志
-sidebar_position: 5
----
-
-## 1.5.0 (Apr 15, 2023)
-
-这是一个大的功能增强版本,建议按照当前版本升级。具体信息可查看 Release 标签地址:[1.5.0](https://github.com/opengoofy/hippo4j/milestone/14?closed=1)
-
-**Use Change**
-
-- [Config] 配置属性中容器线程池配置命名改为 `spring.dynamic.thread-pool.web`。
-
-- [Server] 为了使语义更加明确,当前版本中线程池执行超时时间的最低可设置为-1,表示不设置超时。需要注意的是,如果客户端使用的是低于1.5.0的版本,可能会存在不兼容的情况。
-
-- [Common] 为了使语义更加明确,废弃 `ThreadPoolBuilder#maxPoolNum`,新增加 `ThreadPoolBuilder#maximumPoolSize`,原 API 还可以使用,将在后续版本删除。
-
-**Feature**
-
-- [#1124 ] Config 模式支持 Web 容器配置修改通知 @yanrongzhen
-- [#1148 ] 优化执行时间超时 executeTimeOut 为空或 <= 0 的场景 @sususama
-- [#1128 ] 控制台前端国际化开发 @Svamei @ PleasePerfunctory
-- [#1068 ] 默认线程池配置填充至线程池实例 @magestacks
-- [#1055 ] 适配第三方自定义线程池,支持外部SPI方式扩展线程池类型 @lingfengcoder
-- [#547 ] 支持 Consul 配置中心动态调整参数 @road2master
-- [#624 ] 添加 Dubbox 线程池监控及动态变更 @iwangjie
-- [#977 ] 增加 ROLE_MANAGE 角色,主要负责线程池变更审核 @magestacks
-- [#821 ] 开发用户修改密码功能 @wulangcode
-
-**Refactor**
-
-- [#1092 ] 关于扩展点 SPI 方案的重构 @yanrongzhen
-- [#1025 ] 优化BlockingQueueTypeEnum实现 @lianyiwuming
-- [#1015 ] 重构Web线程池配置文件命名 @yanrongzhen
-- [#1071 ] ThreadPoolBuilder提供全新的最大线程池API @jjiey
-- [#1058 ] 客户端引入多个 Web 容器依赖导致 WebThreadPoolService 报错 @Createsequence
-- [#844 ] 移除 alibaba-dingtalk-service-sdk @baymax55
-
-**Bug**
-
-- [#1085 ] DynamicThreadPoolRegisterParameter#threadFactory序列化异常 @magestacks
-- [#1163 ] Adapter 适配三方线程池启动顺序错误 @magestacks
-- [#1134 ] Web容器启动时刷新最新配置失败 @yanrongzhen
-- [#1129 ] Prometheus 不能正常采集 Hystrix 线程池 queue.capacity 数据 @jjiey
-- [#1121 ] 线程池实例包含已关闭客户端节点 @zjHe
-- [#1106 ] springBoot 1.5.x适配Web容器线程池调整 @yanrongzhen
-- [#1114 ] ZipkinExecutorAdapter 可能出现空指针异常 @yult97
-- [#1074 ] Hystrix Adapter 支持 hippo4j config @jjiey
-- [#1040 ]线程池参数默认配置与文档描述不符 @wulangcode
-- [#1002 ] SpringBoot Nacos 动态刷新错误使用 SpringCloud Nacos 类 @BigXin0109
-- [#990 ] TTL 装饰的线程池无法执行等待任务完成插件 @Createsequence
-- [#966 ] Alibaba Dubbo 无法获取线程池运行状态 @iwangjie
-
-**Optimize**
-
-- [#1159 ] 优化飞书和企业微信失败处理逻辑 @ITXiaoShiTou
-- [#1156 ] 线程池通知管理调整查询租户&项目&线程池默认10条 @tudou0806
-- [#1069 ] 线程池执行超时时间最小值支持 -1 @Ronan1024
-- [#1111 ] 核心阻塞队列枚举 BlockingQueueTypeEnum.createBlockingQueue(String blockingQueueName, Integer capacity)抛出NPE问题修复 @LiXuemin
-- [#1072 ] 提供公用方法安全设置 corePoolSize 和 maxPoolSize @jjiey
-- [#1051 ] 前端国际化登录页面中文错误 @xiaobaisdz
-- [#1001 ] 容器停止时,若线程池在等待关闭时,有任务触发超时告警会抛异常警类 @Createsequence
-- [#1024 ] 客户端与 Hippo4j revision 冲突 @baymax55
-- [#720 ] 修复 Dubbo 错误的日志打印 @baymax55
-- [#992 ] 优化 Hippo4j Banner 打印时可能存在的空指针 @wulangcode
-- [#976 ] 注册线程池默认指定过期时间和线程工厂 @magestacks
-- [#964 ] 长轮询时配置未变更返回304状态码适配低版本客户端 @wulangcode
-- [#942 ] 修改 MyBatis-Plus 数据库方言配置 @li-xiao-shuang
-- [#959 ] ThreadPoolPluginRegisterPostProcessor 打印过多 WARN 日志 @Createsequence
-- [#960 ] ThreadPoolPluginRegisterPostProcessor 实现 BeanPostProcessor 默认方法 postProcessBeforeInitialization @Createsequence
-
-
-## 1.4.3 (Nov 06, 2022)
-
-这是一个功能增强版本,修复了少量 BUG。建议按照当前版本升级。具体信息可查看 Release 标签地址:[1.4.3](https://github.com/opengoofy/hippo4j/milestone/13?closed=1)
-
-**Use Change**
-
-- 重构线程池监控,配置层级和命名改变
-- 如果使用钉钉报警,关键字【警报】修改为【告警】
-
-**Feature**
-
-- 重构 Spring 后置处理器创建动态线程池逻辑
-- 官网开启多版本化功能
-- 官网支持国际化,en-US
-- 适配线程池延迟初始化 @wulangcode
-- 添加 Codecov 相关代码覆盖率指标
-- 项目优雅关闭时停止运行状态采集
-
-**Refactor**
-
-- DynamicThreadPoolExecutor 重构,增加插件扩展逻辑 @Createsequence
-- 重构线程池监控,新增容器和三方框架线程池监控
-- 重构服务端包目录,聚合 hippo4j-server 相关 module
-
-**Bug**
-
-- dubbo 线程池无法获取运行信息 @iwangjie
-- 线程池检查活跃度报警取值错误 @maxisvest
-- 动态线程池修改多次后队列提示信息丢失
-- docker部署 mysql启动报错H2驱动
-- docker-startup.sh的mysql配置多个“-” @Malcolmli
-- 动态注册线程池队列容量赋值错误
-- 飞书超时类型告警不存在 Trace 信息时发送错误 @mageeric
-
-**Optimize**
-
-- 修改报警文案,【警报】修改为【告警】 @wulangcode
-- 自动选择H2数据库的存储路径 @iwangjie
-- 服务端在客户端后面启动,依旧支持长轮训 @wulangcode
-- 配置未发生变更时,长轮询返回 304 @wulangcode
-- discovery服务Lease类中判断过期时间需要多等一个duration @w-jirong
-- 优化 ThreadPoolBuilder#maxPoolNum 核心线程不得大于最大线程 @wulangcode
-- hippo4j console ui 迁移至本项目
-- 查询 Web 线程池列表添加框架标识
-- 优化 H2 初始化逻辑
-
-## 1.4.2 (Oct 18, 2022)
-
-这是一个功能增强版本,修复了少量 BUG。建议按照当前版本升级。具体信息可查看 Release 标签地址:[1.4.2](https://github.com/opengoofy/hippo4j/milestone/12?closed=1)
-
-**Feature**
-
-- 强制指定客户端注册的 ip + port
-- 支持 spring-cloud-tencent Polaris 线程池动态更新 @weihubeats
-- 服务启动时加载 MySQL、H2 数据库初始化语句
-- Adapter 初始化覆盖核心参数 @pizihao
-- Server 端新增是否开启认证模式 @baymax55
-
-**Refactor**
-
-- 替换底层网络工具类 OkHttp @yanrongzhen
-- 全局移除 commons-lang3 工具包依赖 @yanrongzhen
-- 去除三方工具类依赖 @pizihao
-- 全局移除 Guava 工具包依赖 @road2master
-- DockerFile 基于 H2 数据库重新构建 @BigXin0109
-
-**Bug**
-
-- Dubbo 2.7.15 无法获取线程池引用 @iwangjie
-- 动态线程池报警参数颠倒 @jinlingmei
-
-**Optimize**
-
-- 线程池实例运行数据采集,如果线程池id不存在,且长度超长,会报异常 @Gdk666
-- 项目中动态线程池数量为空时,存在 CPU 空转情况
-- 客户端注册服务端失败,输出服务端返回信息 @wulangcode
-- 调整数据库项目 id 和线程池 id 字段长度
-- 增加代码检查工具 maven-checkstyle-plugin
-- 调整控制台监控图表颜色展示
-
-## 1.4.1 (Sep 12, 2022)
-
-这是一个功能增强版本,修复了若干 BUG。建议按照当前版本升级。具体信息可查看 Release 标签地址:[1.4.1](https://github.com/opengoofy/hippo4j/milestone/11?closed=1)
-
-**Feature**
-
-- 支持 H2 数据库 @weihubeats
-- 动态线程池配置变更时,支持单个、多个或全部节点变 @pizihao
-- 增加线程池活跃度和容量报警可选择关闭
-- @DynamicThreadPool 线程池不存在则创建 @shanjianq
-- 支持 ETCD 配置中心动态调整参数 @weihubeats
-- 创建动态线程池支持 spring 线程池 @BigXin0109
-- 线程池实例变更增加执行超时时间
-- 线程池相关查询页面增加阻塞队列属性
-- 定义动态线程池时,抽象默认配置
-- 提供 ExecutorContext 封装上下文细节 @road2master
-- Docker 制作服务端镜像,帮助开发者快速启动 @BigXin0109
-- RabbitMQ 适配器增加多个 MQ 数据源 @weihubeats
-
-**Bug**
-
-- 动态线程池设置关闭时启动报错 @dousp
-- ExecutorTtlWrapper 类型的 Executor 不生效 @BigXin0109
-- Undertow 获取 WebServer 类型参数异常 @shining-stars-lk
-- 修复线程池核心、最大线程数校验限制
-- ByteConvertUtil#getPrintSize 单位转换错误 @onesimplecoder
-- 创建线程池单选框选择错误
-- ReflectUtil#getFieldsDirectly missing fields @BigXin0109
-- 本地代码中设置的 capacity 无效 @BigXin0109
-- 服务端线程池超时时间存在拆箱空指针异常 @oreoft
-- 未读取服务端返回执行超时时间属性
-- ResizableCapacityLinkedBlockingQueue#put 当前元素数量大于 capacity 未阻塞
-
-**Optimize**
-
-- 长轮询任务判断逻辑优化 @shining-stars-lk
-- 线程池存在实例不允许删除线程池 @shanjianq
-- 优化租户、项目列表展示排版
-- 通知报警模块项目和线程池下拉查询排序修改
-- 动态线程池拒绝策略触发,以异步的方式报警
-- 优化框架中线程池工厂产生的线程名称 @road2master
-
-## 1.4.0 (Aug 16, 2022)
-
-`hippo4j server` 兼容历史低版本,`hippo4j config` 中部分属性名进行了调整,请参考 [hippo4j config 快速开始](https://hippo4j.cn/docs/user_docs/getting-started/hippo4j-core-start)。
-
-注意事项:
-1. 如果是对已运行 hippo4j server 升级,执行 `/conf/sql-upgrade` 目录下对应的升级脚本。
-2. 需客户端在 1.4.0 及以上版本才可在 hippo4j server 设置线程执行超时时间属性。
-
-**Feature**
-
-- 添加 Alibaba Dubbo 线程池监控及动态变更
-- hippo4j server 支持任务执行超时时间动态修改
-- 阿里 TTL 框架线程池适配
-- 添加动态线程池自动注册功能
-- 订阅回调线程池参数变更
-- 动态线程池监控增加 SPI 自定义功能
-- hippo4j server 支持多种线程池监控方式,例如 Prometheus
-- 通知相关参数添加动态变更功能
-
-**Bug**
-
-- 线程池变更:executeTimeOut 变更极端情况下会出现异常
-- 用户登录时候,如果输入了不存在的用户名,后台报空指针异常
-- 修复了对 spring-boot 服务中 tomcat 线程池的兼容问题
-- 排除 Tomcat Jar 使用 Undertow 启动报错
-
-**Optimize**
-
-- hippo4j-core-spring-boot-starter 模块修改名称为 hippo4j-config-spring-boot-starter
-- 拆分容器线程池子页面:Tomcat、Undertow、Jetty
-- 服务端访问客户端时对 URL 转码
-- MyBatisPlus 修改全局填充方法优化
-- 控制台线程池列表下拉框默认正序
-- 控制台线程池实例菜单,对于非可修改容量队列外,不允许修改队列容量
-- 动态线程池控制台功能变更
-- 租户和项目列表分页查询按照创建时间倒序展示
-- 线程池监控页面图表 UI 优化
-- 设置 maven-gpg-plugin 插件默认不执行
-- 前端控制台相关搜索条件添加必填提示
-- hippo4j 消息通知 & 报警抽象优化
-- 配置中心未配置线程池启动报错
-- 控制台线程池报警 UI 以及功能优化
-- Web、框架线程池编辑弹框 UI 优化
-- 线程池添加、编辑页面 UI 优化
-- 线程池运行详情页前端 UI 优化
-
-**Refactor**
-
-- 删除自定义日志组件
-- 线程池监控功能重构
-- hippo4j core 配置中心生效判断重构
-- 配置变更通知 & 报警通知重构
-- Web 容器线程池适配迁移 hippo4j-adapter
-
-## 1.3.1 (July 17, 2022)
-
-注:这是一个兼容历史版本的小范围升级。
-
-**Feature**
-
-- 控制台新增线程池功能设置为 Admin 权限
-- 添加 Hystrix 线程池监控及动态变更
-- 添加 Netty 上传动态线程池监控数据方式
-- 添加 GitHub Actions CI 流程
-- 添加 Spring Kafka 示例项目
-- Tomcat 版本号 >= 9.0.55 线程池适配
-
-**Refactor**
-
-- 更多线程池拆分子目录页面
-
-**Optimize**
-
-- hippo4j core 添加 banner 打印
-- 优化可变更容量阻塞队列名称
-
-**BUG**
-
-- Apollo 配置修改延迟了一个版本
-- Spring Boot 环境下使用 hippo4j-core 接入,配置中心使用 nacos;启动时提示 ConfigService not found
-
-查看 1.3.1 版本发布:https://github.com/mabaiwan/hippo4j/milestone/9
-
-## 1.3.0 (June 06, 2022)
-
-1.3.0 发布 **适配三方框架的基础框架**。
-
-目前已完成 **Dubbo、RabbitMQ、RocketMQ、RocketMQSpringCloudStream** 的线程池适配,后续还会接入 **Kafka、Hystrix** 等框架或中间件的线程池适配。
-
-注:这是一个兼容历史版本的重大升级。
-
-**Feature**
-
-- 添加 RabbitMQ 线程池监控及动态变更
-- 添加 RocketMQ 线程池监控及动态变更
-- 添加 Dubbo 线程池监控及动态变更
-- 添加 SpringCloud Stream RocketMQ 消费线程池监控及动态变更
-
-**Refactor**
-
-- 重构容器线程池查询及修改功能
-- 优化配置中心触发监听后,所执行的数据变更逻辑
-
-**Optimize**
-
-- 前端控制台删除无用组件
-- 服务端页面字段未显示中文
-- 控制台 UI 优化
-- 修改线程池实例后实时刷新列表参数
-- 容器线程池编辑仅限 Admin 权限
-- SpringBoot Starter 变更包路径
-
-**BUG**
-
-- 修复 SpringBoot Nacos 动态刷新不生效
-- 报警配置 alarm=false 不配置通知报警平台和接收人报错
-
-## 1.2.1 (May 07, 2022)
-
-**BugFix**
-
-- apollo 动态配置不生效
-- 修复 hippo4j-core 后置处理器创建线程池问题
-- 重构 hippo4j-core spring 后置处理器逻辑
-- 优化ThreadPoolNotifyAlarmHandler下的空指针异常
-- 修复线程池核心、最大线程数变更问题
-- startup.cmd 未正常读取 conf 配置文件
-
-**Optimize**
-
-- 配置文件中字段歧义
-- 修改代码中历史网址
-- InstanceInfo 的 groupKey 参数重复设置
-- ConfigFileTypeEnum 枚举字段添加注释
-- 线程资源通过线程池创建,不允许自行显示创建线程
-- Guava 版本升级至 30.0-jre 及以上版本
-- SystemClock 替换 System.currentTimeMillis()
-- 添加代码格式化插件 Spotless
-- 修改线程池文案
-
-## 1.2.0 (Mar 13, 2022)
-
-**Feature**
-
-- hippo4j-core线程池资源对接 Prometheus 监控
-- hippo4j-core 支持 Zookeeper
-- hippo4j-core 支持 Apollo
-
-**Optimize**
-
-- 适配非 Web SpringBoot 项目使用 Hippo4j
-- 优化报警通知
-- 修复在 JDK 小版本中的兼容性问题
-
-**BugFix**
-
-- server 端查看容器线程池,参数为 null
-- 重构线程池查看及容器线程池查看等交互
-- 修复引入 hippo4j-spring-boot-starter 后,运行单元测试报错
-- 修复可能出现的空指针异常
-
-## 1.1.0 (Mar 13, 2022)
-
-Hippo4j 线程池框架 1.1.0 RELEASE 版本,添加了 Hippo4j-Core(依赖配置中心的动态线程池).
-
-**Feature**
-
-- 删除 DynamicThreadPoolExecutor 内代码实现,仅通过线程池扩展点进行扩展
-- 通过动态代理实现线程池拒绝策略执行次数统计
-- 抽象通知报警消息模块
-- 抽象 hippo4j 核心组件,不依赖 server 端即可完成动态调参、监控、报警等功能
-- 前端删除线程池按钮添加 Admin 权限
-- 添加线程池任务运行超长报警
-- 容器线程池支持 Undertow
-- 容器线程池支持 Jetty
-- 重构服务端异常体系
-
-**Optimize**
-
-- 前端项目 Token 失效跳转登录页
-- 优化 Server 启动脚本日志输出
-- 优化前端按钮权限控制粒度
-- 优化线程池报警推送文案
-- 前端弹框样式优化
-- 适配低版本 SpringBoot Bind
-- 优化消息通知模块
-
-**BugFix**
-
-- Duplicate entry 'xxx' for key 'uk_configinfo_datagrouptenant'
-
-## 1.0.0 (Feb 01, 2022)
-
-**Feature**
-
-- 线程池运行堆栈查看
-- 扩展 Web 容器线程池动态调参、监控
-
-**Optimize**
-
-- 删除高版本 SpringBoot Api
-- ListableBeanFactory#findAnnotationOnBean SpringBoot 低版本适配
-- 优化客户端关闭时调用服务端钩子函数
-- 线程池实例参数弹框添加实例 ID 和线程池状态
-- 补充线程池替换 Hippo4j 文档
-- 1.5.x springboot 引入hippo4j-spring-boot-starter配置项,bean初始化失败
-- 优化线程池参数编辑合理性校验
-- BaseInstanceRegistry 读写锁重构
-
-**BugFix**
-
-- 本地项目线程池实例缓存无法精确清理
-- 线程池实例页面多实例不同 Active 展示错误
-- 创建动态线程池逻辑判断修复
-- 创建动态线程池增强参数未设置
-- 控制消息推送报警频率的方法有并发安全的问题
-- tomcat线程池上下文获取失败
diff --git a/docs/deploy.sh b/docs/deploy.sh
deleted file mode 100644
index 0379f9fb..00000000
--- a/docs/deploy.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env sh
-
-# 确保脚本抛出遇到的错误
-set -e
-
-# 生成静态文件
-npm run build
-
-# 进入生成的文件夹
-cd build/
-
-echo 'hippo4j.cn' > CNAME
-
-git init
-git add -A
-git commit -m "auto commit"
-
-# github
-GIT_SSH_COMMAND="ssh -i ~/.ssh/hippo4j" git remote add origin git@github.com:hippo4j/hippo4j.github.io.git
-GIT_SSH_COMMAND="ssh -i ~/.ssh/hippo4j" git push -u origin main -f
-
-cd -
-rm -rf build/
diff --git a/docs/docs/user_docs/dev_manual/_category_.json b/docs/docs/user_docs/dev_manual/_category_.json
deleted file mode 100644
index 9117307f..00000000
--- a/docs/docs/user_docs/dev_manual/_category_.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "label": "开发者手册",
- "position": 5,
- "link": {
- "type": "generated-index",
- "description": "Hippo4j 留给使用者能够扩展的知识点。"
- }
-}
diff --git a/docs/docs/user_docs/dev_manual/queue-custom.md b/docs/docs/user_docs/dev_manual/queue-custom.md
deleted file mode 100644
index 9fb5512a..00000000
--- a/docs/docs/user_docs/dev_manual/queue-custom.md
+++ /dev/null
@@ -1,89 +0,0 @@
----
-sidebar_position: 4
----
-
-# 阻塞队列自定义
-
-Hippo4j 通过 SPI 的方式对拒绝策略进行扩展,可以让用户在 Hippo4j 中完成自定义阻塞队列实现。
-
-## 1. 定义自定义队列类
-
-实现接口 `cn.hippo4j.common.executor.support.CustomBlockingQueue`:
-
-```java
-public class MyArrayBlockingQueue implements CustomBlockingQueue {
-
- @Override
- public Integer getType() {
- return 1001;
- }
-
- @Override
- public String getName() {
- return "MyArrayBlockingQueue";
- }
-
- @Override
- public BlockingQueue generateBlockingQueue(Integer capacity) {
- int effectiveCapacity = capacity == null || capacity <= 0 ? 1024 : capacity;
- return new ArrayBlockingQueue<>(effectiveCapacity);
- }
-}
-```
-
-> 兼容提示:旧版只需实现 `generateBlockingQueue()` 的实现仍然有效,框架会在未覆写新方法时回退到旧逻辑,但推荐改为覆写带 `capacity` 入参的方法,以便直接复用服务端配置。
-
-## 2. 声明 SPI 文件
-
-在 `src/main/resources/META-INF/services/` 目录下新增文件:
-```
-cn.hippo4j.common.executor.support.CustomBlockingQueue
-```
-
-文件内容仅一行:
-```
-com.example.queue.MyArrayBlockingQueue
-```
-
-## 3. 服务端生效方式
-
-当服务端下发的 `queueType` 与 `capacity` 命中自定义类型时,框架会通过 SPI 自动创建队列,并将服务端配置的容量参数传入 `generateBlockingQueue(Integer capacity)`。
-
-### 3.1 队列创建与验证
-
-```java
-// 创建队列
-BlockingQueue q = BlockingQueueTypeEnum.createBlockingQueue(queueType, capacity);
-
-// 或者通过队列名称创建
-BlockingQueue q2 = BlockingQueueTypeEnum.createBlockingQueue("ArrayBlockingQueue", capacity);
-
-// 验证队列配置
-boolean valid = BlockingQueueManager.validateQueueConfig(queueType, capacity);
-
-// 动态调整容量(仅 ResizableCapacityLinkedBlockingQueue 支持)
-boolean ok = BlockingQueueManager.changeQueueCapacity(executor.getQueue(), newCapacity);
-```
-
-### 3.2 队列类型生效
-
-- **配置模板**:在线程池管理页面编辑队列类型,会保存到数据库,但不会推送到运行中的客户端。
-- **生效时机**:客户端应用重启时,会从服务端读取最新配置,并使用反射替换线程池的 `workQueue` 字段。
-- **运行时调整**:运行时仅支持队列容量的动态调整(仅限 `ResizableCapacityLinkedBlockingQueue`),不支持队列类型切换。
-
-服务端动态刷新处的实现:
-
-```java
-// ServerThreadPoolDynamicRefresh#handleQueueChanges
-// 仅支持容量调整,不支持队列类型切换
-if (parameter.getCapacity() != null) {
- if (BlockingQueueManager.canChangeCapacity(executor.getQueue())) {
- boolean success = BlockingQueueManager.changeQueueCapacity(
- executor.getQueue(), parameter.getCapacity());
- if (success) {
- log.info("Queue capacity changed to: {} for thread pool: {}",
- parameter.getCapacity(), parameter.getTpId());
- }
- }
-}
-```
\ No newline at end of file
diff --git a/docs/docs/user_docs/dev_manual/queue-info.md b/docs/docs/user_docs/dev_manual/queue-info.md
deleted file mode 100644
index 956507d3..00000000
--- a/docs/docs/user_docs/dev_manual/queue-info.md
+++ /dev/null
@@ -1,47 +0,0 @@
----
-sidebar_position: 3
----
-
-# 内置阻塞队列
-
-Hippo4j 内置多种常用阻塞队列类型,支持开箱即用,亦可通过 SPI 扩展自定义队列类型。
-
-## 内置类型清单
-
-以下类型可直接在服务端或配置中选择(枚举:`BlockingQueueTypeEnum`):
-
-- ArrayBlockingQueue(数组有界队列)
-- LinkedBlockingQueue(链表队列)
-- LinkedBlockingDeque(双端队列)
-- SynchronousQueue(同步移交队列)
-- LinkedTransferQueue(可转移队列)
-- PriorityBlockingQueue(优先级队列)
-- ResizableCapacityLinkedBlockingQueue(可在线动态调容量的链表队列)
-
-## 枚举定义
-
-**ResizableCapacityLinkedBlockingQueue**:支持在线变更 `capacity`。
-
-```java
-// cn.hippo4j.common.executor.support.BlockingQueueTypeEnum
-RESIZABLE_LINKED_BLOCKING_QUEUE(9, "ResizableCapacityLinkedBlockingQueue") {
- @Override
- BlockingQueue of(Integer capacity) {
- return new ResizableCapacityLinkedBlockingQueue<>(capacity);
- }
- @Override
- BlockingQueue of() {
- return new ResizableCapacityLinkedBlockingQueue<>();
- }
-}
-```
-
-## 使用建议
-
-- 需要在线调容量:优先选择 `ResizableCapacityLinkedBlockingQueue`
-- 需要严格有界:选择 `ArrayBlockingQueue`
-- 需要无界吞吐:选择 `LinkedBlockingQueue`
-- 需要优先级:选择 `PriorityBlockingQueue`
-- 需要同步移交:选择 `SynchronousQueue`
-
-如需自定义队列类型,请参考《阻塞队列自定义》。
\ No newline at end of file
diff --git a/docs/docs/user_docs/dev_manual/rejected-policy-custom.md b/docs/docs/user_docs/dev_manual/rejected-policy-custom.md
deleted file mode 100644
index e0405061..00000000
--- a/docs/docs/user_docs/dev_manual/rejected-policy-custom.md
+++ /dev/null
@@ -1,57 +0,0 @@
----
-sidebar_position: 1
----
-
-# 拒绝策略自定义
-
-Hippo4j 通过 SPI 的方式对拒绝策略进行扩展,可以让用户在 Hippo4j 中完成自定义拒绝策略实现。
-
-## Hippo4j Server 拒绝策略扩展
-
-自定义拒绝策略,实现 `CustomRejectedExecutionHandler` 接口,示例如下:
-
-```java
-public class ErrorLogRejectedExecutionHandler implements CustomRejectedExecutionHandler {
-
- @Override
- public Integer getType() {
- return 12;
- }
-
- @Override
- public RejectedExecutionHandler generateRejected() {
- return new CustomErrorLogRejectedExecutionHandler();
- }
-
- public static class CustomErrorLogRejectedExecutionHandler implements RejectedExecutionHandler {
-
- @Override
- public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
- Logger logger = LoggerFactory.getLogger(this.getClass());
- logger.error("线程池抛出拒绝策略");
- }
- }
-}
-```
-
-创建 `src/main/resources/META-INF/services` 目录,创建 SPI 自定义拒绝策略文件 `cn.hippo4j.common.executor.support.CustomRejectedExecutionHandler`。
-
-`cn.hippo4j.common.executor.support.CustomRejectedExecutionHandler` 文件内仅放一行自定义拒绝策略全限定名即可,示例:
-
-```text
-cn.hippo4j.example.core.handler.ErrorLogRejectedExecutionHandler
-```
-
-创建、修改线程池页面选择 `CustomRejectedPolicy(自定义 SPI 策略)`。
-
-
-
-拒绝策略触发时,完成上述代码效果,仅打印异常日志提示。
-
-```text
-2022-08-01 21:27:49.515 ERROR 48928 --- [ateHandler.test] r$CustomErrorLogRejectedExecutionHandler : 线程池抛出拒绝策略
-```
-
-:::note
-具体参考 `hippo4j-example/hippo4j-spring-boot-starter-example` 模块。
-:::
diff --git a/docs/docs/user_docs/dev_manual/rejected-policy-info.md b/docs/docs/user_docs/dev_manual/rejected-policy-info.md
deleted file mode 100644
index d5c68138..00000000
--- a/docs/docs/user_docs/dev_manual/rejected-policy-info.md
+++ /dev/null
@@ -1,50 +0,0 @@
----
-sidebar_position: 0
----
-
-# 内置拒绝策略
-
-内置两种拒绝策略说明:
-
-**RunsOldestTaskPolicy**:添加新任务并由主线程运行最早的任务。
-
-```java
-public class RunsOldestTaskPolicy implements RejectedExecutionHandler {
-
- @Override
- public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
- if (executor.isShutdown()) {
- return;
- }
- BlockingQueue workQueue = executor.getQueue();
- Runnable firstWork = workQueue.poll();
- boolean newTaskAdd = workQueue.offer(r);
- if (firstWork != null) {
- firstWork.run();
- }
- if (!newTaskAdd) {
- executor.execute(r);
- }
- }
-}
-```
-
-**SyncPutQueuePolicy**:主线程把拒绝任务以阻塞的方式添加到队列。
-
-```java
-@Slf4j
-public class SyncPutQueuePolicy implements RejectedExecutionHandler {
-
- @Override
- public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
- if (executor.isShutdown()) {
- return;
- }
- try {
- executor.getQueue().put(r);
- } catch (InterruptedException e) {
- log.error("Adding Queue task to thread pool failed.", e);
- }
- }
-}
-```
\ No newline at end of file
diff --git a/docs/docs/user_docs/getting_started/_category_.json b/docs/docs/user_docs/getting_started/_category_.json
deleted file mode 100644
index 72b1e151..00000000
--- a/docs/docs/user_docs/getting_started/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "快速开始",
- "position": 3,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/docs/docs/user_docs/getting_started/config/_category_.json b/docs/docs/user_docs/getting_started/config/_category_.json
deleted file mode 100644
index 78b3d9c4..00000000
--- a/docs/docs/user_docs/getting_started/config/_category_.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "label": "依赖配置中心",
- "position": 2,
- "collapsed": true
-}
diff --git a/docs/docs/user_docs/getting_started/config/hippo4j-config-default.md b/docs/docs/user_docs/getting_started/config/hippo4j-config-default.md
deleted file mode 100644
index 9c9e0fc9..00000000
--- a/docs/docs/user_docs/getting_started/config/hippo4j-config-default.md
+++ /dev/null
@@ -1,45 +0,0 @@
----
-sidebar_position: 4
----
-
-# 参数默认配置
-
-曾有多名小伙伴反馈说,项目中线程池一多,配置文件中配置就显得很臃肿。为此 hippo4j-config 开发出了动态线程池默认配置。
-
-```yaml
-spring:
- dynamic:
- thread-pool:
- default-executor:
- core-pool-size: 4
- maximum-pool-size: 6
- blocking-queue: ResizableCapacityLinkedBlockingQueue
- queue-capacity: 1024
- execute-time-out: 1000
- keep-alive-time: 9999
- rejected-handler: AbortPolicy
- active-alarm: 90
- capacity-alarm: 85
- alarm: true
- allow-core-thread-time-out: true
- notify:
- interval: 5
- receives: chen.ma
- executors:
- - thread-pool-id: message-produce
- - thread-pool-id: message-consume
- core-pool-size: 80
- maximum-pool-size: 100
- execute-time-out: 1000
- notify:
- interval: 6
- receives: chen.ma
-```
-
-`spring.dynamic.thread-pool.executors` 层级下,仅需要配置 `thread-pool-id`,其余配置从 `spring.dynamic.thread-pool.default-executor` 读取。
-
-如果 `spring.dynamic.thread-pool.executors` 下配置和 `spring.dynamic.thread-pool.default-executor` 冲突,以前者为主。
-
-通过该自定义配置方式,可减少大量重复线程池参数配置项,提高核心配置简洁度。
-
-提示:`spring.dynamic.thread-pool.default-executor` 层级下参数,不提供动态刷新功能。
diff --git a/docs/docs/user_docs/getting_started/config/hippo4j-config-monitor.md b/docs/docs/user_docs/getting_started/config/hippo4j-config-monitor.md
deleted file mode 100644
index 17d665e6..00000000
--- a/docs/docs/user_docs/getting_started/config/hippo4j-config-monitor.md
+++ /dev/null
@@ -1,122 +0,0 @@
----
-sidebar_position: 3
----
-
-# 线程池监控
-
-## 线程池监控配置
-
-监控前置条件:需要先完成 hippo4j-config 的 [接入工作](/docs/user_docs/getting_started/config/hippo4j-config-start)。
-
-接下来引入 SpringBoot Actuator。Spring 2.x 一般都有版本指定,所以这里不用写版本号。
-
-```xml
-
- io.micrometer
- micrometer-registry-prometheus
-
-
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-```
-
-添加动态线程池监控相关配置:
-
-```yaml
-management:
- metrics:
- export:
- prometheus:
- enabled: true
- server:
- port: 29999 # 可选配置,如果不配置该 port,直接使用 ${server.port}
- endpoints:
- web:
- exposure:
- include: '*' # 测试使用,开启了所有端点,生产环境不建议 *
-spring:
- dynamic:
- thread-pool:
- monitor:
- enable: true # 是否开启采集线程池运行时数据
- collect-interval: 5000 # 采集线程池运行数据频率
- collect-types: micrometer # 采集线程池运行数据的类型。eg:log、micrometer。多个可以同时使用,默认 micrometer
- initial-delay: 10000 # 项目启动后延迟多久进行采集
- thread-pool-types: dynamic # 采集线程池的类型。eg:dynamic、web、adapter。可任意配置,默认 dynamic
-```
-
-项目启动,访问 `http://localhost:29999/actuator/prometheus` 出现 `dynamic_thread_pool_` 前缀的指标,即为成功。
-
-
-
-## 配置 Prometheus
-
-通过 Docker 启动 Prometheus 服务。
-
-```shell
-docker run -d -p 9090:9090 --name prometheus prom/prometheus
-```
-
-添加 Prometheus 抽取数据任务。
-
-```shell
-# 进入 prometheus 容器内部
-docker exec -it prometheus /bin/sh
-# 编辑 prometheus 配置文件
-vi /etc/prometheus/prometheus.yml
-```
-
-scrape_configs 节点下新添加一个 job,如果 Prometheus 是 Docker 方式部署,`{scrape_configs.static_configs.targets}` 需要写本机的 IP。
-
-```yaml
-scrape_configs:
- - job_name: 'dynamic-thread-pool-job'
- scrape_interval: 5s
- metrics_path: '/actuator/prometheus'
- static_configs:
- - targets: [ '127.0.0.1:29999' ]
-```
-
-配置成功后 `exit` 退出容器,并进行 Prometheus 容器重启 `docker restart prometheus`。
-
-访问 Prometheus 控制台 `http://localhost:9090/graph` 路径,能够展示相关指标即为配置成功。
-
-
-
-## 配置 Grafana
-
-```shell
-docker run -d -p 3000:3000 --name=grafana grafana/grafana
-```
-
-访问 Grafana 地址,[http://localhost:3000](http://localhost:3000) 用户名密码:`admin`
-
-Grafana 访问 `http://localhost:3000/datasources` 导入 Prometheus 数据源。
-
-
-
-> 如果 Prometheus 为 Docker 方式部署,HTTP URL 需要为本地 IP,比如:http://192.168.1.5:9090
-
-关注公众号 `龙台的技术笔记`,回复:`监控`,获取 Hippo4j Grafana DashBoard JSON 配置。
-
-| 公众号 | 回复关键词 |
-|:------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------:|
-|  |  |
-
-获取到 JSON 文件后,通过 `http://localhost:3000/dashboard/import` 将 JSON 文件导入至 Grafana DashBoard。
-
-
-
-下拉框内动态选择创建好的 Prometheus 数据源,并点击 `Import`。
-
-
-
-即可使用炫酷的 Hippo4j 动态线程池监控 DashBoard。大家伙儿也可以根据个人喜好进行定制 DashBoard,如果觉得有优化点,欢迎和我联系贡献。
-
-
-
-如果项目客户端启动多个示例,动态线程池监控效果图如下:
-
-
diff --git a/docs/docs/user_docs/getting_started/config/hippo4j-config-more.md b/docs/docs/user_docs/getting_started/config/hippo4j-config-more.md
deleted file mode 100644
index 09452013..00000000
--- a/docs/docs/user_docs/getting_started/config/hippo4j-config-more.md
+++ /dev/null
@@ -1,80 +0,0 @@
----
-sidebar_position: 3
----
-
-# 个性化配置
-
-以下所述特性自 hippo4j-config v1.4.2 及以上版本提供,由 hippo4j 核心开发者 [@pizihao](https://github.com/pizihao) 完成相应功能开发。
-
-## 需求背景
-
-**1)容器及三方框架线程池自定义启用**
-
-最初设计容器线程池和三方框架线程池的动态变更是和启动无关的。也就是说,启动时不会根据配置文件中相关参数去修改两者对应的线程池配置。
-
-这么设计的初衷是因为,不想让 hippo4j 过多的去介入框架原有的功能。因为容器和三方框架都支持线程池参数的自定义。
-
-也就造成,可能你在配置中心配置了对应的容器和三方框架线程池参数,启动时是无效的。但当修改配置文件任一配置,容器和三方框架线程池配置将生效。
-
-为了更好的用户体验,决定加入启用标识来控制:是否在项目初始化启动时,对容器和三方框架线程池参数进行修改。
-
-**2)客户端集群个性化配置**
-
-大家都知道,hippo4j-config 是依赖配置中心做线程池配置动态变更。这种模式有一种缺点:改动配置文件后,所有客户端都会变更。
-
-有些小伙伴希望 hippo4j-config 能够像 hippo4j-server 一样,能够针对单独的客户端进行配置变更。
-
-## 容器及三方框架线程池自定义启用
-
-容器及三方框架线程池添加启用配置,为了保持统一,动态线程池配置中也有该参数配置。配置项默认开启。
-
-```yaml
-spring:
- dynamic:
- thread-pool:
- web:
- enable: true
- executors:
- - thread-pool-id: message-consume
- enable: false
- adapter-executors:
- - threadPoolKey: 'input'
- enable: true
-```
-
-## 客户端集群个性化配置
-
-分别在动态线程池、容器线程池以及三方框架线程池配置下增加 `nodes` 配置节点,通过该配置可匹配需要变更的节点。
-
-```yaml
-spring:
- dynamic:
- thread-pool:
- web:
- nodes: 192.168.1.5:*,192.168.1.6:8080
- executors:
- - thread-pool-id: message-consume
- nodes: 192.168.1.5:*
- adapter-executors:
- - threadPoolKey: 'input'
- nodes: 192.168.1.5:*
-```
-
-来一段代码方法中的注释,大家就基本明白如何使用了。
-
-```java
-/**
- * Matching nodes
- * nodes is ip + port.Get 'nodes' in the new Properties,Compare this with the ip + port of Application.
- * support prefix pattern matching. e.g:
- *
- * 192.168.1.5:* -- Matches all ports of 192.168.1.5
- * 192.168.1.*:2009 -- Matches 2009 port of 192.168.1.*
- * * -- all
- * empty -- all
- *
- * The format of ip + port is ip : port.
- */
-```
-
-`nodes` 可与 `enable` 同时使用。如此,基于配置中心的动态线程池实现方式,将能够更方便的支持个性化需求。
diff --git a/docs/docs/user_docs/getting_started/config/hippo4j-config-springboot1x-adapter.md b/docs/docs/user_docs/getting_started/config/hippo4j-config-springboot1x-adapter.md
deleted file mode 100644
index a1885e0c..00000000
--- a/docs/docs/user_docs/getting_started/config/hippo4j-config-springboot1x-adapter.md
+++ /dev/null
@@ -1,121 +0,0 @@
----
-sidebar_position: 5
----
-
-# 适配SpringBoot1x
-
-目前已支持 Nacos、Apollo 配置中心适配 SpringBoot 1.5.x 版本。
-
-```xml
-
- cn.hippo4j
- hippo4j-config-spring-boot-1x-starter
- 1.5.0
-
-```
-
-Nacos SpringBoot 配置如下:
-
-```yaml
-spring:
- cloud:
- nacos:
- config:
- ext-config:
- - data-id: hippo4j-nacos.yaml
- group: DEFAULT_GROUP
- refresh: true
- server-addr: 127.0.0.1:8848
- dynamic:
- thread-pool:
- config-file-type: yml
- nacos:
- data-id: hippo4j-nacos.yaml
- group: DEFAULT_GROUP
-```
-
-Apollo SpringBoot 配置如下:
-
-```yaml
-apollo:
- autoUpdateInjectedSpringProperties: true
- bootstrap:
- eagerLoad:
- enabled: true
- enabled: true
- namespaces: application
- meta: http://127.0.0.1:8080
-app:
- id: dynamic-threadpool-example
-spring:
- dynamic:
- thread-pool:
- apollo:
- namespace: application
-```
-
-动态线程池通用配置如下:
-
-```yaml
-management:
- context-path: /actuator
- security:
- enabled: false
-server:
- port: 8091
- servlet:
- context-path: /example
-spring:
- application:
- name: dynamic-threadpool-example
- dynamic:
- thread-pool:
- banner: true
- check-state-interval: 5
- collect-type: micrometer
- config-file-type: properties
- enable: true
- executors:
- - active-alarm: 80
- alarm: true
- allow-core-thread-time-out: true
- blocking-queue: LinkedBlockingQueue
- capacity-alarm: 80
- core-pool-size: 1
- execute-time-out: 1000
- keep-alive-time: 6691
- maximum-pool-size: 1
- notify:
- interval: 8
- receives: chen.ma
- queue-capacity: 1
- rejected-handler: AbortPolicy
- thread-name-prefix: message-consume
- thread-pool-id: message-consume
- - active-alarm: 80
- alarm: true
- allow-core-thread-time-out: true
- blocking-queue: LinkedBlockingQueue
- capacity-alarm: 80
- core-pool-size: 1
- execute-time-out: 1000
- keep-alive-time: 6691
- maximum-pool-size: 1
- notify:
- interval: 8
- receives: chen.ma
- queue-capacity: 1
- rejected-handler: AbortPolicy
- thread-name-prefix: message-produce
- thread-pool-id: message-produce
- notify-platforms:
- - platform: WECHAT
- token: ac0426a5-c712-474c-9bff-72b8b8f5caff
- profiles:
- active: dev
-```
-
-具体 Demo 运行请参考以下示例模块,已验证对应线程池动态变更、报警以及运行时监控功能。
-
-- `/hippo4j-config-nacos-spring-boot-1x-starter-example`
-- `hippo4j-example/hippo4j-config-apollo-spring-boot-1x-starter-example`
diff --git a/docs/docs/user_docs/getting_started/config/hippo4j-config-start.md b/docs/docs/user_docs/getting_started/config/hippo4j-config-start.md
deleted file mode 100644
index 6ead578b..00000000
--- a/docs/docs/user_docs/getting_started/config/hippo4j-config-start.md
+++ /dev/null
@@ -1,193 +0,0 @@
----
-sidebar_position: 1
----
-
-# 接入流程
-
-Nacos、Apollo、Zookeeper、ETCD、Polaris、Consul 配置中心任选其一。
-
-## hippo4j 配置
-
-```xml
-
- cn.hippo4j
- hippo4j-config-spring-boot-starter
- 1.5.0
-
-```
-
-启动类上添加注解 `@EnableDynamicThreadPool`。
-
-```java
-@SpringBootApplication
-@EnableDynamicThreadPool
-public class ExampleApplication {
- public static void main(String[] args) {
- SpringApplication.run(ExampleApplication.class, args);
- }
-}
-```
-
-SpringBoot 应用配置文件添加:
-
-```yaml
-server:
- port: 8090
- servlet:
- context-path: /example
-
-spring:
- profiles:
- active: dev
-
- dynamic:
- thread-pool:
- # 是否开启动态线程池
- enable: true
- # 是否打印 banner
- banner: true
- # 是否开启线程池数据采集,对接 Micrometer、ES、Log 等
- collect: true
- # 检查线程池状态,是否达到报警条件,单位毫秒
- check-state-interval: 3000
- # 通知报警平台,请替换为自己创建的群机器人
- notify-platforms:
- - platform: 'WECHAT'
- token: xxx
- - platform: 'DING'
- token: xxx
- secret: xxx # 加签专属
- - platform: 'LARK'
- token: xxx
- # Nacos、Apollo、Zookeeper、ETCD、Polaris、Consul 任选其一
- nacos:
- data-id: xxx
- group: xxx
- apollo:
- namespace: xxxx
- # 配置中心文件格式
- config-file-type: yml
- # 支持 tomcat、undertow、jetty 三种容器线程池
- web:
- core-pool-size: 100
- maximum-pool-size: 200
- keep-alive-time: 1000
- # 全局通知配置-是否报警
- alarm: true
- # 活跃度报警阈值;假设线程池最大线程数 10,当线程数达到 8 发起报警
- active-alarm: 80
- # 容量报警阈值;假设阻塞队列容量 100,当容量达到 80 发起报警
- capacity-alarm: 80
- # 报警间隔,同一线程池下同一报警纬度,在 interval 时间内只会报警一次,单位秒
- alarm-interval: 8
- # 企业微信填写用户 ID(填写其它将无法达到 @ 效果)、钉钉填手机号、飞书填 ou_ 开头唯一 ID
- receives: xxx
- # 动态线程池列表
- executors:
- - thread-pool-id: 'message-consume'
- # 核心线程数
- core-pool-size: 1
- # 最大线程数
- maximum-pool-size: 1
- # 阻塞队列名称,参考 BlockingQueueTypeEnum,支持 SPI
- blocking-queue: 'LinkedBlockingQueue'
- # 阻塞队列大小
- queue-capacity: 1
- # 执行超时时间,超过此时间发起报警,单位毫秒
- execute-time-out: 1000
- # 拒绝策略名称,参考 RejectedPolicyTypeEnum,支持 SPI
- rejected-handler: 'AbortPolicy'
- # 线程存活时间,单位秒
- keep-alive-time: 1024
- # 是否允许核心线程超时
- allow-core-thread-time-out: true
- # 线程工厂名称前缀
- thread-name-prefix: 'message-consume'
- # 是否报警
- alarm: true
- # 活跃度报警阈值;假设线程池最大线程数 10,当线程数达到 8 发起报警
- active-alarm: 80
- # 容量报警阈值;假设阻塞队列容量 100,当容量达到 80 发起报警
- capacity-alarm: 80
- # 通知配置,线程池中通知配置如果存在,则会覆盖全局通知配置
- notify:
- # 报警间隔,同一线程池下同一报警纬度,在 interval 时间内只会报警一次,单位分钟
- interval: 8
- # 企业微信填写用户 ID(填写其它将无法达到 @ 效果)、钉钉填手机号、飞书填 ou_ 开头唯一 ID
- receives: xxx
- - thread-pool-id: 'message-produce'
- core-pool-size: 1
- maximum-pool-size: 1
- queue-capacity: 1
- execute-time-out: 1000
- blocking-queue: 'LinkedBlockingQueue'
- rejected-handler: 'AbortPolicy'
- keep-alive-time: 1024
- allow-core-thread-time-out: true
- thread-name-prefix: 'message-consume'
- alarm: true
- active-alarm: 80
- capacity-alarm: 80
- notify:
- interval: 8
- receives: xxx
-```
-
-## ThreadPoolExecutor 适配
-
-添加线程池配置类,通过 `@DynamicThreadPool` 注解修饰。`threadPoolId` 为服务端创建的线程池 ID。
-
-```java
-package cn.hippo4j.example;
-
-import cn.hippo4j.core.executor.DynamicThreadPool;
-import cn.hippo4j.core.executor.support.ThreadPoolBuilder;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import java.util.concurrent.ThreadPoolExecutor;
-
-@Configuration
-public class ThreadPoolConfig {
-
- @Bean
- @DynamicThreadPool
- public ThreadPoolExecutor messageConsumeDynamicExecutor() {
- String threadPoolId = "message-consume";
- ThreadPoolExecutor messageConsumeDynamicExecutor = ThreadPoolBuilder.builder()
- .threadFactory(threadPoolId)
- .threadPoolId(threadPoolId)
- .dynamicPool()
- .build();
- return messageConsumeDynamicExecutor;
- }
-
- @Bean
- @DynamicThreadPool
- public ThreadPoolExecutor messageProduceDynamicExecutor() {
- String threadPoolId = "message-produce";
- ThreadPoolExecutor messageProduceDynamicExecutor = ThreadPoolBuilder.builder()
- .threadFactory(threadPoolId)
- .threadPoolId(threadPoolId)
- .dynamicPool()
- .build();
- return messageProduceDynamicExecutor;
- }
-
-}
-```
-
-通过 ThreadPoolBuilder 构建动态线程池,只有 threadFactory、threadPoolId 为必填项,其它参数会从配置中心拉取。
-
-项目中使用上述定义的动态线程池,如下所示:
-
-```java
-@Resource
-private ThreadPoolExecutor messageConsumeDynamicExecutor;
-
-messageConsumeDynamicExecutor.execute(() -> xxx);
-
-@Resource
-private ThreadPoolExecutor messageProduceDynamicExecutor;
-
-messageProduceDynamicExecutor.execute(() -> xxx);
-```
diff --git a/docs/docs/user_docs/getting_started/difference.md b/docs/docs/user_docs/getting_started/difference.md
deleted file mode 100644
index 549da02d..00000000
--- a/docs/docs/user_docs/getting_started/difference.md
+++ /dev/null
@@ -1,37 +0,0 @@
----
-sidebar_position: 0
----
-
-# 运行模式介绍
-
-1.1.0 版本发布后,Hippo4j 分为两种使用模式:轻量级依赖配置中心以及无中间件依赖版本。
-
-
-
-### Hippo4j config
-
-**轻量级动态线程池管理**,依赖 Nacos、Apollo、Zookeeper、ETCD、Polaris、Consul 等三方配置中心(任选其一)完成线程池参数动态变更,支持运行时报警、监控等功能。
-
-> 监控功能配置详见:[线程池监控](/docs/user_docs/getting_started/config/hippo4j-config-monitor)
-
-
-
-### Hippo4j server
-
-**部署 Hippo4j server 服务**,通过可视化 Web 界面完成线程池的创建、变更以及查看,不依赖三方中间件。
-
-相比较 Hippo4j config,功能会更强大,但同时也引入了一定的复杂性。需要部署一个 Java 服务,以及依赖 MySQL 数据库。
-
-
-
-### 使用总结
-
-| | Hippo4j config | Hippo4j server |
-| ---- |-------------------------------------------------------|--------------------------------------------------------|
-| 依赖 | Nacos、Apollo、Zookeeper、ETCD、Polaris、Consul 配置中心(任选其一) | 部署 Hippo4j server(内部无依赖中间件) |
-| 使用 | 配置中心补充线程池相关参数 | Hippo4j server web 控制台添加线程池记录 |
-| 功能 | 包含基础功能:参数动态化、运行时监控、报警等 | 基础功能之外扩展控制台界面、线程池堆栈查看、线程池运行信息实时查看、历史运行信息查看、线程池配置集群个性化等 |
-
-使用建议:根据公司情况选择,如果基本功能可以满足使用,选择 Hippo4j config 使用即可;如果希望更多的功能,可以选择 Hippo4j server。
-
-**两者在进行替换的时候,无需修改业务代码**。
diff --git a/docs/docs/user_docs/getting_started/hippo4j-adapter.md b/docs/docs/user_docs/getting_started/hippo4j-adapter.md
deleted file mode 100644
index 68a48288..00000000
--- a/docs/docs/user_docs/getting_started/hippo4j-adapter.md
+++ /dev/null
@@ -1,72 +0,0 @@
----
-sidebar_position: 6
----
-
-# 三方框架线程池适配
-
-Hippo4j 目前已支持的三方框架线程池列表:
-
-- Dubbo
-- Hystrix
-- RabbitMQ
-- RocketMQ
-- AlibabaDubbo
-- RocketMQSpringCloudStream
-- RabbitMQSpringCloudStream
-
-引入 Hippo4j Server 或 Core 的 Maven Jar 坐标后,还需要引入对应的框架适配 Jar:
-
-```xml
-
- cn.hippo4j
-
- hippo4j-spring-boot-starter-adapter-dubbo
-
- hippo4j-spring-boot-starter-adapter-alibaba-dubbo
-
- hippo4j-spring-boot-starter-adapter-hystrix
-
- hippo4j-spring-boot-starter-adapter-rabbitmq
-
- hippo4j-spring-boot-starter-adapter-rocketmq
-
- hippo4j-spring-boot-starter-adapter-spring-cloud-stream-rocketmq
-
- hippo4j-spring-boot-starter-adapter-spring-cloud-stream-rabbitmq
- 1.5.0
-
-```
-
-如果想省事,仅需引入一个全量包,框架底层会根据条件判断加载具体线程池适配器。
-
-```xml
-
- cn.hippo4j
- hippo4j-spring-boot-starter-adapter-all
- 1.5.0
-
-```
-
-## Hippo4j Server
-
-Hippo4j Server 仅需要引入上述 Jar 包,即可在 Hippo4j Server 的控制台进行查看及修改三方框架线程池。
-
-
-
-## Hippo4j Config
-
-Hippo4j Config 除了依赖上述适配 Jar 包外,还需要在配置中心添加以下配置项。
-
-```yaml
-spring:
- dynamic:
- thread-pool:
- # 省略其它配置
- adapter-executors:
- # threadPoolKey 代表线程池标识
- - threadPoolKey: 'input'
- # mark 为三方线程池框架类型,参见文初已支持框架集合
- mark: 'RocketMQSpringCloudStream'
- corePoolSize: 10
- maximumPoolSize: 10
-```
diff --git a/docs/docs/user_docs/getting_started/img/docsVersionDropdown.png b/docs/docs/user_docs/getting_started/img/docsVersionDropdown.png
deleted file mode 100644
index 97e41646..00000000
Binary files a/docs/docs/user_docs/getting_started/img/docsVersionDropdown.png and /dev/null differ
diff --git a/docs/docs/user_docs/getting_started/img/grafana-monitor.jpg b/docs/docs/user_docs/getting_started/img/grafana-monitor.jpg
deleted file mode 100644
index 336bd980..00000000
Binary files a/docs/docs/user_docs/getting_started/img/grafana-monitor.jpg and /dev/null differ
diff --git a/docs/docs/user_docs/getting_started/img/localeDropdown.png b/docs/docs/user_docs/getting_started/img/localeDropdown.png
deleted file mode 100644
index e257edc1..00000000
Binary files a/docs/docs/user_docs/getting_started/img/localeDropdown.png and /dev/null differ
diff --git a/docs/docs/user_docs/getting_started/server/_category_.json b/docs/docs/user_docs/getting_started/server/_category_.json
deleted file mode 100644
index 4063c17f..00000000
--- a/docs/docs/user_docs/getting_started/server/_category_.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "label": "无中间件依赖",
- "position": 3,
- "collapsed": true
-}
diff --git a/docs/docs/user_docs/getting_started/server/hippo4j-server-config.md b/docs/docs/user_docs/getting_started/server/hippo4j-server-config.md
deleted file mode 100644
index e1ef853f..00000000
--- a/docs/docs/user_docs/getting_started/server/hippo4j-server-config.md
+++ /dev/null
@@ -1,19 +0,0 @@
----
-sidebar_position: 3
----
-
-# 服务端配置
-
-`hippo4j.core.clean-history-data-enable`
-
-是否开启线程池历史数据清洗,默认开启。
-
-`hippo4j.core.clean-history-data-period`
-
-线程池历史数据保留时间,默认值:30,单位分钟。
-
-服务端会保留这个配置时间的数据,超过这个时间则会被清理。比如按照默认值 30 分钟来说,12:00 收集到的数据,12:30 就会被清理删除。
-
-`hippo4j.core.monitor.report-type`
-
-客户端监控上报服务端类型,可选值:http、netty,默认 http。服务端开启 netty 配置后,需要在客户端对应开启才可生效。用来应对大量动态线程池监控场景。
diff --git a/docs/docs/user_docs/getting_started/server/hippo4j-server-monitor.md b/docs/docs/user_docs/getting_started/server/hippo4j-server-monitor.md
deleted file mode 100644
index 08d89fa2..00000000
--- a/docs/docs/user_docs/getting_started/server/hippo4j-server-monitor.md
+++ /dev/null
@@ -1,132 +0,0 @@
----
-sidebar_position: 2
----
-
-# 线程池监控
-
-Server 模式默认内置线程池运行时采集和监控功能,如果想要使用 Prometheus + Grafana 的方式可以查看以下内容。
-
-## 线程池监控配置
-
-接下来引入 SpringBoot Actuator。Spring 2.x 一般都有版本指定,所以这里不用写版本号。
-
-```xml
-
- io.micrometer
- micrometer-registry-prometheus
-
-
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-```
-
-添加动态线程池监控相关配置:
-
-```yaml
-management:
- metrics:
- export:
- prometheus:
- enabled: true
- server:
- port: 29999 # 可选配置,如果不配置该 port,直接使用 ${server.port}
- endpoints:
- web:
- exposure:
- include: '*' # 测试使用,开启了所有端点,生产环境不建议 *
-spring:
- dynamic:
- thread-pool:
- monitor:
- enable: true # 是否开启采集线程池运行时数据
- collect-interval: 5000 # 采集线程池运行数据频率
- collect-types: server,micrometer # 采集线程池运行数据的类型。eg:server、micrometer。多个可以同时使用,默认 server
- initial-delay: 10000 # 项目启动后延迟多久进行采集
- thread-pool-types: dynamic # 采集线程池的类型。eg:dynamic、web、adapter。可任意配置,默认 dynamic
-```
-
-如果使用 `micrometer` 类型的监控指标,需要添加以下依赖。
-
-```xml
-
- cn.hippo4j
- hippo4j-spring-boot-starter-monitor-micrometer
- 1.5.0
-
-```
-
-项目启动,访问 `http://localhost:29999/actuator/prometheus` 出现 `dynamic_thread_pool_` 前缀的指标,即为成功。
-
-
-
-## 配置 Prometheus
-
-通过 Docker 启动 Prometheus 服务。
-
-```shell
-docker run -d -p 9090:9090 --name prometheus prom/prometheus
-```
-
-添加 Prometheus 抽取数据任务。
-
-```shell
-# 进入 prometheus 容器内部
-docker exec -it prometheus /bin/sh
-# 编辑 prometheus 配置文件
-vi /etc/prometheus/prometheus.yml
-```
-
-scrape_configs 节点下新添加一个 job,如果 Prometheus 是 Docker 方式部署,`{scrape_configs.static_configs.targets}` 需要写本机的 IP。
-
-```yaml
-scrape_configs:
- - job_name: 'dynamic-thread-pool-job'
- scrape_interval: 5s
- metrics_path: '/actuator/prometheus'
- static_configs:
- - targets: [ '127.0.0.1:29999' ]
-```
-
-配置成功后 `exit` 退出容器,并进行 Prometheus 容器重启 `docker restart prometheus`。
-
-访问 Prometheus 控制台 `http://localhost:9090/graph` 路径,能够展示相关指标即为配置成功。
-
-
-
-## 配置 Grafana
-
-```shell
-docker run -d -p 3000:3000 --name=grafana grafana/grafana
-```
-
-访问 Grafana 地址,[http://localhost:3000](http://localhost:3000) 用户名密码:`admin`
-
-Grafana 访问 `http://localhost:3000/datasources` 导入 Prometheus 数据源。
-
-
-
-> 如果 Prometheus 为 Docker 方式部署,HTTP URL 需要为本地 IP,比如:http://192.168.1.5:9090
-
-关注公众号 `龙台的技术笔记`,回复:`监控`,获取 Hippo4j Grafana DashBoard JSON 配置。
-
-| 公众号 | 回复关键词 |
-|:------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------:|
-|  |  |
-
-获取到 JSON 文件后,通过 `http://localhost:3000/dashboard/import` 将 JSON 文件导入至 Grafana DashBoard。
-
-
-
-下拉框内动态选择创建好的 Prometheus 数据源,并点击 `Import`。
-
-
-
-即可使用炫酷的 Hippo4j 动态线程池监控 DashBoard。大家伙儿也可以根据个人喜好进行定制 DashBoard,如果觉得有优化点,欢迎和我联系贡献。
-
-
-
-如果项目客户端启动多个示例,动态线程池监控效果图如下:
-
-
diff --git a/docs/docs/user_docs/getting_started/server/hippo4j-server-start.md b/docs/docs/user_docs/getting_started/server/hippo4j-server-start.md
deleted file mode 100644
index 17ec5224..00000000
--- a/docs/docs/user_docs/getting_started/server/hippo4j-server-start.md
+++ /dev/null
@@ -1,127 +0,0 @@
----
-sidebar_position: 1
----
-
-# 接入流程
-
-部署服务端,参考 [部署手册](/docs/user_docs/ops/hippo4j-server-deploy)。
-
-服务端创建 [租户、项目](/community/faq#租户和项目在-hippo4j-中是什么意思) 和线程池记录。
-
-需要注意,项目 ID 需要与配置文件 `{application.name}` 保持一致。
-
-:::note
-租户、项目、线程池 ID 如果由多个词组成,建议以 - 进行分割。比如:message-center。
-:::
-
-## Hippo4j 配置
-
-SpringBoot Pom 引入 Hippo4j Starter Jar。
-
-```xml
-
- cn.hippo4j
- hippo4j-spring-boot-starter
- 1.5.0
-
-```
-
-启动类上添加注解 `@EnableDynamicThreadPool`。
-
-```java
-@SpringBootApplication
-@EnableDynamicThreadPool
-public class ExampleApplication {
- public static void main(String[] args) {
- SpringApplication.run(ExampleApplication.class, args);
- }
-}
-```
-
-SpringBoot 应用配置文件添加:
-
-```yaml
-spring:
- profiles:
- active: dev
- application:
- # 服务端创建的项目 id 需要与 application.name 保持一致
- name: dynamic-threadpool-example
- dynamic:
- thread-pool:
- # 服务端地址
- server-addr: http://localhost:6691
- # 用户名
- username: admin
- # 密码
- password: 123456
- # 租户 id, 对应 tenant 表
- namespace: prescription
- # 项目 id, 对应 item 表
- item-id: ${spring.application.name}
-```
-
-## ThreadPoolExecutor 适配
-
-添加线程池配置类,通过 `@DynamicThreadPool` 注解修饰。`threadPoolId` 为服务端创建的线程池 ID。
-
-```java
-package cn.hippo4j.example;
-
-import cn.hippo4j.core.executor.DynamicThreadPool;
-import cn.hippo4j.core.executor.support.ThreadPoolBuilder;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import java.util.concurrent.ThreadPoolExecutor;
-
-@Configuration
-public class ThreadPoolConfig {
-
- @Bean
- @DynamicThreadPool
- public ThreadPoolExecutor messageConsumeDynamicExecutor() {
- String threadPoolId = "message-consume";
- ThreadPoolExecutor messageConsumeDynamicExecutor = ThreadPoolBuilder.builder()
- .threadFactory(threadPoolId)
- .threadPoolId(threadPoolId)
- .dynamicPool()
- .build();
- return messageConsumeDynamicExecutor;
- }
-
- @Bean
- @DynamicThreadPool
- public ThreadPoolExecutor messageProduceDynamicExecutor() {
- String threadPoolId = "message-produce";
- ThreadPoolExecutor messageProduceDynamicExecutor = ThreadPoolBuilder.builder()
- .threadFactory(threadPoolId)
- .threadPoolId(threadPoolId)
- .dynamicPool()
- .build();
- return messageProduceDynamicExecutor;
- }
-
-}
-```
-
-通过 ThreadPoolBuilder 构建动态线程池,只有 threadFactory、threadPoolId 为必填项,其它参数会从 hippo4j-server 服务拉取。
-
-:::note
-创建线程池时建议填充实际的参数。如果在连接 Hippo4j Server 端失败时,会使用填充配置创建线程池。
-:::
-
-项目中使用上述定义的动态线程池,如下所示:
-
-```java
-@Resource
-private ThreadPoolExecutor messageConsumeDynamicExecutor;
-
-messageConsumeDynamicExecutor.execute(() -> xxx);
-
-@Resource
-private ThreadPoolExecutor messageProduceDynamicExecutor;
-
-messageProduceDynamicExecutor.execute(() -> xxx);
-```
-
diff --git a/docs/docs/user_docs/intro.md b/docs/docs/user_docs/intro.md
deleted file mode 100644
index af470274..00000000
--- a/docs/docs/user_docs/intro.md
+++ /dev/null
@@ -1,70 +0,0 @@
----
-sidebar_position: 1
----
-
-# 简介
-
-## 线程池痛点
-
-线程池是一种基于池化思想管理线程的工具,使用线程池可以减少创建销毁线程的开销,避免线程过多导致系统资源耗尽。在高并发以及大批量的任务处理场景,线程池的使用是必不可少的。
-
-如果有在项目中实际使用线程池,相信你可能会遇到以下痛点:
-
-- 线程池随便定义,线程资源过多,造成服务器高负载。
-
-- 线程池参数不易评估,随着业务的并发提升,业务面临出现故障的风险。
-- 线程池任务执行时间超过平均执行周期,开发人员无法感知。
-- 线程池任务堆积,触发拒绝策略,影响既有业务正常运行。
-- 当业务出现超时、熔断等问题时,因为没有监控,无法确定是不是线程池引起。
-- 原生线程池不支持运行时变量的传递,比如 MDC 上下文遇到线程池就 GG。
-- 无法执行优雅关闭,当项目关闭时,大量正在运行的线程池任务被丢弃。
-- 线程池运行中,任务执行停止,怀疑发生死锁或执行耗时操作,但是无从下手。
-
-## 什么是 Hippo4j
-
-Hippo4j 通过对 JDK 线程池增强,以及扩展三方框架底层线程池等功能,为业务系统提高线上运行保障能力。
-
-提供以下功能支持:
-
-- 全局管控 - 管理应用线程池实例。
-
-- 动态变更 - 应用运行时动态变更线程池参数,包括不限于:核心、最大线程数、阻塞队列容量、拒绝策略等。
-- 通知报警 - 内置四种报警通知策略,线程池活跃度、容量水位、拒绝策略以及任务执行时间超长。
-- 运行监控 - 实时查看线程池运行时数据,最近半小时线程池运行数据图表展示。
-- 功能扩展 - 支持线程池任务传递上下文;项目关闭时,支持等待线程池在指定时间内完成任务。
-- 多种模式 - 内置两种使用模式:[依赖配置中心](https://hippo4j.cn/docs/user_docs/getting_started/config/hippo4j-config-start) 和 [无中间件依赖](https://hippo4j.cn/docs/user_docs/getting_started/server/hippo4j-server-start)。
-- 容器管理 - Tomcat、Jetty、Undertow 容器线程池运行时查看和线程数变更。
-- 框架适配 - Dubbo、Hystrix、RabbitMQ、RocketMQ 等消费线程池运行时数据查看和线程数变更。
-
-## 快速开始
-
-对于本地演示目的,请参阅 [Quick start](https://hippo4j.cn/docs/user_docs/user_guide/quick-start)
-
-演示环境: [http://console.hippo4j.cn/index.html](http://console.hippo4j.cn/index.html)
-
-## 接入登记
-
-更多接入的公司,欢迎在 [登记地址](https://github.com/opengoofy/hippo4j/issues/13) 登记,登记仅仅为了产品推广。
-
-## 联系我
-
-开源不易,右上角点个 Star 鼓励一下吧!
-
-如果大家想要实时关注 Hippo4j 更新的文章以及分享的干货的话,可以关注我的公众号。
-
-使用过程中有任何问题,或者对项目有什么建议,关注公众号回复:加群,和 1000+ 志同道合的朋友交流讨论。
-
-
-
-## 友情链接
-
-- [[ LiteFlow ]](https://liteflow.yomahub.com/):轻量,快速,稳定可编排的组件式规则引擎。
-
-- [[ Sa-Token ]](https://github.com/dromara/sa-token):一个轻量级 java 权限认证框架,让鉴权变得简单、优雅!
-- [[ HertzBeat ]](https://github.com/dromara/hertzbeat):易用友好的云监控系统, 无需 Agent, 强大自定义监控能力。
-- [[ JavaGuide ]](https://github.com/Snailclimb/JavaGuide):一份涵盖大部分 Java 程序员所需要掌握的核心知识。
-- [[ toBeBetterJavaer ]](https://github.com/itwanger/toBeBetterJavaer):一份通俗易懂、风趣幽默的 Java 学习指南。
-
-## 贡献者
-
-感谢所有为项目作出贡献的开发者。如果有意贡献,参考 [good first issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)。
diff --git a/docs/docs/user_docs/ops/_category_.json b/docs/docs/user_docs/ops/_category_.json
deleted file mode 100644
index d5b7d1e8..00000000
--- a/docs/docs/user_docs/ops/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "运维指南",
- "position": 4,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/docs/docs/user_docs/ops/hippo4j-server-deploy.md b/docs/docs/user_docs/ops/hippo4j-server-deploy.md
deleted file mode 100644
index ffbc2306..00000000
--- a/docs/docs/user_docs/ops/hippo4j-server-deploy.md
+++ /dev/null
@@ -1,45 +0,0 @@
----
-sidebar_position: 1
----
-
-# 源码包部署
-
-[RELEASE](https://github.com/opengoofy/hippo4j/releases) 页面下载对应版本并进行解压。
-
-## 初始化
-
-修改数据库相关信息。
-
-```txt
-/conf/application.properties
-```
-
-如果是新运行 Hippo4j,数据库执行下述 SQL 脚本即可。
-
-```txt
-/conf/hippo4j_manager.sql
-```
-
-如果是对已运行 Hippo4j 升级,请查看 `/conf/sql-upgrade` 目录下,是否有目标版本对应的升级脚本。
-
-## 直接运行
-
-Mac Linux 启动执行。
-
-```txt
-sh ./bin/startup.sh
-```
-
-Windows 启动执行。
-
-```txt
-bin/startup.cmd
-```
-
-## 访问控制台
-
-启动成功后,访问链接。用户名密码:admin 123456
-
-```txt
-localhost:6691/index.html
-```
diff --git a/docs/docs/user_docs/ops/server-docker.md b/docs/docs/user_docs/ops/server-docker.md
deleted file mode 100644
index 0812b931..00000000
--- a/docs/docs/user_docs/ops/server-docker.md
+++ /dev/null
@@ -1,55 +0,0 @@
----
-sidebar_position: 2
----
-
-# Docker部署
-
-## 镜像启动
-
-Docker 镜像默认使用内置 H2 数据库,数据持久化到 Docker 容器存储卷中。
-
-```shell
-docker run -d -p 6691:6691 --name hippo4j-server hippo4j/hippo4j-server
-```
-
-或者,底层存储数据库切换为 MySQL。`DATASOURCE_HOST` 需要切换为本地 IP,不能使用 `127.0.0.1` 或 `localhost`。
-
-```shell
-docker run -d -p 6691:6691 --name hippo4j-server \
--e DATASOURCE_MODE=mysql \
--e DATASOURCE_HOST=xxx.xxx.xxx.xxx \
--e DATASOURCE_PORT=3306 \
--e DATASOURCE_DB=hippo4j_manager \
--e DATASOURCE_USERNAME=root \
--e DATASOURCE_PASSWORD=root \
-hippo4j/hippo4j-server
-```
-
-访问 Server 控制台,路径 `http://localhost:6691/index.html` ,默认用户名密码:admin / 123456
-
-## 镜像构建
-
-如果想要自定义镜像,可以通过以下命令快速构建 Hippo4j Server:
-
-方式一:
-
-```shell
-# 进入到 threadpool/server/bootstrap 工程路径下
-mvn clean package -Dskip.spotless.apply=true
-# 进入到 docker 工程路径下
-# 默认打包是打包的 tag 是 latest
-docker build -t hippo4j/hippo4j-server ../docker
-
-# 构建多平台版本
-docker buildx build --platform linux/arm64 -t hippo4j/hippo4j-server ../docker
-docker buildx build --platform linux/amd64 -t hippo4j/hippo4j-server ../docker
-```
-
-方式二:
-
-通过 `maven docker plugin`
-
-```shell
-# 进入到 threadpool/server/bootstrap 工程路径下
-mvn clean package -DskipTests -Dskip.spotless.apply=true docker:build
-```
diff --git a/docs/docs/user_docs/other/_category_.json b/docs/docs/user_docs/other/_category_.json
deleted file mode 100644
index a74d7432..00000000
--- a/docs/docs/user_docs/other/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "其它",
- "position": 6,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/docs/docs/user_docs/other/official-ccounts.md b/docs/docs/user_docs/other/official-ccounts.md
deleted file mode 100644
index 63e07ea7..00000000
--- a/docs/docs/user_docs/other/official-ccounts.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-sidebar_position: 5
----
-
-# 推荐公众号
-
-## JavaGuide
-
-专注Java后端学习和大厂面试的公众号!
-
-
-
-## HelloGitHub
-
-HelloGitHub,专注于开源社区技术和知识内容分享。
-
-
-
-## macrozheng
-
-专注Java技术分享,解析优质开源项目。涵盖SpringBoot、SpringCloud、Docker、K8S等实用技术,作者Github开源项目mall(50K+Star)。
-
-
diff --git a/docs/docs/user_docs/other/operation.md b/docs/docs/user_docs/other/operation.md
deleted file mode 100644
index 62661c55..00000000
--- a/docs/docs/user_docs/other/operation.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-sidebar_position: 6
----
-
-# 公众号合作
-
-## 推荐须知
-
-hippo4j 作为一款新兴动态线程池框架,开源出来的时间比较晚,目前迫切需要不同的途径进行推广。
-
-如果您是公众号运营者或者开源爱好者,欢迎将 hippo4j 推荐给您的粉丝。
-
-1. 您无需为 hippo4j 专门撰写文案,只需要直接导入 [推荐文章](https://mp.weixin.qq.com/s/JTTwcBEiK_MnFcPTZl3zGA) 即可。
-2. 在文章底部或内容中留下项目官网或者 GitHub 仓库链接。
-3. 文章需至少 1000+ 的阅读量。
-
-作为推荐回报,hippo4j 可以为您:
-
-1. 在框架官方文档 [推荐公众号](/docs/user_docs/other/official-ccounts) 页面处留下您的公众号二维码。
-2. 在框架官方交流群里@全体成员推广您的公众号一次,附带介绍语。
-3. 您的公众号所有新推文章都可以将链接发送到 hippo4j 交流群中,增加阅读量。
-
-如果您还有除公众号以外的其它途径可以与 hippo4j 相互推荐,欢迎 [加群沟通](/group)。
diff --git a/docs/docs/user_docs/other/question.md b/docs/docs/user_docs/other/question.md
deleted file mode 100644
index 49fd4d77..00000000
--- a/docs/docs/user_docs/other/question.md
+++ /dev/null
@@ -1,246 +0,0 @@
----
-sidebar_position: 3
----
-
-# 问题提问
-
-文档引用自:[提问的智慧](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)
-
-## 在提问之前
-
-在你准备要通过电子邮件、新闻群组或者聊天室提出技术问题前,请先做到以下事情:
-
-1. 尝试在你准备提问的论坛的旧文章中搜索答案。
-2. 尝试上网搜索以找到答案。
-3. 尝试阅读手册以找到答案。
-4. 尝试阅读常见问题文件(FAQ)以找到答案。
-5. 尝试自己检查或试验以找到答案。
-6. 向你身边的强者朋友打听以找到答案。
-7. 如果你是程序开发者,请尝试阅读源代码以找到答案。
-
-当你提出问题的时候,请先表明你已经做了上述的努力;这将有助于树立你并不是一个不劳而获且浪费别人的时间的提问者。如果你能一并表达在做了上述努力的过程中所**学到**的东西会更好,因为我们更乐于回答那些表现出能从答案中学习的人的问题。
-
-## 当你提问时
-
-### 慎选提问的论坛
-小心选择你要提问的场合。如果你做了下述的事情,你很可能被忽略掉或者被看作失败者:
-
-* 在与主题不合的论坛上贴出你的问题。
-* 在探讨进阶技术问题的论坛张贴非常初级的问题;反之亦然。
-* 在太多的不同新闻群组上重复转贴同样的问题(cross-post)。
-* 向既非熟人也没有义务解决你问题的人发送私人电邮。
-
-因此,第一步是找到对的论坛。再说一次,Google 和其它搜索引擎还是你的朋友,用它们来找到与你遭遇到困难的软硬件问题最相关的网站。通常那儿都有常见问题(FAQ)、邮件列表及相关说明文件的链接。如果你的努力(包括**阅读** FAQ)都没有结果,网站上也许还有报告 Bug(Bug-reporting)的流程或链接,如果是这样,链过去看看。
-
-### 使用有意义且描述明确的标题
-
-在邮件列表、新闻群组或论坛中,大约 50 字以内的标题是抓住资深专家注意力的好机会。别用喋喋不休的帮帮忙、跪求、急(更别说救命啊!!!!这样让人反感的话,用这种标题会被条件反射式地忽略)来浪费这个机会。不要妄想用你的痛苦程度来打动我们,而应该是在这点空间中使用极简单扼要的描述方式来提出问题。
-
-一个好标题范例是`目标 —— 差异`式的描述,许多技术支持组织就是这样做的。在`目标`部分指出是哪一个或哪一组东西有问题,在`差异`部分则描述与期望的行为不一致的地方。
-
-> 蠢问题:救命啊!我的笔记本电脑不能正常显示了!
-
-> 聪明问题:X.org 6.8.1 的鼠标指针会变形,某牌显卡 MV1005 芯片组。
-
-> 更聪明问题:X.org 6.8.1 的鼠标指针,在某牌显卡 MV1005 芯片组环境下 - 会变形。
-
-### 使用清晰、正确、精准且合乎语法的语句
-
-我们从经验中发现,粗心的提问者通常也会粗心地写程序与思考(我敢打包票)。回答粗心大意者的问题很不值得,我们宁愿把时间耗在别处。
-
-正确的拼写、标点符号和大小写是很重要的。一般来说,如果你觉得这样做很麻烦,不想在乎这些,那我们也觉得麻烦,不想在乎你的提问。花点额外的精力斟酌一下字句,用不着太僵硬与正式 —— 事实上,黑客文化很看重能准确地使用非正式、俚语和幽默的语句。但它**必须很**准确,而且有迹象表明你是在思考和关注问题。
-
-### 精确地描述问题并言之有物
-
-* 仔细、清楚地描述你的问题或 Bug 的症状。
-* 描述问题发生的环境(机器配置、操作系统、应用程序、以及相关的信息),提供经销商的发行版和版本号(如:`Fedora Core 4`、`Slackware 9.1`等)。
-* 描述在提问前你是怎样去研究和理解这个问题的。
-* 描述在提问前为确定问题而采取的诊断步骤。
-* 描述最近做过什么可能相关的硬件或软件变更。
-* 尽可能地提供一个可以`重现这个问题的可控环境`的方法。
-
-尽量去揣测一个黑客会怎样反问你,在你提问之前预先将黑客们可能提出的问题回答一遍。
-
-以上几点中,当你报告的是你认为可能在代码中的问题时,给黑客一个可以重现你的问题的环境尤其重要。当你这么做时,你得到有效的回答的机会和速度都会大大的提升。
-
-[Simon Tatham](http://www.chiark.greenend.org.uk/~sgtatham/) 写过一篇名为《[如何有效的报告 Bug](http://www.chiark.greenend.org.uk/~sgtatham/bugs-cn.html)》的出色文章。强力推荐你也读一读。
-
-### 话不在多而在精
-
-你需要提供精确有内容的信息。这并不是要求你简单的把成堆的出错代码或者资料完全转录到你的提问中。如果你有庞大而复杂的测试样例能重现程序挂掉的情境,尽量将它剪裁得越小越好。
-
-这样做的用处至少有三点。
-第一,表现出你为简化问题付出了努力,这可以使你得到回答的机会增加;
-第二,简化问题使你更有可能得到**有用**的答案;
-第三,在精炼你的 bug 报告的过程中,你很可能就自己找到了解决方法或权宜之计。
-
-### 别动辄声称找到 Bug
-
-当你在使用软件中遇到问题,除非你非常、**非常**的有根据,不要动辄声称找到了 Bug。提示:除非你能提供解决问题的源代码补丁,或者提供回归测试来表明前一版本中行为不正确,否则你都多半不够完全确信。这同样适用在网页和文件,如果你(声称)发现了文件的`Bug`,你应该能提供相应位置的修正或替代文件。
-
-请记得,还有其他许多用户没遇到你发现的问题,否则你在阅读文件或搜索网页时就应该发现了(你在抱怨前[已经做了这些,是吧](#在提问之前)?)。这也意味着很有可能是你弄错了而不是软件本身有问题。
-
-编写软件的人总是非常辛苦地使它尽可能完美。如果你声称找到了 Bug,也就是在质疑他们的能力,即使你是对的,也有可能会冒犯到其中某部分人。当你在标题中嚷嚷着有`Bug`时,这尤其严重。
-
-提问时,即使你私下非常确信已经发现一个真正的 Bug,最好写得像是**你**做错了什么。如果真的有 Bug,你会在回复中看到这点。这样做的话,如果真有 Bug,维护者就会向你道歉,这总比你惹恼别人然后欠别人一个道歉要好一点。
-
-### 低声下气不能代替你的功课
-
-有些人明白他们不该粗鲁或傲慢的提问并要求得到答复,但他们选择另一个极端 —— 低声下气:`我知道我只是个可悲的新手,一个撸瑟,但...`。这既使人困扰,也没有用,尤其是伴随着与实际问题含糊不清的描述时更令人反感。
-
-别用原始灵长类动物的把戏来浪费你我的时间。取而代之的是,尽可能清楚地描述背景条件和你的问题情况。这比低声下气更好地定位了你的位置。
-
-有时网页论坛会设有专为新手提问的版面,如果你真的认为遇到了初学者的问题,到那去就是了,但一样别那么低声下气。
-
-### 描述问题症状而非你的猜测
-
-告诉黑客们你认为问题是怎样造成的并没什么帮助。(如果你的推断如此有效,还用向别人求助吗?),因此要确信你原原本本告诉了他们问题的症状,而不是你的解释和理论;让黑客们来推测和诊断。如果你认为陈述自己的猜测很重要,清楚地说明这只是你的猜测,并描述为什么它们不起作用。
-
-**蠢问题**
-
-> 我在编译内核时接连遇到 SIG11 错误,
-> 我怀疑某条飞线搭在主板的走线上了,这种情况应该怎样检查最好?
-
-**聪明问题**
-
-> 我的组装电脑是 FIC-PA2007 主机板搭载 AMD K6/233 CPU(威盛 Apollo VP2 芯片组),
-> 256MB Corsair PC133 SDRAM 内存,在编译内核时,从开机 20 分钟以后就频频产生 SIG11 错误,
-> 但是在头 20 分钟内从没发生过相同的问题。重新启动也没有用,但是关机一晚上就又能工作 20 分钟。
-> 所有内存都换过了,没有效果。相关部分的标准编译记录如下…
-
-由于以上这点似乎让许多人觉得难以配合,这里有句话可以提醒你:`所有的诊断专家都来自密苏里州。` 美国国务院的官方座右铭则是:`让我看看`(出自国会议员 Willard D. Vandiver 在 1899 年时的讲话:`我来自一个出产玉米,棉花,牛蒡和民主党人的国家,滔滔雄辩既不能说服我,也不会让我满意。我来自密苏里州,你必须让我看看。`) 针对诊断者而言,这并不是一种怀疑,而只是一种真实而有用的需求,以便让他们看到的是与你看到的原始证据尽可能一致的东西,而不是你的猜测与归纳的结论。所以,大方的展示给我们看吧!
-
-### 按发生时间先后列出问题症状
-
-问题发生前的一系列操作,往往就是对找出问题最有帮助的线索。因此,你的说明里应该包含你的操作步骤,以及机器和软件的反应,直到问题发生。在命令行处理的情况下,提供一段操作记录(例如运行脚本工具所生成的),并引用相关的若干行(如 20 行)记录会非常有帮助。
-
-如果挂掉的程序有诊断选项(如 -v 的详述开关),试着选择这些能在记录中增加调试信息的选项。记住,`多`不等于`好`。试着选取适当的调试级别以便提供有用的信息而不是让读者淹没在垃圾中。
-
-如果你的说明很长(如超过四个段落),在开头简述问题,接下来再按时间顺序详述会有所帮助。这样黑客们在读你的记录时就知道该注意哪些内容了。
-
-### 描述目标而不是过程
-
-如果你想弄清楚如何做某事(而不是报告一个 Bug),在开头就描述你的目标,然后才陈述重现你所卡住的特定步骤。
-
-经常寻求技术帮助的人在心中有个更高层次的目标,而他们在自以为能达到目标的特定道路上被卡住了,然后跑来问该怎么走,但没有意识到这条路本身就有问题。结果要费很大的劲才能搞定。
-
-**蠢问题**
-
-> 我怎样才能从某绘图程序的颜色选择器中取得十六进制的 RGB 值?
-
-**聪明问题**
-
-> 我正试着用替换一幅图片的色码(color table)成自己选定的色码,我现在知道的唯一方法是编辑每个色码区块(table slot),
-> 但却无法从某绘图程序的颜色选择器取得十六进制的 RGB 值。
-
-第二种提问法比较聪明,你可能得到像是```建议采用另一个更合适的工具```的回复。
-
-### 清楚明确的表达你的问题以及需求
-
-漫无边际的提问是近乎无休无止的时间黑洞。最有可能给你有用答案的人通常也正是最忙的人(他们忙是因为要亲自完成大部分工作)。这样的人对无节制的时间黑洞相当厌恶,所以他们也倾向于厌恶那些漫无边际的提问。
-
-如果你明确表述需要回答者做什么(如提供指点、发送一段代码、检查你的补丁、或是其他等等),就最有可能得到有用的答案。因为这会定出一个时间和精力的上限,便于回答者能集中精力来帮你。这么做很棒。
-
-要理解专家们所处的世界,请把专业技能想像为充裕的资源,而回复的时间则是稀缺的资源。你要求他们奉献的时间越少,你越有可能从真正专业而且很忙的专家那里得到解答。
-
-所以,界定一下你的问题,使专家花在辨识你的问题和回答所需要付出的时间减到最少,这技巧对你有用答案相当有帮助 —— 但这技巧通常和简化问题有所区别。因此,问`我想更好地理解 X,可否指点一下哪有好一点说明?`通常比问`你能解释一下 X 吗?`更好。如果你的代码不能运作,通常请别人看看哪里有问题,比要求别人替你改正要明智得多。
-
-### 礼多人不怪,而且有时还很有帮助
-
-彬彬有礼,多用`请`和`谢谢您的关注`,或`谢谢你的关照`。让大家都知道你对他们花时间免费提供帮助心存感激。
-
-坦白说,这一点并没有比使用清晰、正确、精准且合乎语法和避免使用专用格式重要(也不能取而代之)。黑客们一般宁可读有点唐突但技术上鲜明的 Bug 报告,而不是那种有礼但含糊的报告。(如果这点让你不解,记住我们是按问题能教给我们什么来评价问题的价值的)
-
-然而,如果你有一串的问题待解决,客气一点肯定会增加你得到有用回应的机会。
-
-(我们注意到,自从本指南发布后,从资深黑客那里得到的唯一严重缺陷反馈,就是对预先道谢这一条。一些黑客觉得`先谢了`意味着事后就不用再感谢任何人的暗示。我们的建议是要么先说`先谢了`,**然后**事后再对回复者表示感谢,或者换种方式表达感激,譬如用`谢谢你的关注`或`谢谢你的关照`。)
-
-## 不该问的问题
-
-以下是几个经典蠢问题,以及黑客没回答时心中所想的:
-
-问题:[我能在哪找到 X 程序或 X 资源?](#q1)
-
-问题:[我怎样用 X 做 Y?](#q2)
-
-问题:[我的程序/设定/SQL 语句没有用](#q3)
-
-问题:[我的 Windows 电脑有问题,你能帮我吗?](#q4)
-
-问题:[我的程序不会动了,我认为系统工具 X 有问题](#q5)
-
-问题:[我在安装 Linux(或者 X )时有问题,你能帮我吗?](#q6)
-
-问题:[我怎么才能破解 root 帐号/窃取 OP 特权/读别人的邮件呢?](#q7)
-
----
-
-> 问题:我能在哪找到 X 程序或 X 资源?
-
-回答:就在我找到它的地方啊,白痴 —— 搜索引擎的那一头。天哪!难道还有人不会用 [Google](https://www.google.com) 吗?
-
-> 问题:我怎样用 X 做 Y?
-
-回答:如果你想解决的是 Y ,提问时别给出可能并不恰当的方法。这种问题说明提问者不但对 X 完全无知,也对 Y 要解决的问题糊涂,还被特定形势禁锢了思维。最好忽略这种人,等他们把问题搞清楚了再说。
-
-> 问题:我的{程序/设定/SQL 语句}没有用
-
-回答:这不算是问题吧,我对要我问你二十个问题才找得出你真正问题的问题没兴趣 —— 我有更有意思的事要做呢。在看到这类问题的时候,我的反应通常不外如下三种
-
-* 你还有什么要补充的吗?
-* 真糟糕,希望你能搞定。
-* 这关我屁事?
-
-> 问题:我的 Windows 电脑有问题,你能帮我吗?
-
-回答:能啊,扔掉微软的垃圾,换个像 Linux 或 BSD 的开源操作系统吧。
-
-注意:如果程序有官方版 Windows 或者与 Windows 有互动(如 Samba),你**可以**问与 Windows 相关的问题,只是别对问题是由 Windows 操作系统而不是程序本身造成的回复感到惊讶, 因为 Windows 一般来说实在太烂,这种说法通常都是对的。
-
-> 问题:我的程序不会动了,我认为系统工具 X 有问题
-
-回答:你完全有可能是第一个注意到被成千上万用户反复使用的系统调用与函数库文件有明显缺陷的人,更有可能的是你完全没有根据。不同凡响的说法需要不同凡响的证据,当你这样声称时,你必须有清楚而详尽的缺陷说明文件作后盾。
-
-> 问题:我在安装 Linux(或者 X )时有问题,你能帮我吗?
-
-回答:不能,我只有亲自在你的电脑上动手才能找到毛病。还是去找你当地的 Linux 使用群组者寻求实际的指导吧(你能在[这儿](http://www.linux.org/groups/index.html)找到用户群组的清单)。
-
-注意:如果安装问题与某 Linux 的发行版有关,在它的邮件列表、论坛或本地用户群组中提问也许是恰当的。此时,应描述问题的准确细节。在此之前,先用 `Linux` 和**所有**被怀疑的硬件作关键词仔细搜索。
-
-> 问题:我怎么才能破解 root 帐号/窃取 OP 特权/读别人的邮件呢?
-
-回答:想要这样做,说明了你是个卑鄙小人;想找个黑客帮你,说明你是个白痴!
-
-## 好问题与蠢问题
-
-最后,我将透过举一些例子,来说明怎样聪明的提问;同一个问题的两种问法被放在一起,一种是愚蠢的,另一种才是明智的。
-
-**蠢问题**:
-
-> 我从 foo 项目找来的源码没法编译。它怎么这么烂?
-
-他觉得都是别人的错,这个傲慢自大的提问者。
-
-**聪明问题**:
-
-> foo 项目代码在 Nulix 6.2 版下无法编译通过。我读过了 FAQ,但里面没有提到跟 Nulix 有关的问题。这是我编译过程的记录,我有什么做的不对的地方吗?
-
-提问者已经指明了环境,也读过了 FAQ,还列出了错误,并且他没有把问题的责任推到别人头上,他的问题值得被关注。
-
-**蠢问题**:
-
-> 我的主机板有问题了,谁来帮我?
-
-某黑客对这类问题的回答通常是:`好的,还要帮你拍拍背和换尿布吗?`,然后按下删除键。
-
-**聪明问题**:
-
-> 我在 S2464 主机板上试过了 X 、 Y 和 Z ,但没什么作用,我又试了 A 、 B 和 C 。请注意当我尝试 C 时的奇怪现象。显然 florbish 正在 grommicking,但结果出人意料。通常在 Athlon MP 主机板上引起 grommicking 的原因是什么?有谁知道接下来我该做些什么测试才能找出问题?
-
-## 如果得不到回答
-
-如果仍得不到回答,请不要以为我们觉得无法帮助你。有时只是看到你问题的人不知道答案罢了。没有回应不代表你被忽视,虽然不可否认这种差别很难区分。
-
-总的来说,简单的重复张贴问题是个很糟的点子。这将被视为无意义的喧闹。有点耐心,知道你问题答案的人可能生活在不同的时区,可能正在睡觉,也有可能你的问题一开始就没有组织好。
-
-你可以通过其他渠道获得帮助,这些渠道通常更适合初学者的需要。
diff --git a/docs/docs/user_docs/user_guide/_category_.json b/docs/docs/user_docs/user_guide/_category_.json
deleted file mode 100644
index 9c505a51..00000000
--- a/docs/docs/user_docs/user_guide/_category_.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "label": "用户指南",
- "position": 2,
- "link": {
- "type": "generated-index",
- "description": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。"
- }
-}
diff --git a/docs/docs/user_docs/user_guide/frame.md b/docs/docs/user_docs/user_guide/frame.md
deleted file mode 100644
index 5992f735..00000000
--- a/docs/docs/user_docs/user_guide/frame.md
+++ /dev/null
@@ -1,60 +0,0 @@
----
-sidebar_position: 1
----
-
-# 为什么写
-
-[美团线程池文章](https://tech.meituan.com/2020/04/02/java-pooling-pratice-in-meituan.html "美团线程池文章") 介绍中,因为业务对线程池参数没有合理配置,触发过几起生产事故,进而引发了一系列思考。最终决定封装线程池动态参数调整,扩展线程池监控以及消息报警等功能。
-
-在开源平台找了挺多动态线程池项目,从功能性以及健壮性而言,个人感觉不满足企业级应用。
-
-因为对动态线程池比较感兴趣,加上想写一个有意义的项目,所以决定自己来造一个轻量级的轮子。
-
-想给项目起一个简单易记的名字,类似于 Eureka、Nacos、Redis;后和朋友商量,决定命名:**Hippo4j**。
-
-
-
-## 它解决了什么问题
-
-线程池在业务系统应该都有使用到,帮助业务流程提升效率以及管理线程,多数场景应用于大量的异步任务处理。
-
-虽然线程池提供了我们许多便利,但也并非尽善尽美,比如下面这些问题就无法很好解决。
-
-- 线程池随便定义,线程资源过多,造成服务器高负载。
-
-- 线程池参数不易评估,随着业务的并发提升,业务面临出现故障的风险。
-
-- 线程池任务执行时间超过平均执行周期,开发人员无法感知。
-
-- 线程池任务堆积,触发拒绝策略,影响既有业务正常运行。
-
-- 当业务出现超时、熔断等问题时,因为没有监控,无法确定是不是线程池引起。
-
-- 原生线程池不支持运行时变量的传递,比如 MDC 上下文遇到线程池就 GG。
-
-- 无法执行优雅关闭,当项目关闭时,大量正在运行的线程池任务被丢弃。
-
-- 线程池运行中,任务执行停止,怀疑发生死锁或执行耗时操作,但是无从下手。
-
-Hippo4j 很好解决了这些问题,它将业务中所有线程池统一管理,增强原生线程池系列功能。
-
-## 它有什么特性
-
-应用系统中线程池并不容易管理。参考美团的设计,Hippo4j 按照租户、项目、线程池的维度划分。再加上系统权限,让不同的开发、管理人员负责自己系统的线程池操作。
-
-举个例子,小编在一家公司的公共组件团队,团队中负责消息、短链接网关等项目。公共组件是租户,消息或短链接就是项目。
-
-Hippo4j 除去动态修改线程池,还包含实时查看线程池运行时指标、负载报警、配置日志管理等。
-
-- `hippo4j-adapter`:适配对第三方框架中的线程池进行监控,如 Dubbo、RocketMQ、Hystrix 等;
-- `hippo4j-auth`:用户、角色、权限等;
-- `hippo4j-common`:多个模块公用代码实现;
-- `hippo4j-config`:提供线程池准实时参数更新功能;
-- `hippo4j-console`:对接前端控制台;
-- `hippo4j-core`:核心的依赖,包括配置、核心包装类等;
-- `hippo4j-discovery`:提供线程池项目实例注册、续约、下线等功能;
-- `hippo4j-example` :示例工程;
-- `hippo4j-message` :配置变更以及报警通知发送;
-- `hippo4j-monitor` :线程池运行时监控;
-- `hippo4j-server` :Server 端发布需要的模块聚合;
-- `hippo4j-spring-boot`:SpringBoot Starter。
diff --git a/docs/docs/user_docs/user_guide/framework.md b/docs/docs/user_docs/user_guide/framework.md
deleted file mode 100644
index 33e24d1c..00000000
--- a/docs/docs/user_docs/user_guide/framework.md
+++ /dev/null
@@ -1,51 +0,0 @@
----
-sidebar_position: 2
----
-
-# 架构设计
-
-简单来说,Hippo4j 从部署的角度上分为两种角色:Server 端和 Client 端。
-
-Server 端是 Hippo4j 项目打包出的 Java 进程,功能包括用户权限、线程池监控以及执行持久化的动作。
-
-Client 端指的是我们 SpringBoot 应用,通过引入 Hippo4j Starter Jar 包负责与 Server 端进行交互。
-
-比如拉取 Server 端线程池数据、动态更新线程池配置以及采集上报线程池运行时数据等。
-
-## 基础组件
-
-### 配置中心(Config)
-
-配置中心位于 Server 端,它的主要作用是监控 Server 端线程池配置变更,实时通知到 Client 实例执行线程池变更流程。
-
-代码设计基于 Nacos 1.x 版本的 **长轮询以及异步 Servlet 机制** 实现。
-
-### 注册中心(Discovery)
-
-负责管理 Client 端(单机或集群)注册到 Server 端的实例,包括不限于**实例注册、续约、过期剔除** 等操作,代码基于 Eureka 源码实现。
-
-上面的配置中心很容易理解,动态线程池参数变更的根本。但是注册中心是用来做什么的?
-
-注册中心管理 Client 端注册的实例,通过这些实例可以 **实时获取线程池的运行时参数信息**。
-
-目前的设计是如此,不排除后续基于 Discovery 做更多的扩展。
-
-### 控制台(Console)
-
-对接前端项目,包括不限于以下模块管理:
-
-
-
-## 消息通知(Notify)
-
-Hippo4j 内置了很多需要通知的事件,比如:线程池参数变更通知、线程池活跃度报警、拒绝策略执行报警以及阻塞队列容量报警等。
-
-目前 Notify 已经接入了钉钉、企业微信和飞书,后续持续集成邮件、短信等通知渠道;并且,Notify 模块提供了消息事件的 SPI 方案,可以接受三方自定义的推送。
-
-## Hippo4j-Spring-Boot-Starter
-
-熟悉 SpringBoot 的小伙伴对 Starter 应该不会陌生。Hippo4j 提供以 Starter Jar 包的形式嵌套在应用内,负责与 Server 端完成交互。
-
-## 功能架构
-
-
diff --git a/docs/docs/user_docs/user_guide/notify.md b/docs/docs/user_docs/user_guide/notify.md
deleted file mode 100644
index 3373f244..00000000
--- a/docs/docs/user_docs/user_guide/notify.md
+++ /dev/null
@@ -1,74 +0,0 @@
----
-sidebar_position: 4
----
-
-# 通知报警
-
-现阶段已集成钉钉、企业微信、飞书的消息推送,后续会持续接入邮箱、短信和自定义通知渠道。
-
-
-
-**通知平台**
-
-- DING:钉钉平台;
-
-- LARK:飞书平台;
-
-- WECHAT:企业微信。
-
-**通知类型**
-
-- CONFIG:线程池配置变更推送;
-
-- ALARM:线程池运行报警推送。
-
-**Token**
-
-获取 DING、LARK、WECHAT 机器人 Token。
-
-**报警间隔**
-
-- CONFIG 类型通知没有报警间隔;
-
-- ALARM 类型设置报警间隔后,某一节点下的同一线程池指定间隔只会发送一次报警通知。
-
-**接收者**
-
-```tex
-多个接收者使用英文逗号 , 分割 (注意不要有空格)
-DING:填写手机号
-WECHART:填写user_id会以@的消息发给用户,填写姓名则是普通的@,如:龙台
-LARK:填写ou_开头用户唯一标识会以@的消息发给用户,填写手机号则是普通的@
-```
-
-## 钉钉平台
-
-[钉钉创建群机器人](https://www.dingtalk.com/qidian/help-detail-20781541.html)
-
-| 配置变更 | 报警通知 |
-| :---: | :---: |
-|  |  |
-
-添加钉钉机器人后,需在机器人配置自定义关键字,才可发送成功。如下所示:
-
-
-
-:::tip
-如果使用 1.4.3 及以上版本,`警报` 替换为 `告警`。
-:::
-
-## 企业微信
-
-[企业微信创建群机器人](https://open.work.weixin.qq.com/help2/pc/14931?person_id=1&from=homesearch)
-
-| 配置变更 | 报警通知 |
-| :---: | :---: |
-|  |  |
-
-## 飞书平台
-
-[飞书创建群机器人](https://www.feishu.cn/hc/zh-CN/articles/360024984973)
-
-
-
-
diff --git a/docs/docs/user_docs/user_guide/quick-start.md b/docs/docs/user_docs/user_guide/quick-start.md
deleted file mode 100644
index 59c5cdd5..00000000
--- a/docs/docs/user_docs/user_guide/quick-start.md
+++ /dev/null
@@ -1,40 +0,0 @@
----
-sidebar_position: 3
----
-
-# 快速开始
-
-## 服务启动
-
-使用 Docker 运行服务端,默认使用内置 H2 数据库,数据持久化到 Docker 容器存储卷中。
-
-```shell
-docker run -d -p 6691:6691 --name hippo4j-server hippo4j/hippo4j-server
-```
-
-> 如果没有 Docker,可以使用源码编译的方式,启动 [Hippo4j-Server/Hippo4j-Bootstrap](https://github.com/longtai-cn/hippo4j/tree/develop/hippo4j-server/hippo4j-bootstrap) 模块下 ServerApplication 应用类。
-
-启动示例项目,[hippo4j-spring-boot-starter-example](https://github.com/opengoofy/hippo4j/tree/develop/hippo4j-example/hippo4j-spring-boot-starter-example) 模块下 ServerExampleApplication 应用类。
-
-访问 Server 控制台,路径 `http://localhost:6691/index.html`,默认用户名密码:admin / 123456
-
-## 配置变更
-
-访问控制台动态线程池菜单下线程池实例,修改动态线程池相关参数。
-
-
-
-观察 Hippo4j-Example 控制台日志输出,日志输出包括不限于此信息即为成功。
-
-```tex
-2022-09-10 00:23:29.783 INFO 50322 --- [change.config_0] c.h.s.s.c.ServerThreadPoolDynamicRefresh : [message-consume] Dynamic thread pool change parameter.
- corePoolSize: 2 => 4
- maximumPoolSize: 6 => 12
- capacity: 1024 => 2048
- keepAliveTime: 9999 => 9999
- executeTimeOut: 800 => 3000
- rejectedType: SyncPutQueuePolicy => RunsOldestTaskPolicy
- allowCoreThreadTimeOut: true => true
-```
-
-另外,当 Client 集群部署时,可以修改某一个实例,或选择 `全部修改` 按钮,修改所有实例线程池信息。
diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js
deleted file mode 100644
index 48983480..00000000
--- a/docs/docusaurus.config.js
+++ /dev/null
@@ -1,229 +0,0 @@
-// @ts-check
-// Note: type annotations allow type checking and IDEs autocompletion
-
-const lightCodeTheme = require('prism-react-renderer/themes/github');
-const darkCodeTheme = require('prism-react-renderer/themes/dracula');
-
-/** @type {import('@docusaurus/types').Config} */
-const config = {
- title: 'Hippo4j',
- tagline: '动态可观测线程池框架,为业务系统提高线上运行保障能力',
- url: 'https://hippo4j.cn',
- baseUrl: '/',
- onBrokenLinks: 'throw',
- onBrokenMarkdownLinks: 'warn',
- favicon: 'img/hippo4j_favicon.ico',
- // GitHub pages deployment config.
- // If you aren't using GitHub pages, you don't need these.
- organizationName: 'hippo4j', // Usually your GitHub org/user name.
- projectName: 'hippo4j.github.io', // Usually your repo name.
- deploymentBranch: 'main',
-
- // Even if you don't use internalization, you can use this field to set useful
- // metadata like html lang. For example, if your site is Chinese, you may want
- // to replace "en" with "zh-Hans".
- i18n: {
- defaultLocale: 'zh',
- locales: ['en', 'zh'],
- localeConfigs: {
- en: {
- label: 'English',
- direction: 'ltr',
- },
- zh: {
- label: '简体中文',
- direction: 'ltr',
- },
- },
- },
-
- presets: [
- [
- 'classic',
- /** @type {import('@docusaurus/preset-classic').Options} */
- ({
- docs: {
- sidebarPath: require.resolve('./sidebars.js'),
- // Please change this to your repo.
- // Remove this to remove the "edit this page" links.
- // Do not automatically expand the menu
- sidebarCollapsed: true,
- /*editUrl: 'https://github.com/longtai-cn',*/
- },
- blog: {
- showReadingTime: true,
- // Please change this to your repo.
- // Remove this to remove the "edit this page" links.
- editUrl:
- 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
- },
- theme: {
- customCss: require.resolve('./src/css/custom.css'),
- },
- }),
- ],
- ],
-
- plugins: [
- [
- '@docusaurus/plugin-content-docs',
- {
- id: 'community',
- path: 'community',
- routeBasePath: 'community',
- sidebarPath: require.resolve('./sidebarsCommunity.js'),
- },
- ],
- async function myPlugin(context, options) {
- return {
- name: 'docusaurus-tailwindcss',
- configurePostCss(postcssOptions) {
- // Appends TailwindCSS and AutoPrefixer.
- postcssOptions.plugins.push(require('tailwindcss'));
- postcssOptions.plugins.push(require('autoprefixer'));
- return postcssOptions;
- },
- };
- },
- ],
-
- themeConfig:
- /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
- ({
- autoCollapseCategories: true,
- announcementBar: {
- id: 'announcementBar-1', // Increment on change
- content:
- '⭐️ If you like hippo4j, give it a star on GitHub ⭐️',
- backgroundColor: '#fafbfc',
- textColor: '#091E42',
- isCloseable: false,
- },
- navbar: {
- title: '',
- logo: {
- alt: 'Hippo4j 动态可观测线程池框架',
- src: 'img/hippo4j.png',
- },
- items: [
- {
- type: 'docSidebar',
- docId: 'intro',
- position: 'left',
- sidebarId: 'user_docs',
- label: '文档',
- },
- {
- to: '/community/contributor-guide',
- label: '社区',
- position: 'left',
- activeBaseRegex: `/community/`,
- },
- /*{ to: "/team", label: "团队", position: "left" },*/
- { to: '/users', label: '采用公司', position: 'left' },
- { to: '/group', label: '加群沟通', position: 'left' },
- /*{to: '/blog', label: '博客', position: 'left'},*/
- {
- href: 'http://console.hippo4j.cn/index.html',
- label: '控制台样例',
- position: 'left',
- },
- {
- href: 'https://nageoffer.com',
- label: '🚀 拿个offer',
- position: 'left',
- },
- {
- type: 'docsVersionDropdown',
- position: 'right',
- dropdownActiveClassDisabled: true,
- },
-
- { type: 'localeDropdown', position: 'right' },
- /*{
- href: 'https://gitee.com/mabaiwancn/hippo4j',
- label: 'Gitee',
- position: 'right',
- },*/
- {
- href: 'https://github.com/opengoofy/hippo4j',
- className: 'header-github-link',
- 'aria-label': 'GitHub repository',
- position: 'right',
- },
-
- /*{
- href: 'https://github.com/opengoofy/hippo4j',
- label: 'GitHub',
- position: 'right',
- },*/
- ],
- },
- footer: {
- style: 'dark',
- links: [
- {
- title: 'Docs',
- items: [
- {
- label: 'Intro',
- to: '/docs/user_docs/intro',
- },
- {
- label: 'Config Mode',
- to: '/docs/user_docs/getting_started/config/hippo4j-config-start',
- },
- {
- label: 'Server Mode',
- to: '/docs/user_docs/getting_started/server/hippo4j-server-start',
- },
- ],
- },
- {
- title: 'Community',
- items: [
- {
- label: 'Group',
- href: 'http://hippo4j.cn/group',
- },
- {
- label: 'WeChat',
- href: 'https://mp.weixin.qq.com/s/diVHYvwiuYH9aWpZDPc27g',
- },
- ],
- },
- {
- title: 'More',
- items: [
- {
- label: 'Gitee',
- href: 'https://gitee.com/opengoofy/hippo4j',
- },
- {
- label: 'GitHub',
- href: 'https://github.com/opengoofy/hippo4j',
- },
- ],
- },
- {
- title: 'Links',
- items: [
- {
- label: '推广合作',
- href: 'http://hippo4j.cn/docs/user_docs/other/operation',
- },
- ],
- },
- ],
- copyright: `Copyright © 2021-2023 马丁版权所有 京ICP备2021038095号
- `,
- },
- prism: {
- theme: lightCodeTheme,
- darkTheme: darkCodeTheme,
- additionalLanguages: ['java'],
- },
- }),
-};
-
-module.exports = config;
diff --git a/docs/i18n/en/code.json b/docs/i18n/en/code.json
deleted file mode 100644
index d2da7eee..00000000
--- a/docs/i18n/en/code.json
+++ /dev/null
@@ -1,297 +0,0 @@
-{
- "homepage.titleDescription1": {
- "message": "Thread Pool Framework For Java",
- "description": "The homepage title description"
- },
- "homepage.titleDescription2": {
- "message": "Enhancing the Operational Assurance Capability for Business Systems Online.",
- "description": "The homepage title description"
- },
- "homepage.startButton": {
- "message": "Quick Start",
- "description": "The homepage start button text"
- },
- "homepage.secondTitle": {
- "message": "What can Hippo4j do?",
- "description": "a title for introduciton part"
- },
- "homepage.introduction.fristPartTitle": {
- "message": "Dynamic Change",
- "description": "the title for the first introduction part"
- },
- "homepage.introduction.fristPartDesc": {
- "message": "Application runtime dynamically changes thread pool parameters, including but not limited to core size, maximum threads, blocking queue size, and rejection policy. It supports differentiated thread pool configurations for different nodes in the application cluster.",
- "description": "the desc for the first introduction part"
- },
- "homepage.introduction.secondPartTitle": {
- "message": "Custom Alarm",
- "description": "the title for the second introduction part"
- },
- "homepage.introduction.secondPartDesc": {
- "message": "Application thread pool runtime point, providing four alarm dimensions: thread pool overload, blocking queue capacity, running for too long, and rejection strategy alarm. It also supports non-repetitive alarms within a custom time period.",
- "description": "the desc for the second introduction part"
- },
- "homepage.introduction.thirdPartTitle": {
- "message": "Operation Monitoring",
- "description": "the title for the third introduction part"
- },
- "homepage.introduction.thirdPartDesc": {
- "message": "Supports custom duration thread pool for data collection and storage, while also supporting Prometheus, InfluxDB, and other monitoring systems. Provides visualized dashboard monitoring metrics through Grafana or built-in monitoring pages.",
- "description": "the desc for the third introduction part"
- },
- "theme.ErrorPageContent.title": {
- "message": "This page crashed.",
- "description": "The title of the fallback page when the page crashed"
- },
- "theme.ErrorPageContent.tryAgain": {
- "message": "Try again",
- "description": "The label of the button to try again when the page crashed"
- },
- "theme.NotFound.title": {
- "message": "Page Not Found",
- "description": "The title of the 404 page"
- },
- "theme.NotFound.p1": {
- "message": "We could not find what you were looking for.",
- "description": "The first paragraph of the 404 page"
- },
- "theme.NotFound.p2": {
- "message": "Please contact the owner of the site that linked you to the original URL and let them know their link is broken.",
- "description": "The 2nd paragraph of the 404 page"
- },
- "theme.blog.archive.title": {
- "message": "Archive",
- "description": "The page & hero title of the blog archive page"
- },
- "theme.blog.archive.description": {
- "message": "Archive",
- "description": "The page & hero description of the blog archive page"
- },
- "theme.blog.paginator.navAriaLabel": {
- "message": "Blog list page navigation",
- "description": "The ARIA label for the blog pagination"
- },
- "theme.blog.paginator.newerEntries": {
- "message": "Newer Entries",
- "description": "The label used to navigate to the newer blog posts page (previous page)"
- },
- "theme.blog.paginator.olderEntries": {
- "message": "Older Entries",
- "description": "The label used to navigate to the older blog posts page (next page)"
- },
- "theme.admonition.note": {
- "message": "note",
- "description": "The default label used for the Note admonition (:::note)"
- },
- "theme.admonition.tip": {
- "message": "tip",
- "description": "The default label used for the Tip admonition (:::tip)"
- },
- "theme.admonition.danger": {
- "message": "danger",
- "description": "The default label used for the Danger admonition (:::danger)"
- },
- "theme.admonition.info": {
- "message": "info",
- "description": "The default label used for the Info admonition (:::info)"
- },
- "theme.admonition.caution": {
- "message": "caution",
- "description": "The default label used for the Caution admonition (:::caution)"
- },
- "theme.BackToTopButton.buttonAriaLabel": {
- "message": "Scroll back to top",
- "description": "The ARIA label for the back to top button"
- },
- "theme.blog.post.paginator.navAriaLabel": {
- "message": "Blog post page navigation",
- "description": "The ARIA label for the blog posts pagination"
- },
- "theme.blog.post.paginator.newerPost": {
- "message": "Newer Post",
- "description": "The blog post button label to navigate to the newer/previous post"
- },
- "theme.blog.post.paginator.olderPost": {
- "message": "Older Post",
- "description": "The blog post button label to navigate to the older/next post"
- },
- "theme.blog.post.plurals": {
- "message": "One post|{count} posts",
- "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
- },
- "theme.blog.tagTitle": {
- "message": "{nPosts} tagged with \"{tagName}\"",
- "description": "The title of the page for a blog tag"
- },
- "theme.tags.tagsPageLink": {
- "message": "View All Tags",
- "description": "The label of the link targeting the tag list page"
- },
- "theme.colorToggle.ariaLabel": {
- "message": "Switch between dark and light mode (currently {mode})",
- "description": "The ARIA label for the navbar color mode toggle"
- },
- "theme.colorToggle.ariaLabel.mode.dark": {
- "message": "dark mode",
- "description": "The name for the dark color mode"
- },
- "theme.colorToggle.ariaLabel.mode.light": {
- "message": "light mode",
- "description": "The name for the light color mode"
- },
- "theme.docs.breadcrumbs.home": {
- "message": "Home page",
- "description": "The ARIA label for the home page in the breadcrumbs"
- },
- "theme.docs.breadcrumbs.navAriaLabel": {
- "message": "Breadcrumbs",
- "description": "The ARIA label for the breadcrumbs"
- },
- "theme.docs.DocCard.categoryDescription": {
- "message": "{count} items",
- "description": "The default description for a category card in the generated index about how many items this category includes"
- },
- "theme.docs.paginator.navAriaLabel": {
- "message": "Docs pages navigation",
- "description": "The ARIA label for the docs pagination"
- },
- "theme.docs.paginator.previous": {
- "message": "Previous",
- "description": "The label used to navigate to the previous doc"
- },
- "theme.docs.paginator.next": {
- "message": "Next",
- "description": "The label used to navigate to the next doc"
- },
- "theme.docs.tagDocListPageTitle.nDocsTagged": {
- "message": "One doc tagged|{count} docs tagged",
- "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
- },
- "theme.docs.tagDocListPageTitle": {
- "message": "{nDocsTagged} with \"{tagName}\"",
- "description": "The title of the page for a docs tag"
- },
- "theme.docs.versionBadge.label": {
- "message": "Version: {versionLabel}"
- },
- "theme.docs.versions.unreleasedVersionLabel": {
- "message": "This is unreleased documentation for {siteTitle} {versionLabel} version.",
- "description": "The label used to tell the user that he's browsing an unreleased doc version"
- },
- "theme.docs.versions.unmaintainedVersionLabel": {
- "message": "This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.",
- "description": "The label used to tell the user that he's browsing an unmaintained doc version"
- },
- "theme.docs.versions.latestVersionSuggestionLabel": {
- "message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).",
- "description": "The label used to tell the user to check the latest version"
- },
- "theme.docs.versions.latestVersionLinkLabel": {
- "message": "latest version",
- "description": "The label used for the latest version suggestion link label"
- },
- "theme.common.editThisPage": {
- "message": "Edit this page",
- "description": "The link label to edit the current page"
- },
- "theme.common.headingLinkTitle": {
- "message": "Direct link to heading",
- "description": "Title for link to heading"
- },
- "theme.lastUpdated.atDate": {
- "message": " on {date}",
- "description": "The words used to describe on which date a page has been last updated"
- },
- "theme.lastUpdated.byUser": {
- "message": " by {user}",
- "description": "The words used to describe by who the page has been last updated"
- },
- "theme.lastUpdated.lastUpdatedAtBy": {
- "message": "Last updated{atDate}{byUser}",
- "description": "The sentence used to display when a page has been last updated, and by who"
- },
- "theme.navbar.mobileVersionsDropdown.label": {
- "message": "Versions",
- "description": "The label for the navbar versions dropdown on mobile view"
- },
- "theme.common.skipToMainContent": {
- "message": "Skip to main content",
- "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation"
- },
- "theme.tags.tagsListLabel": {
- "message": "Tags:",
- "description": "The label alongside a tag list"
- },
- "theme.AnnouncementBar.closeButtonAriaLabel": {
- "message": "Close",
- "description": "The ARIA label for close button of announcement bar"
- },
- "theme.blog.sidebar.navAriaLabel": {
- "message": "Blog recent posts navigation",
- "description": "The ARIA label for recent posts in the blog sidebar"
- },
- "theme.CodeBlock.copied": {
- "message": "Copied",
- "description": "The copied button label on code blocks"
- },
- "theme.CodeBlock.copyButtonAriaLabel": {
- "message": "Copy code to clipboard",
- "description": "The ARIA label for copy code blocks button"
- },
- "theme.CodeBlock.copy": {
- "message": "Copy",
- "description": "The copy button label on code blocks"
- },
- "theme.CodeBlock.wordWrapToggle": {
- "message": "Toggle word wrap",
- "description": "The title attribute for toggle word wrapping button of code block lines"
- },
- "theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
- "message": "Toggle the collapsible sidebar category '{label}'",
- "description": "The ARIA label to toggle the collapsible sidebar category"
- },
- "theme.navbar.mobileLanguageDropdown.label": {
- "message": "Languages",
- "description": "The label for the mobile language switcher dropdown"
- },
- "theme.TOCCollapsible.toggleButtonLabel": {
- "message": "On this page",
- "description": "The label used by the button on the collapsible TOC component"
- },
- "theme.blog.post.readMore": {
- "message": "Read More",
- "description": "The label used in blog post item excerpts to link to full blog posts"
- },
- "theme.blog.post.readMoreLabel": {
- "message": "Read more about {title}",
- "description": "The ARIA label for the link to full blog posts from excerpts"
- },
- "theme.blog.post.readingTime.plurals": {
- "message": "One min read|{readingTime} min read",
- "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
- },
- "theme.docs.sidebar.collapseButtonTitle": {
- "message": "Collapse sidebar",
- "description": "The title attribute for collapse button of doc sidebar"
- },
- "theme.docs.sidebar.collapseButtonAriaLabel": {
- "message": "Collapse sidebar",
- "description": "The title attribute for collapse button of doc sidebar"
- },
- "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": {
- "message": "← Back to main menu",
- "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"
- },
- "theme.docs.sidebar.expandButtonTitle": {
- "message": "Expand sidebar",
- "description": "The ARIA label and title attribute for expand button of doc sidebar"
- },
- "theme.docs.sidebar.expandButtonAriaLabel": {
- "message": "Expand sidebar",
- "description": "The ARIA label and title attribute for expand button of doc sidebar"
- },
- "theme.tags.tagsPageTitle": {
- "message": "Tags",
- "description": "The title of the tag list page"
- }
-}
diff --git a/docs/i18n/en/docusaurus-plugin-content-blog/options.json b/docs/i18n/en/docusaurus-plugin-content-blog/options.json
deleted file mode 100644
index 9239ff70..00000000
--- a/docs/i18n/en/docusaurus-plugin-content-blog/options.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "title": {
- "message": "Blog",
- "description": "The title for the blog used in SEO"
- },
- "description": {
- "message": "Blog",
- "description": "The description for the blog used in SEO"
- },
- "sidebar.title": {
- "message": "Recent posts",
- "description": "The label for the left sidebar"
- }
-}
diff --git a/docs/i18n/en/docusaurus-plugin-content-docs-community/current.json b/docs/i18n/en/docusaurus-plugin-content-docs-community/current.json
deleted file mode 100644
index 647c4069..00000000
--- a/docs/i18n/en/docusaurus-plugin-content-docs-community/current.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "version.label": {
- "message": "Next",
- "description": "The label for version current"
- },
- "sidebar.community.category.贡献规约": {
- "message": "贡献规约",
- "description": "The label for category 贡献规约 in sidebar community"
- }
-}
diff --git a/docs/i18n/en/docusaurus-plugin-content-docs/current.json b/docs/i18n/en/docusaurus-plugin-content-docs/current.json
deleted file mode 100644
index 780bc3c9..00000000
--- a/docs/i18n/en/docusaurus-plugin-content-docs/current.json
+++ /dev/null
@@ -1,82 +0,0 @@
-{
- "version.label": {
- "message": "Next",
- "description": "The label for version current"
- },
- "sidebar.tutorialSidebar.category.user_docs": {
- "message": "user_docs",
- "description": "The label for category user_docs in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar tutorialSidebar"
- },
- "sidebar.user_docs.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar user_docs"
- },
- "sidebar.user_docs.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar user_docs"
- },
- "sidebar.user_docs.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar user_docs"
- },
- "sidebar.user_docs.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar user_docs"
- }
-}
diff --git a/docs/i18n/en/docusaurus-plugin-content-docs/version-1.4.2.json b/docs/i18n/en/docusaurus-plugin-content-docs/version-1.4.2.json
deleted file mode 100644
index 4393497b..00000000
--- a/docs/i18n/en/docusaurus-plugin-content-docs/version-1.4.2.json
+++ /dev/null
@@ -1,82 +0,0 @@
-{
- "version.label": {
- "message": "1.4.2",
- "description": "The label for version 1.4.2"
- },
- "sidebar.tutorialSidebar.category.user_docs": {
- "message": "user_docs",
- "description": "The label for category user_docs in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar tutorialSidebar"
- },
- "sidebar.user_docs.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar user_docs"
- },
- "sidebar.user_docs.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar user_docs"
- },
- "sidebar.user_docs.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar user_docs"
- },
- "sidebar.user_docs.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar user_docs"
- }
-}
diff --git a/docs/i18n/en/docusaurus-plugin-content-docs/version-1.4.3.json b/docs/i18n/en/docusaurus-plugin-content-docs/version-1.4.3.json
deleted file mode 100644
index a395bb56..00000000
--- a/docs/i18n/en/docusaurus-plugin-content-docs/version-1.4.3.json
+++ /dev/null
@@ -1,82 +0,0 @@
-{
- "version.label": {
- "message": "1.4.3",
- "description": "The label for version 1.4.3"
- },
- "sidebar.tutorialSidebar.category.user_docs": {
- "message": "user_docs",
- "description": "The label for category user_docs in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar tutorialSidebar"
- },
- "sidebar.user_docs.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar user_docs"
- },
- "sidebar.user_docs.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar user_docs"
- },
- "sidebar.user_docs.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar user_docs"
- },
- "sidebar.user_docs.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar user_docs"
- }
-}
diff --git a/docs/i18n/en/docusaurus-plugin-content-docs/version-1.5.0.json b/docs/i18n/en/docusaurus-plugin-content-docs/version-1.5.0.json
deleted file mode 100644
index 13116144..00000000
--- a/docs/i18n/en/docusaurus-plugin-content-docs/version-1.5.0.json
+++ /dev/null
@@ -1,82 +0,0 @@
-{
- "version.label": {
- "message": "1.5.0",
- "description": "The label for version 1.5.0"
- },
- "sidebar.tutorialSidebar.category.user_docs": {
- "message": "user_docs",
- "description": "The label for category user_docs in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar tutorialSidebar"
- },
- "sidebar.user_docs.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar user_docs"
- },
- "sidebar.user_docs.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar user_docs"
- },
- "sidebar.user_docs.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar user_docs"
- },
- "sidebar.user_docs.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar user_docs"
- }
-}
diff --git a/docs/i18n/en/docusaurus-theme-classic/footer.json b/docs/i18n/en/docusaurus-theme-classic/footer.json
deleted file mode 100644
index d4f9ae14..00000000
--- a/docs/i18n/en/docusaurus-theme-classic/footer.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "link.title.Docs": {
- "message": "Docs",
- "description": "The title of the footer links column with title=Docs in the footer"
- },
- "link.title.Community": {
- "message": "Community",
- "description": "The title of the footer links column with title=Community in the footer"
- },
- "link.title.More": {
- "message": "More",
- "description": "The title of the footer links column with title=More in the footer"
- },
- "link.title.Links": {
- "message": "Links",
- "description": "The title of the footer links column with title=Links in the footer"
- },
- "link.item.label.Intro": {
- "message": "Intro",
- "description": "The label of footer link with label=Intro linking to /docs/user_docs/intro"
- },
- "link.item.label.Config Mode": {
- "message": "Config Mode",
- "description": "The label of footer link with label=Config Mode linking to /docs/user_docs/getting_started/config/hippo4j-config-start"
- },
- "link.item.label.Server Mode": {
- "message": "Server Mode",
- "description": "The label of footer link with label=Server Mode linking to /docs/user_docs/getting_started/server/hippo4j-server-start"
- },
- "link.item.label.Group": {
- "message": "Group",
- "description": "The label of footer link with label=Group linking to http://hippo4j.cn/group"
- },
- "link.item.label.WeChat": {
- "message": "WeChat",
- "description": "The label of footer link with label=WeChat linking to https://mp.weixin.qq.com/s/diVHYvwiuYH9aWpZDPc27g"
- },
- "link.item.label.Gitee": {
- "message": "Gitee",
- "description": "The label of footer link with label=Gitee linking to https://gitee.com/opengoofy/hippo4j"
- },
- "link.item.label.GitHub": {
- "message": "GitHub",
- "description": "The label of footer link with label=GitHub linking to https://github.com/opengoofy/hippo4j"
- },
- "link.item.label.推广合作": {
- "message": "推广合作",
- "description": "The label of footer link with label=推广合作 linking to http://hippo4j.cn/docs/user_docs/other/operation"
- },
- "copyright": {
- "message": "Copyright © 2021-2023 马丁版权所有 京ICP备2021038095号\n ",
- "description": "The footer copyright"
- }
-}
diff --git a/docs/i18n/en/docusaurus-theme-classic/navbar.json b/docs/i18n/en/docusaurus-theme-classic/navbar.json
deleted file mode 100644
index d746aabf..00000000
--- a/docs/i18n/en/docusaurus-theme-classic/navbar.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "item.label.文档": {
- "message": "Docs",
- "description": "Navbar item with label 文档"
- },
- "item.label.社区": {
- "message": "Community",
- "description": "Navbar item with label 社区"
- },
- "item.label.采用公司": {
- "message": "Users",
- "description": "Navbar item with label 采用公司"
- },
- "item.label.加群沟通": {
- "message": "Communication",
- "description": "Navbar item with label 加群沟通"
- },
- "item.label.控制台样例": {
- "message": "Example",
- "description": "Navbar item with label 控制台样例"
- },
- "item.label.🚀 拿个offer": {
- "message": "🚀 GetOffer",
- "description": "Navbar item with label 🚀 拿个offer"
- }
-}
diff --git a/docs/i18n/zh/code.json b/docs/i18n/zh/code.json
deleted file mode 100644
index d52a7d77..00000000
--- a/docs/i18n/zh/code.json
+++ /dev/null
@@ -1,364 +0,0 @@
-{
- "theme.ErrorPageContent.title": {
- "message": "页面已崩溃。",
- "description": "The title of the fallback page when the page crashed"
- },
- "theme.ErrorPageContent.tryAgain": {
- "message": "重试",
- "description": "The label of the button to try again when the page crashed"
- },
- "theme.NotFound.title": {
- "message": "找不到页面",
- "description": "The title of the 404 page"
- },
- "theme.NotFound.p1": {
- "message": "我们找不到您要找的页面。",
- "description": "The first paragraph of the 404 page"
- },
- "theme.NotFound.p2": {
- "message": "请联系原始链接来源网站的所有者,并告知他们链接已损坏。",
- "description": "The 2nd paragraph of the 404 page"
- },
- "theme.admonition.note": {
- "message": "备注",
- "description": "The default label used for the Note admonition (:::note)"
- },
- "theme.admonition.tip": {
- "message": "提示",
- "description": "The default label used for the Tip admonition (:::tip)"
- },
- "theme.admonition.danger": {
- "message": "危险",
- "description": "The default label used for the Danger admonition (:::danger)"
- },
- "theme.admonition.info": {
- "message": "信息",
- "description": "The default label used for the Info admonition (:::info)"
- },
- "theme.admonition.caution": {
- "message": "警告",
- "description": "The default label used for the Caution admonition (:::caution)"
- },
- "theme.BackToTopButton.buttonAriaLabel": {
- "message": "回到顶部",
- "description": "The ARIA label for the back to top button"
- },
- "theme.blog.paginator.navAriaLabel": {
- "message": "博文列表分页导航",
- "description": "The ARIA label for the blog pagination"
- },
- "theme.blog.paginator.newerEntries": {
- "message": "较新的博文",
- "description": "The label used to navigate to the newer blog posts page (previous page)"
- },
- "theme.blog.paginator.olderEntries": {
- "message": "较旧的博文",
- "description": "The label used to navigate to the older blog posts page (next page)"
- },
- "theme.blog.archive.title": {
- "message": "历史博文",
- "description": "The page & hero title of the blog archive page"
- },
- "theme.blog.archive.description": {
- "message": "历史博文",
- "description": "The page & hero description of the blog archive page"
- },
- "theme.blog.post.paginator.navAriaLabel": {
- "message": "博文分页导航",
- "description": "The ARIA label for the blog posts pagination"
- },
- "theme.blog.post.paginator.newerPost": {
- "message": "较新一篇",
- "description": "The blog post button label to navigate to the newer/previous post"
- },
- "theme.blog.post.paginator.olderPost": {
- "message": "较旧一篇",
- "description": "The blog post button label to navigate to the older/next post"
- },
- "theme.colorToggle.ariaLabel": {
- "message": "切换浅色/暗黑模式(当前为{mode})",
- "description": "The ARIA label for the navbar color mode toggle"
- },
- "theme.colorToggle.ariaLabel.mode.dark": {
- "message": "暗黑模式",
- "description": "The name for the dark color mode"
- },
- "theme.colorToggle.ariaLabel.mode.light": {
- "message": "浅色模式",
- "description": "The name for the light color mode"
- },
- "theme.blog.post.plurals": {
- "message": "{count} 篇博文",
- "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
- },
- "theme.blog.tagTitle": {
- "message": "{nPosts} 含有标签「{tagName}」",
- "description": "The title of the page for a blog tag"
- },
- "theme.tags.tagsPageLink": {
- "message": "查看所有标签",
- "description": "The label of the link targeting the tag list page"
- },
- "theme.docs.breadcrumbs.home": {
- "message": "主页面",
- "description": "The ARIA label for the home page in the breadcrumbs"
- },
- "theme.docs.breadcrumbs.navAriaLabel": {
- "message": "页面路径",
- "description": "The ARIA label for the breadcrumbs"
- },
- "theme.docs.DocCard.categoryDescription": {
- "message": "{count} 个项目",
- "description": "The default description for a category card in the generated index about how many items this category includes"
- },
- "theme.docs.paginator.navAriaLabel": {
- "message": "文档分页导航",
- "description": "The ARIA label for the docs pagination"
- },
- "theme.docs.paginator.previous": {
- "message": "上一页",
- "description": "The label used to navigate to the previous doc"
- },
- "theme.docs.paginator.next": {
- "message": "下一页",
- "description": "The label used to navigate to the next doc"
- },
- "theme.docs.tagDocListPageTitle.nDocsTagged": {
- "message": "{count} 篇文档带有标签",
- "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
- },
- "theme.docs.tagDocListPageTitle": {
- "message": "{nDocsTagged}「{tagName}」",
- "description": "The title of the page for a docs tag"
- },
- "theme.docs.versionBadge.label": {
- "message": "版本:{versionLabel}"
- },
- "theme.docs.versions.unreleasedVersionLabel": {
- "message": "此为 {siteTitle} {versionLabel} 版尚未发行的文档。",
- "description": "The label used to tell the user that he's browsing an unreleased doc version"
- },
- "theme.docs.versions.unmaintainedVersionLabel": {
- "message": "此为 {siteTitle} {versionLabel} 版的文档,现已不再积极维护。",
- "description": "The label used to tell the user that he's browsing an unmaintained doc version"
- },
- "theme.docs.versions.latestVersionSuggestionLabel": {
- "message": "最新的文档请参阅 {latestVersionLink} ({versionLabel})。",
- "description": "The label used to tell the user to check the latest version"
- },
- "theme.docs.versions.latestVersionLinkLabel": {
- "message": "最新版本",
- "description": "The label used for the latest version suggestion link label"
- },
- "theme.common.editThisPage": {
- "message": "编辑此页",
- "description": "The link label to edit the current page"
- },
- "theme.common.headingLinkTitle": {
- "message": "标题的直接链接",
- "description": "Title for link to heading"
- },
- "theme.lastUpdated.atDate": {
- "message": "于 {date} ",
- "description": "The words used to describe on which date a page has been last updated"
- },
- "theme.lastUpdated.byUser": {
- "message": "由 {user} ",
- "description": "The words used to describe by who the page has been last updated"
- },
- "theme.lastUpdated.lastUpdatedAtBy": {
- "message": "最后{byUser}{atDate}更新",
- "description": "The sentence used to display when a page has been last updated, and by who"
- },
- "theme.navbar.mobileVersionsDropdown.label": {
- "message": "选择版本",
- "description": "The label for the navbar versions dropdown on mobile view"
- },
- "theme.common.skipToMainContent": {
- "message": "跳到主要内容",
- "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation"
- },
- "theme.tags.tagsListLabel": {
- "message": "标签:",
- "description": "The label alongside a tag list"
- },
- "theme.AnnouncementBar.closeButtonAriaLabel": {
- "message": "关闭",
- "description": "The ARIA label for close button of announcement bar"
- },
- "theme.blog.sidebar.navAriaLabel": {
- "message": "最近博文导航",
- "description": "The ARIA label for recent posts in the blog sidebar"
- },
- "theme.CodeBlock.copied": {
- "message": "复制成功",
- "description": "The copied button label on code blocks"
- },
- "theme.CodeBlock.copyButtonAriaLabel": {
- "message": "复制代码到剪贴板",
- "description": "The ARIA label for copy code blocks button"
- },
- "theme.CodeBlock.copy": {
- "message": "复制",
- "description": "The copy button label on code blocks"
- },
- "theme.CodeBlock.wordWrapToggle": {
- "message": "切换自动换行",
- "description": "The title attribute for toggle word wrapping button of code block lines"
- },
- "theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
- "message": "打开/收起侧边栏菜单「{label}」",
- "description": "The ARIA label to toggle the collapsible sidebar category"
- },
- "theme.navbar.mobileLanguageDropdown.label": {
- "message": "选择语言",
- "description": "The label for the mobile language switcher dropdown"
- },
- "theme.TOCCollapsible.toggleButtonLabel": {
- "message": "本页总览",
- "description": "The label used by the button on the collapsible TOC component"
- },
- "theme.docs.sidebar.collapseButtonTitle": {
- "message": "收起侧边栏",
- "description": "The title attribute for collapse button of doc sidebar"
- },
- "theme.docs.sidebar.collapseButtonAriaLabel": {
- "message": "收起侧边栏",
- "description": "The title attribute for collapse button of doc sidebar"
- },
- "theme.blog.post.readingTime.plurals": {
- "message": "阅读需 {readingTime} 分钟",
- "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
- },
- "theme.blog.post.readMore": {
- "message": "阅读更多",
- "description": "The label used in blog post item excerpts to link to full blog posts"
- },
- "theme.blog.post.readMoreLabel": {
- "message": "阅读 {title} 的全文",
- "description": "The ARIA label for the link to full blog posts from excerpts"
- },
- "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": {
- "message": "← 回到主菜单",
- "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"
- },
- "theme.docs.sidebar.expandButtonTitle": {
- "message": "展开侧边栏",
- "description": "The ARIA label and title attribute for expand button of doc sidebar"
- },
- "theme.docs.sidebar.expandButtonAriaLabel": {
- "message": "展开侧边栏",
- "description": "The ARIA label and title attribute for expand button of doc sidebar"
- },
- "theme.tags.tagsPageTitle": {
- "message": "标签",
- "description": "The title of the tag list page"
- },
- "Community": {
- "message": "社区"
- },
- "homepage.titleDescription1": {
- "message": "Java线程池框架",
- "description": "The homepage title description"
- },
- "homepage.titleDescription2": {
- "message": "动态可观测Java线程池框架,为你的业务系统提高线上运行保障能力",
- "description": "The homepage title description"
- },
- "homepage.startButton": {
- "message": "快速开始",
- "description": "The homepage start button text"
- },
- "homepage.secondTitle": {
- "message": "Hippo4j能做什么?",
- "description": "The title for the introduction part"
- },
- "homepage.introduction.fristPartTitle": {
- "message": "动态变更",
- "description": "the title for the first introduction part"
- },
- "homepage.introduction.fristPartDesc": {
- "message": "应用运行时动态变更线程池参数,包括不限于核心、最大线程、阻塞队列大小和拒绝策略等,支持应用集群下不同节点线程池配置差异化",
- "description": "the desc for the first introduction part"
- },
- "homepage.introduction.secondPartTitle": {
- "message": "自定义报警",
- "description": "the title for the second introduction part"
- },
- "homepage.introduction.secondPartDesc": {
- "message": "应用线程池运行时埋点,提供四种报警维度,线程池过载、阻塞队列容量、运行超长以及拒绝策略报警,并支持自定义时间内不重复报警",
- "description": "the desc for the second introduction part"
- },
- "homepage.introduction.thirdPartTitle": {
- "message": "运行监控",
- "description": "the title for the third introduction part"
- },
- "homepage.introduction.thirdPartDesc": {
- "message": "支持自定义时长线程池运行数据采集存储,同时也支持 Prometheus、InfluxDB 等采集监控,通过 Grafana 或内置监控页面提供可视化大屏监控运行指标",
- "description": "the desc for the third introduction part"
- },
- "companyPage.title": {
- "message": "谁在使用 Hippo4j ?",
- "description": "the title for the company page"
- },
- "companyPage.descriptionText": {
- "message": "非常感谢大家对 Hippo4j 的关注和支持,这是我们前进最大的动力。",
- "description": "the description for the company page"
- },
- "companyPage.questionText": {
- "message": "正在使用Hippo4j ?",
- "description": "the text for the company question"
- },
- "companyPage.linkText": {
- "message": "点击进行登记",
- "description": "the text for the company page link"
- },
- "homepage.introduction.fristPartDesc1": {
- "message": "应用程序运行时动态更改线程池参数。",
- "description": "The first desc for fristPart "
- },
- "homepage.introduction.fristPartDesc2": {
- "message": "包括但不限于核心大小、最大线程数、阻塞队列大小和拒绝策略。",
- "description": "The second desc for fristPart "
- },
- "homepage.introduction.fristPartDesc3": {
- "message": "支持应用集群中不同节点的差异化线程池配置。",
- "description": "The third desc for fristPart "
- },
- "homepage.introduction.secondPartDesc1": {
- "message": "应用程序线程池运行时点,提供四个告警维度,并支持自定义时间内不重复报警。",
- "description": "The first desc for secondPart "
- },
- "homepage.introduction.secondPartDesc2": {
- "message": "线程池超载,阻塞队列容量,运行时间过长以及拒绝策略警报。",
- "description": "The second desc for secondPart "
- },
- "homepage.introduction.secondPartDesc3": {
- "message": "它还支持在自定义时间段内的非重复闹钟。",
- "description": "The third desc for secondPart "
- },
- "homepage.introduction.thirdPartDesc1": {
- "message": "支持为数据收集和存储设置自定义持续时间的线程池。",
- "description": "The first desc for thirdPart "
- },
- "homepage.introduction.thirdPartDesc2": {
- "message": "同时还支持Prometheus、InfluxDB和其他监控系统。",
- "description": "The second desc for thirdPart "
- },
- "homepage.introduction.thirdPartDesc3": {
- "message": "通过Grafana或内置的监控页面提供可视化仪表盘监控指标。",
- "description": "The third desc for thirdPart "
- },
- "homepage.secondTitleDesc1": {
- "message": "Hippo4j是一个Java线程池框架。",
- "description": "The p1 for the secondTitle part"
- },
- "homepage.secondTitleDesc2": {
- "message": "提供了线程池核心参数动态调整、运行告警和监控等功能。",
- "description": "The p1 for the secondTitle part"
- },
- "homepage.secondTitleDesc3": {
- "message": "帮助业务系统提高线上稳定运行能力。",
- "description": "The p2 for the secondTitle part"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-blog/2022-06-06-hippo4j/index.md b/docs/i18n/zh/docusaurus-plugin-content-blog/2022-06-06-hippo4j/index.md
deleted file mode 100644
index e5aaba49..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-blog/2022-06-06-hippo4j/index.md
+++ /dev/null
@@ -1,145 +0,0 @@
----
-slug: Hippo-4J发布1.3.0版本
-title: Hippo-4J发布1.3.0版本
-authors: [xiaomage]
-tags: [hippo4j, release, 1.3.0]
----
-
-大家好,我是 **小马哥**。
-
-Hippo4j 距离上一个版本 1.2.1 已经过去一个月的时间。在此期间,由 **8 位贡献者** 提交了 **170+ commits**,正式发布 **1.3.0** 版本。
-
-注:这是一个 **兼容历史版本** 的重大升级。
-
-## HIPPO-4J 1.3.0
-
-### Feature
-
-1. 添加 RabbitMQ 线程池监控及动态变更
-2. 添加 RocketMQ 线程池监控及动态变更
-3. 添加 Dubbo 线程池监控及动态变更
-4. 添加 SpringCloud Stream RocketMQ 消费线程池监控及动态变更
-
-### Refactor
-
-1. 重构容器线程池查询及修改功能
-2. 优化配置中心触发监听后,所执行的数据变更逻辑
-
-### Optimize
-
-1. 前端控制台删除无用组件
-2. 服务端页面字段未显示中文
-3. 控制台 UI 优化
-4. 修改线程池实例后实时刷新列表参数
-5. 容器线程池编辑仅限 Admin 权限
-6. SpringBoot Starter 变更包路径
-
-### BUG
-
-1. 修复 SpringBoot Nacos 动态刷新不生效
-2. 报警配置 alarm=false 不配置通知报警平台和接收人报错
-
-## 三方框架线程池适配
-
-Hippo4j 1.3.0 最大的功能发布就是开发出了 **适配三方框架的基础框架**。
-
-目前已完成 **Dubbo、RabbitMQ、RocketMQ、RocketMQSpringCloudStream** 的线程池适配,后续还会接入 **Kafka、Hystrix** 等框架或中间件的线程池适配。
-
-### 引入适配三方框架 Jar 包
-
-引入 Hippo4j server 或 core 的 maven jar 坐标后,还需要引入对应的框架适配 jar:
-
-```xml
-
- cn.hippo4j
-
- hippo4j-spring-boot-starter-adapter-dubbo
-
- hippo4j-spring-boot-starter-adapter-rabbitmq
-
- hippo4j-spring-boot-starter-adapter-rocketmq
-
- hippo4j-spring-boot-starter-adapter-spring-cloud-stream-rocketmq
- 1.3.0
-
-```
-
-如果想觉得引入多个 jar 包繁琐,可以仅需引入一个全量包,Hippo4j 框架底层会根据各中间件的条件,判断加载具体线程池适配器。
-
-```xml
-
- cn.hippo4j
- hippo4j-spring-boot-starter-adapter-all
- 1.3.0
-
-```
-
-### HIPPO-4J Server
-
-Hippo4j server 引入上述适配 jar 包后,即可在 Hippo4j server 的控制台进行查看及修改三方框架线程池。
-
-
-
-
-
-点击编辑即可修改该 Java 应用对应的框架底层线程池。
-
-
-
-
-
-点击 **全部修改** 按钮可以修改当前组下所有应用实例的线程池配置。
-
-修改成功后,应用控制台打印以下日志,即为修改成功。
-
-```java
-[input] RocketMQ consumption thread pool parameter change. coreSize :: 1 => 10, maximumSize :: 1 => 10
-```
-
-### HIPPO-4J Core
-
-Hippo4j core 除了依赖上述适配 Jar 包外,还需要在配置中心添加以下配置项。
-
-```yaml
-spring:
- dynamic:
- thread-pool:
- # 省略其它配置
- adapter-executors:
- # threadPoolKey 代表线程池标识
- - threadPoolKey: 'input'
- # mark 为三方线程池框架类型,参见文初已支持框架集合
- mark: 'RocketMQSpringCloudStream'
- corePoolSize: 10
- maximumPoolSize: 10
-```
-
-## Gitee GVP
-
-Hippo4j 获得了一些宝贵的荣誉,这属于每一位对 Hippo4j 做出过贡献的成员。
-
-
-
-
-
-感谢所有为 Hippo4j 做出贡献的开发者!
-
-https://github.com/opengoofy/hippo4j/graphs/contributors
-
-
-
-
-
-## 最后总结
-
-开源不易,如果各位小伙伴看了 Hippo4j 框架后有所收获,希望能帮忙在 Github、Gitee 点个 star,谢谢。
-
-**Github**:https://github.com/opengoofy/hippo4j
-
-**Gitee**:https://gitee.com/mabaiwancn/hippo4j
-
-目前已有 **10+** 公司在生产环境使用 Hippo4j,如果贵公司使用了 Hippo4j,请在下方 Issue 登记,谢谢。
-
-**Issue**:https://github.com/opengoofy/hippo4j/issues/13
-
-登记使用不会对公司有任何影响,仅为了扩大 Hippo4j 影响力,帮助它能走得更远。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-blog/authors.yml b/docs/i18n/zh/docusaurus-plugin-content-blog/authors.yml
deleted file mode 100644
index ffffe8d4..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-blog/authors.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-xiaomage:
- name: 小马哥
- title: hippo4j 作者
- url: https://github.com/magegoofy
- image_url: https://avatars.githubusercontent.com/u/77398366?v=4
diff --git a/docs/i18n/zh/docusaurus-plugin-content-blog/options.json b/docs/i18n/zh/docusaurus-plugin-content-blog/options.json
deleted file mode 100644
index 9239ff70..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-blog/options.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "title": {
- "message": "Blog",
- "description": "The title for the blog used in SEO"
- },
- "description": {
- "message": "Blog",
- "description": "The description for the blog used in SEO"
- },
- "sidebar.title": {
- "message": "Recent posts",
- "description": "The label for the left sidebar"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current.json b/docs/i18n/zh/docusaurus-plugin-content-docs-community/current.json
deleted file mode 100644
index 1c24558f..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current.json
+++ /dev/null
@@ -1,94 +0,0 @@
-{
- "version.label": {
- "message": "Next",
- "description": "The label for version current"
- },
- "sidebar.tutorialSidebar.category.社区": {
- "message": "社区",
- "description": "The label for category 社区 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.贡献规约": {
- "message": "贡献规约",
- "description": "The label for category 贡献规约 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.user_docs": {
- "message": "user_docs",
- "description": "The label for category user_docs in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar tutorialSidebar"
- },
- "sidebar.user_docs.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar user_docs"
- },
- "sidebar.user_docs.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar user_docs"
- },
- "sidebar.user_docs.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar user_docs"
- },
- "sidebar.user_docs.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar user_docs"
- },
- "sidebar.community.category.贡献规约": {
- "message": "贡献规约",
- "description": "The label for category 贡献规约 in sidebar community"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/_category_.json
deleted file mode 100644
index bcd256c9..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "社区",
- "position": 1,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/contributor.md b/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/contributor.md
deleted file mode 100644
index dd77fa3d..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/contributor.md
+++ /dev/null
@@ -1,16 +0,0 @@
----
-id: contributor-guide
-sidebar_position: 1
-title: 贡献指南
----
-
-Git Commit Log 尽量使用英文。
-
-Pull Request 尽量保持单一,不同语义的代码贡献应拆分多个 Pull Request。
-
-为了让您的 GitHub ID 显示在 Contributor 列表中,别忘了以下设置:
-
-```shell
-git config --global user.name "username"
-git config --global user.email "GitHub 账号邮箱"
-```
\ No newline at end of file
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/dev_convention/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/dev_convention/_category_.json
deleted file mode 100644
index cb875453..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/dev_convention/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "贡献规约",
- "position": 2,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/dev_convention/code.md b/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/dev_convention/code.md
deleted file mode 100644
index f91acdbe..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/dev_convention/code.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-sidebar_position: 2
----
-
-# 代码规约
-
-1. 代码提交前,执行 `mvn spotless:apply` 保证代码格式符合规范。
-2. 代码中不要出现无意义的空行。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/dev_convention/document.md b/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/dev_convention/document.md
deleted file mode 100644
index 923ad81d..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/dev_convention/document.md
+++ /dev/null
@@ -1,227 +0,0 @@
----
-sidebar_position: 1
----
-
-# 文档规约
-
-文档引用自:[中文文案排版指北](https://github.com/sparanoid/chinese-copywriting-guidelines)
-
-## 空格
-
-> 「有研究顯示,打字的時候不喜歡在中文和英文之間加空格的人,感情路都走得很辛苦,有七成的比例會在 34 歲的時候跟自己不愛的人結婚,而其餘三成的人最後只能把遺產留給自己的貓。畢竟愛情跟書寫都需要適時地留白。
->
-> 與大家共勉之。」——[vinta/paranoid-auto-spacing](https://github.com/vinta/pangu.js)
-
-### 中英文之間需要增加空格
-
-正確:
-
-> 在 LeanCloud 上,數據儲存是圍繞 `AVObject` 進行的。
-
-錯誤:
-
-> 在LeanCloud上,數據儲存是圍繞`AVObject`進行的。
-
-> 在 LeanCloud上,數據儲存是圍繞`AVObject` 進行的。
-
-完整的正確用法:
-
-> 在 LeanCloud 上,數據儲存是圍繞 `AVObject` 進行的。每個 `AVObject` 都包含了與 JSON 兼容的 key-value 對應的數據。數據是 schema-free 的,你不需要在每個 `AVObject` 上提前指定存在哪些键,只要直接設定對應的 key-value 即可。
-
-例外:「豆瓣FM」等產品名詞,按照官方所定義的格式書寫。
-
-### 中文與數字之間需要增加空格
-
-正確:
-
-> 今天出去買菜花了 5000 元。
-
-錯誤:
-
-> 今天出去買菜花了 5000元。
-
-> 今天出去買菜花了5000元。
-
-### 數字與單位之間需要增加空格
-
-正確:
-
-> 我家的光纖入屋寬頻有 10 Gbps,SSD 一共有 20 TB。
-
-錯誤:
-
-> 我家的光纖入屋寬頻有 10Gbps,SSD 一共有 20TB。
-
-例外:度數/百分比與數字之間不需要增加空格:
-
-正確:
-
-> 角度為 90° 的角,就是直角。
-
-> 新 MacBook Pro 有 15% 的 CPU 性能提升。
-
-錯誤:
-
-> 角度為 90 ° 的角,就是直角。
-
-> 新 MacBook Pro 有 15 % 的 CPU 性能提升。
-
-### 全形標點與其他字符之間不加空格
-
-正確:
-
-> 剛剛買了一部 iPhone,好開心!
-
-錯誤:
-
-> 剛剛買了一部 iPhone ,好開心!
-
-> 剛剛買了一部 iPhone, 好開心!
-
-### `text-spacing` to the rescue?
-
-CSS Text Module Level 4 的 [`text-spacing`](https://www.w3.org/TR/css-text-4/#text-spacing-property) 和 Microsoft 的 [`-ms-text-autospace`](https://msdn.microsoft.com/library/ms531164(v=vs.85).aspx) 可以實現自動為中英文之間增加空白。不過目前並未普及,另外在其他應用場景,例如 macOS、iOS、Windows 等用戶介面目前並不存在這個特性,所以請繼續保持隨手加空格的習慣。
-
-## 標點符號
-
-### 不重複使用標點符號
-
-即使中國大陸的標點符號用法允許重複使用標點符號,但是這麼做會破壞句子的美觀性。
-
-正確:
-
-> 德國隊竟然戰勝了巴西隊!
-
-> 她竟然對你說「喵」?!
-
-錯誤:
-
-> 德國隊竟然戰勝了巴西隊!!
-
-> 德國隊竟然戰勝了巴西隊!!!!!!!!
-
-> 她竟然對你說「喵」??!!
-
-> 她竟然對你說「喵」?!?!??!!
-
-## 全形和半形
-
-不明白什麼是全形(全角)與半形(半角)符號?請查看維基百科條目『[全形和半形](https://zh.wikipedia.org/wiki/%E5%85%A8%E5%BD%A2%E5%92%8C%E5%8D%8A%E5%BD%A2)』。
-
-### 使用全形中文標點
-
-正確:
-
-> 嗨!你知道嘛?今天前台的小妹跟我說「喵」了哎!
-
-> 核磁共振成像(NMRI)是什麼原理都不知道?JFGI!
-
-錯誤:
-
-> 嗨! 你知道嘛? 今天前台的小妹跟我說 "喵" 了哎!
-
-> 嗨!你知道嘛?今天前台的小妹跟我說"喵"了哎!
-
-> 核磁共振成像 (NMRI) 是什麼原理都不知道? JFGI!
-
-> 核磁共振成像(NMRI)是什麼原理都不知道?JFGI!
-
-### 數字使用半形字符
-
-正確:
-
-> 這件蛋糕只賣 1000 元。
-
-錯誤:
-
-> 這件蛋糕只賣 1000 元。
-
-例外:在設計稿、宣傳海報中如出現極少量數字的情形時,為方便文字對齊,是可以使用全形數字的。
-
-### 遇到完整的英文整句、特殊名詞,其內容使用半形標點
-
-正確:
-
-> 賈伯斯那句話是怎麼說的?「Stay hungry, stay foolish.」
-
-> 推薦你閱讀《Hackers & Painters: Big Ideas from the Computer Age》,非常的有趣。
-
-錯誤:
-
-> 賈伯斯那句話是怎麼說的?「Stay hungry,stay foolish。」
-
-> 推薦你閱讀《Hackers&Painters:Big Ideas from the Computer Age》,非常的有趣。
-
-## 名詞
-
-### 專有名詞使用正確的大小寫
-
-大小寫相關用法原屬於英文書寫範疇,不屬於本 wiki 討論內容,在這裡只對部分易錯用法進行簡述。
-
-正確:
-
-> 使用 GitHub 登錄
-
-> 我們的客戶有 GitHub、Foursquare、Microsoft Corporation、Google、Facebook, Inc.。
-
-錯誤:
-
-> 使用 github 登錄
-
-> 使用 GITHUB 登錄
-
-> 使用 Github 登錄
-
-> 使用 gitHub 登錄
-
-> 使用 gイんĤЦ8 登錄
-
-> 我們的客戶有 github、foursquare、microsoft corporation、google、facebook, inc.。
-
-> 我們的客戶有 GITHUB、FOURSQUARE、MICROSOFT CORPORATION、GOOGLE、FACEBOOK, INC.。
-
-> 我們的客戶有 Github、FourSquare、MicroSoft Corporation、Google、FaceBook, Inc.。
-
-> 我們的客戶有 gitHub、fourSquare、microSoft Corporation、google、faceBook, Inc.。
-
-> 我們的客戶有 gイんĤЦ8、キouЯƧquムгє、๓เςг๏ร๏Ŧt ς๏гק๏гคtเ๏ภn、900913、ƒ4ᄃëв๏๏к, IПᄃ.。
-
-注意:當網頁中需要配合整體視覺風格而出現全部大寫/小寫的情形,HTML 中請使用標準的大小寫規範進行書寫;並通過 `text-transform: uppercase;`/`text-transform: lowercase;` 對表現形式進行定義。
-
-### 不要使用不道地的縮寫
-
-正確:
-
-> 我們需要一位熟悉 TypeScript、HTML5,至少理解一種框架(如 React、Next.js)的前端開發者。
-
-錯誤:
-
-> 我們需要一位熟悉 Ts、h5,至少理解一種框架(如 RJS、nextjs)的 FED。
-
-## 爭議
-
-以下用法略帶有個人色彩,即:無論是否遵循下述規則,從語法的角度來講都是**正確**的。
-
-### 超連結之間增加空格
-
-用法:
-
-> 請 [提交一個 issue](#) 並分配给相關同事。
-
-> 訪問我們網站的最新動態,請 [點擊這裡](#) 進行訂閱!
-
-對比用法:
-
-> 請[提交一個 issue](#) 並分配给相關同事。
-
-> 訪問我們網站的最新動態,請[點擊這裡](#)進行訂閱!
-
-### 簡體中文使用直角引號
-
-用法:
-
-> 「老师,『有条不紊』的『紊』是什么意思?」
-
-對比用法:
-
-> “老师,‘有条不紊’的‘紊’是什么意思?”
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/faq.md b/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/faq.md
deleted file mode 100644
index 0f0fb830..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/faq.md
+++ /dev/null
@@ -1,90 +0,0 @@
----
-sidebar_position: 5
-title: 常见问题
----
-
-# 常见问题
-
-- 租户和项目在 Hippo4j 中是什么意思
-- 控制台线程池管理和线程池实例的区别
-- 示例项目为什么会有跨域请求
-- 更新代码后运行时服务端SQL报错
-- 生产环境如何不启用动态线程池
-- Server 端宕机会影响 Client 运行么
-- Hippo4j 的发布方式是怎样的?如何选择正确的版本
-- 群机器人接受不到通知报警
-- 设置线程池参数优先级问题
-- 线程池实例中修改队列容量参数问题
-- 控制台 SocketTimeoutException: connect timed out
-
-## 租户和项目在 Hippo4j 中是什么意思
-
-Hippo4j 按照租户、项目、线程池的维度划分。
-
-举个例子,小编在一家公司的公共组件团队,团队中负责消息、短链接网关等项目。公共组件是租户,消息或短链接就是项目。
-
-## 控制台线程池管理和线程池实例的区别
-
-在线程池管理中修改线程池参数,客户端并不能实时感知到并变更参数,需要重启客户端。而线程池实例中去对具体的实例修改参数时,客户端无需重启,可以实时感知到参数变化。如果二者针对同一线程池的参数配置不同,则在重启客户端时,客户端会去拉去线程池管理中的参数配置。
-
-二者对应的定位:线程池管理中的配置是常态化配置。而线程池实例里的配置变更像是一种临时修改,比如突发的流量激增等场景,并不具备普适性。
-
-## 示例项目为什么会有跨域请求
-
-~~正常大家在部署时,服务端项目和客户端都在同一网络下,进行内网通信,是没有问题的。~~
-
-~~因为示例项目中,服务端部署在外网,而客户端注册到服务端 IP 是内网的,所以不通。~~
-
-~~涉及功能:线程池实例-查看、编辑,容器线程池。~~
-
-1.2.0 版本后,服务端访问客户端已变成,浏览器访问服务端,服务端转发客户端的形式完成调用,跨域问题已解决。
-
-## 更新代码后运行时服务端SQL报错
-
-如果更新代码运行功能出错,大概率是因为项目新增或修改了表结构。如版本升级迭代涉及数据库表变更,会额外提供 SQL 变更文件。
-
-如若第一次使用,初始化 SQL 脚本地址:[Hippo4j_manager.sql](https://github.com/longtai-cn/hippo4j/blob/develop/hippo4j-server/conf/hippo4j_manager.sql)。
-
-> 友情提示:每次执行数据库表或数据变更时,一定要保持提前备份的好习惯。
-
-## 生产环境如何不启用动态线程池
-
-测试环境已经引入 Hippo4j,暂时不打算上线生产环境。
-
-生产环境指定配置 `spring.dynamic.thread-pool.enable=false`,测试环境和生产环境配置就会隔离。
-
-## Server 端宕机会影响 Client 运行么
-
-不会。Client 端包含对 Server 端的健康检查机制,Server 端不可用时会停止交互,检查到可用时重新建立连接交互。
-
-## Hippo4j 的发布方式是怎样的?如何选择正确的版本
-
-Hippo4j 发布时可能会涉及到两端发布,分别是 Server 和 Starter。如无特殊说明,**每一次的版本升级将兼容上一版本代码**。
-
-- 如涉及 Server 发布,会在 [发布列表页面](https://github.com/longtai-cn/hippo4j/releases) 创建最新的发行版本;
-- 如涉及 Starter 发布,将直接推送 Starter Jar 至中央仓库,Server 包版本不变。
-
-## 群机器人接受不到通知报警
-
-如果是钉钉机器人,需在机器人配置自定义关键字,才可发送成功。如下所示:
-
-
-
-如果使用 hippo4j-server,请检查在 hippo4j-server 添加的报警通知记录,是否在客户端项目启动前,因为客户端只有在启动时会去 hippo4j-server 拉取报警通知记录。
-
-重启客户端项目,会重新拉取最新报警推送配置,问题解决。
-
-## 设置线程池参数优先级问题
-
-- 当使用 `@DynamicThreadPool` 进行修饰的方法中和在管理界面设置中同时存在的话,则管理界面设置的优先级最高;
-- 如果连接 server 端失败的话,使用 `@DynamicThreadPool` 进行修饰设置的优先级最高。
-
-## 线程池实例中修改队列容量参数问题
-
-在线程池管理中添加时,只有当选择队列类型为 `ResizableCapacityLinkedBlockingQueue` 时,后续再进行修改容量大小时才会实时的刷新修改成功。
-
-## 控制台 SocketTimeoutException: connect timed out
-
-控制台中触发的某些操作涉及到 hippo4j-server 调用客户端项目。如果 hippo4j-server 部署在测试环境,而客户端项目为本地启动,则会触发该问题。
-
-为什么编辑线程池参数不报错?因为线程池的动态变更是客户端主动发起连接,和服务端保持了一个长轮询,所以不存在服务端主动调用客户端行为。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/sponsor.md b/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/sponsor.md
deleted file mode 100644
index b68062dd..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/sponsor.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-sidebar_position: 6
----
-
-# 支持开源
-
-如果您正在使用这个项目并感觉良好,或者是想支持我继续开发,通过以下二维码一次性捐款。
-
-在这里承诺将,将收到的所有赞助支持资金完全公开化,且后续资金用途仅 Hippo4j 项目的运转。
-
-
-
-感谢给予支持的朋友,您的支持是 Hippo4j 社区前进的动力 🎉
-
-| | ID | 赞赏金额 | 时间 | 备注 |
-|-----|--|-------|------------|--------------------|
-| 1 | 六月飞雪 | 30.00 | 2021-12-30 | 代码设计很优雅的一款框架,继续加油! |
-| 2 | 孙大圣 | 26.6 | 2022-03-23 | 学习一下😁😁 |
-| 3 | Easy 点 | 66.00 | 2022-04-09 | 好货好技术当加赏 |
-| 4 | 捷克 | 30.00 | 2022-05-21 | 非常不错的框架,点赞 |
-| 5 | 吃猫的饼干 | 88.00 | 2022-08-21 | 👍 |
-| 6 | 不忘初心· | 66.00 | 2022-10-28 | Nice! |
-| 7 | 时刻· | 6.00 | 2022-10-30 | -! |
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/team.md b/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/team.md
deleted file mode 100644
index ae24340a..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/team.md
+++ /dev/null
@@ -1,151 +0,0 @@
----
-sidebar_position: 3
-title: 团队成员
----
-
-## Hippo4j 团队
-
-非常感谢通过开源对 Hippo4j 贡献的开发者,项目始终保持高质量编码,以社区的力量去发展项目,并以项目反馈社区成员。我们期待对开源有兴趣的小伙伴加入团队,与社区共同成长。
-
-## 开发者角色
-
-Hippo4j 开发者包含 Maintainer、Committer、Contributor 三种角色,每种角色的标准定义如下。
-
-### 1. Maintainer
-
-Maintainer 是对 Hippo4j 项目的演进和发展做出显著贡献的个人。具体包含以下的标准:
-
-- 完成多个关键模块或者工程的设计与开发,是项目的核心开发人员;
-- 持续的投入和激情,能够积极参与社区、官网、Issue、PR 等项目相关事项的维护;
-- 在社区中具有有目共睹的影响力,能够代表 Hippo4j 参加重要的社区会议和活动;
-- 具有培养 Committer 和 Contributor 的意识和能力。
-
-### 2. Committer
-
-Committer 是具有 Hippo4j 仓库写权限的个人,包含以下的标准:
-
-- 能够在长时间内做持续贡献 Issue、PR 的个人;
-- 参与 Issue 列表的维护及重要 Feature 的讨论;
-- 参与 Code review。
-
-### 3. Contributor
-
-Contributor 是对 Hippo4j 项目有贡献的个人,标准为:
-
-- 提交过 PR(代码或者文档)并被合并。
-
-### 4. 开发者权利及义务
-
-
-
-## 开发团队
-
-本页面展示了 Hippo4j 的开发团队,并且还在持续扩充中。
-
-
-
-
- 姓名
- GitHub ID
- 角色
- 联系方式
-
-
-
- 马称
- magestacks
- Maintainer
- machen@apache.org
-
-
-
- 陆宽
- shining-stars-lk
- Committer
- 1031900093@qq.com
-
-
-
- 王杰
- iwangjie
- Committer
- wangchenmo1025@gmail.com
-
-
-
- 魏虎
- weihubeats
- Committer
- weihu@apache.org
-
-
-
- 李剑鑫
- BigXin0109
- Committer
- 1064730540@qq.com
-
-
-
- 刘文浩
- pizihao
- Committer
- hao3073liu@163.com
-
-
-
- 叶炜
- shanjianq
- Committer
- 17855368071@163.com
-
-
-
- 黄成兴
- Createsequence
- Committer
- 841396397@qq.com
-
-
-
- 吴浪
- wulangcode
- Committer
- sanliangitch@foxmail.com
-
-
- a>
- 黎金星
- road2master
- Committer
- lijinxingerm@gmail.com
-
-
- a>
- 严荣振
- yanrongzhen
- Committer
- bruceyan@didiglobal.com
-
-
-
-## 成为 Committer
-
-持续对 Hippo4j 进行贡献,粗略评估,至少完成 20+ PR 贡献可成为核心开发者。 其中包括完成 2
-个 [good pro issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+pro+issue%22)
-或以上,以及若干个 [good first issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)。
-
-:::note
-会根据 PR 质量提供个性化评估,有可能一个或两个质量较高 PR
-即可成为核心开发者。参考:[重构 DynamicThreadPoolExecutor 功能扩展逻辑](https://github.com/opengoofy/hippo4j/pull/854)
-:::
-
-成为 Committer 后,会为该 GitHub 账号获取 Jetbrains 全家桶 Licenses,有效期为 1 年。不用再为破解而烦恼,感受随时升级的快乐。
-
-:::note
-距离到期两周前,会再次申请 Jetbrains Licenses。有点类似于无限续约的感觉,在此感谢 Jetbrains 公司对开源的支持。
-:::
-
-截至 `2022-10-30` 当天,已为登记的 7 位 Committer 成功申请 Licenses。
-
-
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/update-log.md b/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/update-log.md
deleted file mode 100644
index 720742bb..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs-community/current/update-log.md
+++ /dev/null
@@ -1,411 +0,0 @@
----
-title: 更新日志
-sidebar_position: 5
----
-
-## 1.5.0 (Apr 15, 2023)
-
-这是一个大的功能增强版本,建议按照当前版本升级。具体信息可查看 Release 标签地址:[1.5.0](https://github.com/opengoofy/hippo4j/milestone/14?closed=1)
-
-**Use Change**
-
-- [Config] 配置属性中容器线程池配置命名改为 `spring.dynamic.thread-pool.web`。
-
-- [Server] 为了使语义更加明确,当前版本中线程池执行超时时间的最低可设置为-1,表示不设置超时。需要注意的是,如果客户端使用的是低于1.5.0的版本,可能会存在不兼容的情况。
-
-- [Common] 为了使语义更加明确,废弃 `ThreadPoolBuilder#maxPoolNum`,新增加 `ThreadPoolBuilder#maximumPoolSize`,原 API 还可以使用,将在后续版本删除。
-
-**Feature**
-
-- [#1124 ] Config 模式支持 Web 容器配置修改通知 @yanrongzhen
-- [#1148 ] 优化执行时间超时 executeTimeOut 为空或 <= 0 的场景 @sususama
-- [#1128 ] 控制台前端国际化开发 @Svamei @ PleasePerfunctory
-- [#1068 ] 默认线程池配置填充至线程池实例 @magestacks
-- [#1055 ] 适配第三方自定义线程池,支持外部SPI方式扩展线程池类型 @lingfengcoder
-- [#547 ] 支持 Consul 配置中心动态调整参数 @road2master
-- [#624 ] 添加 Dubbox 线程池监控及动态变更 @iwangjie
-- [#977 ] 增加 ROLE_MANAGE 角色,主要负责线程池变更审核 @magestacks
-- [#821 ] 开发用户修改密码功能 @wulangcode
-
-**Refactor**
-
-- [#1092 ] 关于扩展点 SPI 方案的重构 @yanrongzhen
-- [#1025 ] 优化BlockingQueueTypeEnum实现 @lianyiwuming
-- [#1015 ] 重构Web线程池配置文件命名 @yanrongzhen
-- [#1071 ] ThreadPoolBuilder提供全新的最大线程池API @jjiey
-- [#1058 ] 客户端引入多个 Web 容器依赖导致 WebThreadPoolService 报错 @Createsequence
-- [#844 ] 移除 alibaba-dingtalk-service-sdk @baymax55
-
-**Bug**
-
-- [#1085 ] DynamicThreadPoolRegisterParameter#threadFactory序列化异常 @magestacks
-- [#1163 ] Adapter 适配三方线程池启动顺序错误 @magestacks
-- [#1134 ] Web容器启动时刷新最新配置失败 @yanrongzhen
-- [#1129 ] Prometheus 不能正常采集 Hystrix 线程池 queue.capacity 数据 @jjiey
-- [#1121 ] 线程池实例包含已关闭客户端节点 @zjHe
-- [#1106 ] springBoot 1.5.x适配Web容器线程池调整 @yanrongzhen
-- [#1114 ] ZipkinExecutorAdapter 可能出现空指针异常 @yult97
-- [#1074 ] Hystrix Adapter 支持 hippo4j config @jjiey
-- [#1040 ]线程池参数默认配置与文档描述不符 @wulangcode
-- [#1002 ] SpringBoot Nacos 动态刷新错误使用 SpringCloud Nacos 类 @BigXin0109
-- [#990 ] TTL 装饰的线程池无法执行等待任务完成插件 @Createsequence
-- [#966 ] Alibaba Dubbo 无法获取线程池运行状态 @iwangjie
-
-**Optimize**
-
-- [#1159 ] 优化飞书和企业微信失败处理逻辑 @ITXiaoShiTou
-- [#1156 ] 线程池通知管理调整查询租户&项目&线程池默认10条 @tudou0806
-- [#1069 ] 线程池执行超时时间最小值支持 -1 @Ronan1024
-- [#1111 ] 核心阻塞队列枚举 BlockingQueueTypeEnum.createBlockingQueue(String blockingQueueName, Integer capacity)抛出NPE问题修复 @LiXuemin
-- [#1072 ] 提供公用方法安全设置 corePoolSize 和 maxPoolSize @jjiey
-- [#1051 ] 前端国际化登录页面中文错误 @xiaobaisdz
-- [#1001 ] 容器停止时,若线程池在等待关闭时,有任务触发超时告警会抛异常警类 @Createsequence
-- [#1024 ] 客户端与 Hippo4j revision 冲突 @baymax55
-- [#720 ] 修复 Dubbo 错误的日志打印 @baymax55
-- [#992 ] 优化 Hippo4j Banner 打印时可能存在的空指针 @wulangcode
-- [#976 ] 注册线程池默认指定过期时间和线程工厂 @magestacks
-- [#964 ] 长轮询时配置未变更返回304状态码适配低版本客户端 @wulangcode
-- [#942 ] 修改 MyBatis-Plus 数据库方言配置 @li-xiao-shuang
-- [#959 ] ThreadPoolPluginRegisterPostProcessor 打印过多 WARN 日志 @Createsequence
-- [#960 ] ThreadPoolPluginRegisterPostProcessor 实现 BeanPostProcessor 默认方法 postProcessBeforeInitialization @Createsequence
-
-
-## 1.4.3 (Nov 06, 2022)
-
-这是一个功能增强版本,修复了少量 BUG。建议按照当前版本升级。具体信息可查看 Release 标签地址:[1.4.3](https://github.com/opengoofy/hippo4j/milestone/13?closed=1)
-
-**Use Change**
-
-- 重构线程池监控,配置层级和命名改变
-- 如果使用钉钉报警,关键字【警报】修改为【告警】
-
-**Feature**
-
-- 重构 Spring 后置处理器创建动态线程池逻辑
-- 官网开启多版本化功能
-- 官网支持国际化,en-US
-- 适配线程池延迟初始化 @wulangcode
-- 添加 Codecov 相关代码覆盖率指标
-- 项目优雅关闭时停止运行状态采集
-
-**Refactor**
-
-- DynamicThreadPoolExecutor 重构,增加插件扩展逻辑 @Createsequence
-- 重构线程池监控,新增容器和三方框架线程池监控
-- 重构服务端包目录,聚合 hippo4j-server 相关 module
-
-**Bug**
-
-- dubbo 线程池无法获取运行信息 @iwangjie
-- 线程池检查活跃度报警取值错误 @maxisvest
-- 动态线程池修改多次后队列提示信息丢失
-- docker部署 mysql启动报错H2驱动
-- docker-startup.sh的mysql配置多个“-” @Malcolmli
-- 动态注册线程池队列容量赋值错误
-- 飞书超时类型告警不存在 Trace 信息时发送错误 @mageeric
-
-**Optimize**
-
-- 修改报警文案,【警报】修改为【告警】 @wulangcode
-- 自动选择H2数据库的存储路径 @iwangjie
-- 服务端在客户端后面启动,依旧支持长轮训 @wulangcode
-- 配置未发生变更时,长轮询返回 304 @wulangcode
-- discovery服务Lease类中判断过期时间需要多等一个duration @w-jirong
-- 优化 ThreadPoolBuilder#maxPoolNum 核心线程不得大于最大线程 @wulangcode
-- hippo4j console ui 迁移至本项目
-- 查询 Web 线程池列表添加框架标识
-- 优化 H2 初始化逻辑
-
-## 1.4.2 (Oct 18, 2022)
-
-这是一个功能增强版本,修复了少量 BUG。建议按照当前版本升级。具体信息可查看 Release 标签地址:[1.4.2](https://github.com/opengoofy/hippo4j/milestone/12?closed=1)
-
-**Feature**
-
-- 强制指定客户端注册的 ip + port
-- 支持 spring-cloud-tencent Polaris 线程池动态更新 @weihubeats
-- 服务启动时加载 MySQL、H2 数据库初始化语句
-- Adapter 初始化覆盖核心参数 @pizihao
-- Server 端新增是否开启认证模式 @baymax55
-
-**Refactor**
-
-- 替换底层网络工具类 OkHttp @yanrongzhen
-- 全局移除 commons-lang3 工具包依赖 @yanrongzhen
-- 去除三方工具类依赖 @pizihao
-- 全局移除 Guava 工具包依赖 @road2master
-- DockerFile 基于 H2 数据库重新构建 @BigXin0109
-
-**Bug**
-
-- Dubbo 2.7.15 无法获取线程池引用 @iwangjie
-- 动态线程池报警参数颠倒 @jinlingmei
-
-**Optimize**
-
-- 线程池实例运行数据采集,如果线程池id不存在,且长度超长,会报异常 @Gdk666
-- 项目中动态线程池数量为空时,存在 CPU 空转情况
-- 客户端注册服务端失败,输出服务端返回信息 @wulangcode
-- 调整数据库项目 id 和线程池 id 字段长度
-- 增加代码检查工具 maven-checkstyle-plugin
-- 调整控制台监控图表颜色展示
-
-## 1.4.1 (Sep 12, 2022)
-
-这是一个功能增强版本,修复了若干 BUG。建议按照当前版本升级。具体信息可查看 Release 标签地址:[1.4.1](https://github.com/opengoofy/hippo4j/milestone/11?closed=1)
-
-**Feature**
-
-- 支持 H2 数据库 @weihubeats
-- 动态线程池配置变更时,支持单个、多个或全部节点变 @pizihao
-- 增加线程池活跃度和容量报警可选择关闭
-- @DynamicThreadPool 线程池不存在则创建 @shanjianq
-- 支持 ETCD 配置中心动态调整参数 @weihubeats
-- 创建动态线程池支持 spring 线程池 @BigXin0109
-- 线程池实例变更增加执行超时时间
-- 线程池相关查询页面增加阻塞队列属性
-- 定义动态线程池时,抽象默认配置
-- 提供 ExecutorContext 封装上下文细节 @road2master
-- Docker 制作服务端镜像,帮助开发者快速启动 @BigXin0109
-- RabbitMQ 适配器增加多个 MQ 数据源 @weihubeats
-
-**Bug**
-
-- 动态线程池设置关闭时启动报错 @dousp
-- ExecutorTtlWrapper 类型的 Executor 不生效 @BigXin0109
-- Undertow 获取 WebServer 类型参数异常 @shining-stars-lk
-- 修复线程池核心、最大线程数校验限制
-- ByteConvertUtil#getPrintSize 单位转换错误 @onesimplecoder
-- 创建线程池单选框选择错误
-- ReflectUtil#getFieldsDirectly missing fields @BigXin0109
-- 本地代码中设置的 capacity 无效 @BigXin0109
-- 服务端线程池超时时间存在拆箱空指针异常 @oreoft
-- 未读取服务端返回执行超时时间属性
-- ResizableCapacityLinkedBlockingQueue#put 当前元素数量大于 capacity 未阻塞
-
-**Optimize**
-
-- 长轮询任务判断逻辑优化 @shining-stars-lk
-- 线程池存在实例不允许删除线程池 @shanjianq
-- 优化租户、项目列表展示排版
-- 通知报警模块项目和线程池下拉查询排序修改
-- 动态线程池拒绝策略触发,以异步的方式报警
-- 优化框架中线程池工厂产生的线程名称 @road2master
-
-## 1.4.0 (Aug 16, 2022)
-
-`hippo4j server` 兼容历史低版本,`hippo4j config` 中部分属性名进行了调整,请参考 [hippo4j config 快速开始](https://hippo4j.cn/docs/user_docs/getting-started/hippo4j-core-start)。
-
-注意事项:
-1. 如果是对已运行 hippo4j server 升级,执行 `/conf/sql-upgrade` 目录下对应的升级脚本。
-2. 需客户端在 1.4.0 及以上版本才可在 hippo4j server 设置线程执行超时时间属性。
-
-**Feature**
-
-- 添加 Alibaba Dubbo 线程池监控及动态变更
-- hippo4j server 支持任务执行超时时间动态修改
-- 阿里 TTL 框架线程池适配
-- 添加动态线程池自动注册功能
-- 订阅回调线程池参数变更
-- 动态线程池监控增加 SPI 自定义功能
-- hippo4j server 支持多种线程池监控方式,例如 Prometheus
-- 通知相关参数添加动态变更功能
-
-**Bug**
-
-- 线程池变更:executeTimeOut 变更极端情况下会出现异常
-- 用户登录时候,如果输入了不存在的用户名,后台报空指针异常
-- 修复了对 spring-boot 服务中 tomcat 线程池的兼容问题
-- 排除 Tomcat Jar 使用 Undertow 启动报错
-
-**Optimize**
-
-- hippo4j-core-spring-boot-starter 模块修改名称为 hippo4j-config-spring-boot-starter
-- 拆分容器线程池子页面:Tomcat、Undertow、Jetty
-- 服务端访问客户端时对 URL 转码
-- MyBatisPlus 修改全局填充方法优化
-- 控制台线程池列表下拉框默认正序
-- 控制台线程池实例菜单,对于非可修改容量队列外,不允许修改队列容量
-- 动态线程池控制台功能变更
-- 租户和项目列表分页查询按照创建时间倒序展示
-- 线程池监控页面图表 UI 优化
-- 设置 maven-gpg-plugin 插件默认不执行
-- 前端控制台相关搜索条件添加必填提示
-- hippo4j 消息通知 & 报警抽象优化
-- 配置中心未配置线程池启动报错
-- 控制台线程池报警 UI 以及功能优化
-- Web、框架线程池编辑弹框 UI 优化
-- 线程池添加、编辑页面 UI 优化
-- 线程池运行详情页前端 UI 优化
-
-**Refactor**
-
-- 删除自定义日志组件
-- 线程池监控功能重构
-- hippo4j core 配置中心生效判断重构
-- 配置变更通知 & 报警通知重构
-- Web 容器线程池适配迁移 hippo4j-adapter
-
-## 1.3.1 (July 17, 2022)
-
-注:这是一个兼容历史版本的小范围升级。
-
-**Feature**
-
-- 控制台新增线程池功能设置为 Admin 权限
-- 添加 Hystrix 线程池监控及动态变更
-- 添加 Netty 上传动态线程池监控数据方式
-- 添加 GitHub Actions CI 流程
-- 添加 Spring Kafka 示例项目
-- Tomcat 版本号 >= 9.0.55 线程池适配
-
-**Refactor**
-
-- 更多线程池拆分子目录页面
-
-**Optimize**
-
-- hippo4j core 添加 banner 打印
-- 优化可变更容量阻塞队列名称
-
-**BUG**
-
-- Apollo 配置修改延迟了一个版本
-- Spring Boot 环境下使用 hippo4j-core 接入,配置中心使用 nacos;启动时提示 ConfigService not found
-
-查看 1.3.1 版本发布:https://github.com/mabaiwan/hippo4j/milestone/9
-
-## 1.3.0 (June 06, 2022)
-
-1.3.0 发布 **适配三方框架的基础框架**。
-
-目前已完成 **Dubbo、RabbitMQ、RocketMQ、RocketMQSpringCloudStream** 的线程池适配,后续还会接入 **Kafka、Hystrix** 等框架或中间件的线程池适配。
-
-注:这是一个兼容历史版本的重大升级。
-
-**Feature**
-
-- 添加 RabbitMQ 线程池监控及动态变更
-- 添加 RocketMQ 线程池监控及动态变更
-- 添加 Dubbo 线程池监控及动态变更
-- 添加 SpringCloud Stream RocketMQ 消费线程池监控及动态变更
-
-**Refactor**
-
-- 重构容器线程池查询及修改功能
-- 优化配置中心触发监听后,所执行的数据变更逻辑
-
-**Optimize**
-
-- 前端控制台删除无用组件
-- 服务端页面字段未显示中文
-- 控制台 UI 优化
-- 修改线程池实例后实时刷新列表参数
-- 容器线程池编辑仅限 Admin 权限
-- SpringBoot Starter 变更包路径
-
-**BUG**
-
-- 修复 SpringBoot Nacos 动态刷新不生效
-- 报警配置 alarm=false 不配置通知报警平台和接收人报错
-
-## 1.2.1 (May 07, 2022)
-
-**BugFix**
-
-- apollo 动态配置不生效
-- 修复 hippo4j-core 后置处理器创建线程池问题
-- 重构 hippo4j-core spring 后置处理器逻辑
-- 优化ThreadPoolNotifyAlarmHandler下的空指针异常
-- 修复线程池核心、最大线程数变更问题
-- startup.cmd 未正常读取 conf 配置文件
-
-**Optimize**
-
-- 配置文件中字段歧义
-- 修改代码中历史网址
-- InstanceInfo 的 groupKey 参数重复设置
-- ConfigFileTypeEnum 枚举字段添加注释
-- 线程资源通过线程池创建,不允许自行显示创建线程
-- Guava 版本升级至 30.0-jre 及以上版本
-- SystemClock 替换 System.currentTimeMillis()
-- 添加代码格式化插件 Spotless
-- 修改线程池文案
-
-## 1.2.0 (Mar 13, 2022)
-
-**Feature**
-
-- hippo4j-core线程池资源对接 Prometheus 监控
-- hippo4j-core 支持 Zookeeper
-- hippo4j-core 支持 Apollo
-
-**Optimize**
-
-- 适配非 Web SpringBoot 项目使用 Hippo4j
-- 优化报警通知
-- 修复在 JDK 小版本中的兼容性问题
-
-**BugFix**
-
-- server 端查看容器线程池,参数为 null
-- 重构线程池查看及容器线程池查看等交互
-- 修复引入 hippo4j-spring-boot-starter 后,运行单元测试报错
-- 修复可能出现的空指针异常
-
-## 1.1.0 (Mar 13, 2022)
-
-Hippo4j 线程池框架 1.1.0 RELEASE 版本,添加了 Hippo4j-Core(依赖配置中心的动态线程池).
-
-**Feature**
-
-- 删除 DynamicThreadPoolExecutor 内代码实现,仅通过线程池扩展点进行扩展
-- 通过动态代理实现线程池拒绝策略执行次数统计
-- 抽象通知报警消息模块
-- 抽象 hippo4j 核心组件,不依赖 server 端即可完成动态调参、监控、报警等功能
-- 前端删除线程池按钮添加 Admin 权限
-- 添加线程池任务运行超长报警
-- 容器线程池支持 Undertow
-- 容器线程池支持 Jetty
-- 重构服务端异常体系
-
-**Optimize**
-
-- 前端项目 Token 失效跳转登录页
-- 优化 Server 启动脚本日志输出
-- 优化前端按钮权限控制粒度
-- 优化线程池报警推送文案
-- 前端弹框样式优化
-- 适配低版本 SpringBoot Bind
-- 优化消息通知模块
-
-**BugFix**
-
-- Duplicate entry 'xxx' for key 'uk_configinfo_datagrouptenant'
-
-## 1.0.0 (Feb 01, 2022)
-
-**Feature**
-
-- 线程池运行堆栈查看
-- 扩展 Web 容器线程池动态调参、监控
-
-**Optimize**
-
-- 删除高版本 SpringBoot Api
-- ListableBeanFactory#findAnnotationOnBean SpringBoot 低版本适配
-- 优化客户端关闭时调用服务端钩子函数
-- 线程池实例参数弹框添加实例 ID 和线程池状态
-- 补充线程池替换 Hippo4j 文档
-- 1.5.x springboot 引入hippo4j-spring-boot-starter配置项,bean初始化失败
-- 优化线程池参数编辑合理性校验
-- BaseInstanceRegistry 读写锁重构
-
-**BugFix**
-
-- 本地项目线程池实例缓存无法精确清理
-- 线程池实例页面多实例不同 Active 展示错误
-- 创建动态线程池逻辑判断修复
-- 创建动态线程池增强参数未设置
-- 控制消息推送报警频率的方法有并发安全的问题
-- tomcat线程池上下文获取失败
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current.json b/docs/i18n/zh/docusaurus-plugin-content-docs/current.json
deleted file mode 100644
index 1c24558f..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current.json
+++ /dev/null
@@ -1,94 +0,0 @@
-{
- "version.label": {
- "message": "Next",
- "description": "The label for version current"
- },
- "sidebar.tutorialSidebar.category.社区": {
- "message": "社区",
- "description": "The label for category 社区 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.贡献规约": {
- "message": "贡献规约",
- "description": "The label for category 贡献规约 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.user_docs": {
- "message": "user_docs",
- "description": "The label for category user_docs in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar tutorialSidebar"
- },
- "sidebar.user_docs.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar user_docs"
- },
- "sidebar.user_docs.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar user_docs"
- },
- "sidebar.user_docs.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar user_docs"
- },
- "sidebar.user_docs.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar user_docs"
- },
- "sidebar.community.category.贡献规约": {
- "message": "贡献规约",
- "description": "The label for category 贡献规约 in sidebar community"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/dev_manual/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/dev_manual/_category_.json
deleted file mode 100644
index 9117307f..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/dev_manual/_category_.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "label": "开发者手册",
- "position": 5,
- "link": {
- "type": "generated-index",
- "description": "Hippo4j 留给使用者能够扩展的知识点。"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/dev_manual/queue-custom.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/dev_manual/queue-custom.md
deleted file mode 100644
index 9fb5512a..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/dev_manual/queue-custom.md
+++ /dev/null
@@ -1,89 +0,0 @@
----
-sidebar_position: 4
----
-
-# 阻塞队列自定义
-
-Hippo4j 通过 SPI 的方式对拒绝策略进行扩展,可以让用户在 Hippo4j 中完成自定义阻塞队列实现。
-
-## 1. 定义自定义队列类
-
-实现接口 `cn.hippo4j.common.executor.support.CustomBlockingQueue`:
-
-```java
-public class MyArrayBlockingQueue implements CustomBlockingQueue {
-
- @Override
- public Integer getType() {
- return 1001;
- }
-
- @Override
- public String getName() {
- return "MyArrayBlockingQueue";
- }
-
- @Override
- public BlockingQueue generateBlockingQueue(Integer capacity) {
- int effectiveCapacity = capacity == null || capacity <= 0 ? 1024 : capacity;
- return new ArrayBlockingQueue<>(effectiveCapacity);
- }
-}
-```
-
-> 兼容提示:旧版只需实现 `generateBlockingQueue()` 的实现仍然有效,框架会在未覆写新方法时回退到旧逻辑,但推荐改为覆写带 `capacity` 入参的方法,以便直接复用服务端配置。
-
-## 2. 声明 SPI 文件
-
-在 `src/main/resources/META-INF/services/` 目录下新增文件:
-```
-cn.hippo4j.common.executor.support.CustomBlockingQueue
-```
-
-文件内容仅一行:
-```
-com.example.queue.MyArrayBlockingQueue
-```
-
-## 3. 服务端生效方式
-
-当服务端下发的 `queueType` 与 `capacity` 命中自定义类型时,框架会通过 SPI 自动创建队列,并将服务端配置的容量参数传入 `generateBlockingQueue(Integer capacity)`。
-
-### 3.1 队列创建与验证
-
-```java
-// 创建队列
-BlockingQueue q = BlockingQueueTypeEnum.createBlockingQueue(queueType, capacity);
-
-// 或者通过队列名称创建
-BlockingQueue q2 = BlockingQueueTypeEnum.createBlockingQueue("ArrayBlockingQueue", capacity);
-
-// 验证队列配置
-boolean valid = BlockingQueueManager.validateQueueConfig(queueType, capacity);
-
-// 动态调整容量(仅 ResizableCapacityLinkedBlockingQueue 支持)
-boolean ok = BlockingQueueManager.changeQueueCapacity(executor.getQueue(), newCapacity);
-```
-
-### 3.2 队列类型生效
-
-- **配置模板**:在线程池管理页面编辑队列类型,会保存到数据库,但不会推送到运行中的客户端。
-- **生效时机**:客户端应用重启时,会从服务端读取最新配置,并使用反射替换线程池的 `workQueue` 字段。
-- **运行时调整**:运行时仅支持队列容量的动态调整(仅限 `ResizableCapacityLinkedBlockingQueue`),不支持队列类型切换。
-
-服务端动态刷新处的实现:
-
-```java
-// ServerThreadPoolDynamicRefresh#handleQueueChanges
-// 仅支持容量调整,不支持队列类型切换
-if (parameter.getCapacity() != null) {
- if (BlockingQueueManager.canChangeCapacity(executor.getQueue())) {
- boolean success = BlockingQueueManager.changeQueueCapacity(
- executor.getQueue(), parameter.getCapacity());
- if (success) {
- log.info("Queue capacity changed to: {} for thread pool: {}",
- parameter.getCapacity(), parameter.getTpId());
- }
- }
-}
-```
\ No newline at end of file
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/dev_manual/queue-info.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/dev_manual/queue-info.md
deleted file mode 100644
index 956507d3..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/dev_manual/queue-info.md
+++ /dev/null
@@ -1,47 +0,0 @@
----
-sidebar_position: 3
----
-
-# 内置阻塞队列
-
-Hippo4j 内置多种常用阻塞队列类型,支持开箱即用,亦可通过 SPI 扩展自定义队列类型。
-
-## 内置类型清单
-
-以下类型可直接在服务端或配置中选择(枚举:`BlockingQueueTypeEnum`):
-
-- ArrayBlockingQueue(数组有界队列)
-- LinkedBlockingQueue(链表队列)
-- LinkedBlockingDeque(双端队列)
-- SynchronousQueue(同步移交队列)
-- LinkedTransferQueue(可转移队列)
-- PriorityBlockingQueue(优先级队列)
-- ResizableCapacityLinkedBlockingQueue(可在线动态调容量的链表队列)
-
-## 枚举定义
-
-**ResizableCapacityLinkedBlockingQueue**:支持在线变更 `capacity`。
-
-```java
-// cn.hippo4j.common.executor.support.BlockingQueueTypeEnum
-RESIZABLE_LINKED_BLOCKING_QUEUE(9, "ResizableCapacityLinkedBlockingQueue") {
- @Override
- BlockingQueue of(Integer capacity) {
- return new ResizableCapacityLinkedBlockingQueue<>(capacity);
- }
- @Override
- BlockingQueue of() {
- return new ResizableCapacityLinkedBlockingQueue<>();
- }
-}
-```
-
-## 使用建议
-
-- 需要在线调容量:优先选择 `ResizableCapacityLinkedBlockingQueue`
-- 需要严格有界:选择 `ArrayBlockingQueue`
-- 需要无界吞吐:选择 `LinkedBlockingQueue`
-- 需要优先级:选择 `PriorityBlockingQueue`
-- 需要同步移交:选择 `SynchronousQueue`
-
-如需自定义队列类型,请参考《阻塞队列自定义》。
\ No newline at end of file
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/dev_manual/rejected-policy-custom.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/dev_manual/rejected-policy-custom.md
deleted file mode 100644
index e0405061..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/dev_manual/rejected-policy-custom.md
+++ /dev/null
@@ -1,57 +0,0 @@
----
-sidebar_position: 1
----
-
-# 拒绝策略自定义
-
-Hippo4j 通过 SPI 的方式对拒绝策略进行扩展,可以让用户在 Hippo4j 中完成自定义拒绝策略实现。
-
-## Hippo4j Server 拒绝策略扩展
-
-自定义拒绝策略,实现 `CustomRejectedExecutionHandler` 接口,示例如下:
-
-```java
-public class ErrorLogRejectedExecutionHandler implements CustomRejectedExecutionHandler {
-
- @Override
- public Integer getType() {
- return 12;
- }
-
- @Override
- public RejectedExecutionHandler generateRejected() {
- return new CustomErrorLogRejectedExecutionHandler();
- }
-
- public static class CustomErrorLogRejectedExecutionHandler implements RejectedExecutionHandler {
-
- @Override
- public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
- Logger logger = LoggerFactory.getLogger(this.getClass());
- logger.error("线程池抛出拒绝策略");
- }
- }
-}
-```
-
-创建 `src/main/resources/META-INF/services` 目录,创建 SPI 自定义拒绝策略文件 `cn.hippo4j.common.executor.support.CustomRejectedExecutionHandler`。
-
-`cn.hippo4j.common.executor.support.CustomRejectedExecutionHandler` 文件内仅放一行自定义拒绝策略全限定名即可,示例:
-
-```text
-cn.hippo4j.example.core.handler.ErrorLogRejectedExecutionHandler
-```
-
-创建、修改线程池页面选择 `CustomRejectedPolicy(自定义 SPI 策略)`。
-
-
-
-拒绝策略触发时,完成上述代码效果,仅打印异常日志提示。
-
-```text
-2022-08-01 21:27:49.515 ERROR 48928 --- [ateHandler.test] r$CustomErrorLogRejectedExecutionHandler : 线程池抛出拒绝策略
-```
-
-:::note
-具体参考 `hippo4j-example/hippo4j-spring-boot-starter-example` 模块。
-:::
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/dev_manual/rejected-policy-info.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/dev_manual/rejected-policy-info.md
deleted file mode 100644
index d5c68138..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/dev_manual/rejected-policy-info.md
+++ /dev/null
@@ -1,50 +0,0 @@
----
-sidebar_position: 0
----
-
-# 内置拒绝策略
-
-内置两种拒绝策略说明:
-
-**RunsOldestTaskPolicy**:添加新任务并由主线程运行最早的任务。
-
-```java
-public class RunsOldestTaskPolicy implements RejectedExecutionHandler {
-
- @Override
- public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
- if (executor.isShutdown()) {
- return;
- }
- BlockingQueue workQueue = executor.getQueue();
- Runnable firstWork = workQueue.poll();
- boolean newTaskAdd = workQueue.offer(r);
- if (firstWork != null) {
- firstWork.run();
- }
- if (!newTaskAdd) {
- executor.execute(r);
- }
- }
-}
-```
-
-**SyncPutQueuePolicy**:主线程把拒绝任务以阻塞的方式添加到队列。
-
-```java
-@Slf4j
-public class SyncPutQueuePolicy implements RejectedExecutionHandler {
-
- @Override
- public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
- if (executor.isShutdown()) {
- return;
- }
- try {
- executor.getQueue().put(r);
- } catch (InterruptedException e) {
- log.error("Adding Queue task to thread pool failed.", e);
- }
- }
-}
-```
\ No newline at end of file
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/_category_.json
deleted file mode 100644
index 72b1e151..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "快速开始",
- "position": 3,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/_category_.json
deleted file mode 100644
index 78b3d9c4..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/_category_.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "label": "依赖配置中心",
- "position": 2,
- "collapsed": true
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/hippo4j-config-default.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/hippo4j-config-default.md
deleted file mode 100644
index 9c9e0fc9..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/hippo4j-config-default.md
+++ /dev/null
@@ -1,45 +0,0 @@
----
-sidebar_position: 4
----
-
-# 参数默认配置
-
-曾有多名小伙伴反馈说,项目中线程池一多,配置文件中配置就显得很臃肿。为此 hippo4j-config 开发出了动态线程池默认配置。
-
-```yaml
-spring:
- dynamic:
- thread-pool:
- default-executor:
- core-pool-size: 4
- maximum-pool-size: 6
- blocking-queue: ResizableCapacityLinkedBlockingQueue
- queue-capacity: 1024
- execute-time-out: 1000
- keep-alive-time: 9999
- rejected-handler: AbortPolicy
- active-alarm: 90
- capacity-alarm: 85
- alarm: true
- allow-core-thread-time-out: true
- notify:
- interval: 5
- receives: chen.ma
- executors:
- - thread-pool-id: message-produce
- - thread-pool-id: message-consume
- core-pool-size: 80
- maximum-pool-size: 100
- execute-time-out: 1000
- notify:
- interval: 6
- receives: chen.ma
-```
-
-`spring.dynamic.thread-pool.executors` 层级下,仅需要配置 `thread-pool-id`,其余配置从 `spring.dynamic.thread-pool.default-executor` 读取。
-
-如果 `spring.dynamic.thread-pool.executors` 下配置和 `spring.dynamic.thread-pool.default-executor` 冲突,以前者为主。
-
-通过该自定义配置方式,可减少大量重复线程池参数配置项,提高核心配置简洁度。
-
-提示:`spring.dynamic.thread-pool.default-executor` 层级下参数,不提供动态刷新功能。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/hippo4j-config-monitor.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/hippo4j-config-monitor.md
deleted file mode 100644
index 17d665e6..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/hippo4j-config-monitor.md
+++ /dev/null
@@ -1,122 +0,0 @@
----
-sidebar_position: 3
----
-
-# 线程池监控
-
-## 线程池监控配置
-
-监控前置条件:需要先完成 hippo4j-config 的 [接入工作](/docs/user_docs/getting_started/config/hippo4j-config-start)。
-
-接下来引入 SpringBoot Actuator。Spring 2.x 一般都有版本指定,所以这里不用写版本号。
-
-```xml
-
- io.micrometer
- micrometer-registry-prometheus
-
-
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-```
-
-添加动态线程池监控相关配置:
-
-```yaml
-management:
- metrics:
- export:
- prometheus:
- enabled: true
- server:
- port: 29999 # 可选配置,如果不配置该 port,直接使用 ${server.port}
- endpoints:
- web:
- exposure:
- include: '*' # 测试使用,开启了所有端点,生产环境不建议 *
-spring:
- dynamic:
- thread-pool:
- monitor:
- enable: true # 是否开启采集线程池运行时数据
- collect-interval: 5000 # 采集线程池运行数据频率
- collect-types: micrometer # 采集线程池运行数据的类型。eg:log、micrometer。多个可以同时使用,默认 micrometer
- initial-delay: 10000 # 项目启动后延迟多久进行采集
- thread-pool-types: dynamic # 采集线程池的类型。eg:dynamic、web、adapter。可任意配置,默认 dynamic
-```
-
-项目启动,访问 `http://localhost:29999/actuator/prometheus` 出现 `dynamic_thread_pool_` 前缀的指标,即为成功。
-
-
-
-## 配置 Prometheus
-
-通过 Docker 启动 Prometheus 服务。
-
-```shell
-docker run -d -p 9090:9090 --name prometheus prom/prometheus
-```
-
-添加 Prometheus 抽取数据任务。
-
-```shell
-# 进入 prometheus 容器内部
-docker exec -it prometheus /bin/sh
-# 编辑 prometheus 配置文件
-vi /etc/prometheus/prometheus.yml
-```
-
-scrape_configs 节点下新添加一个 job,如果 Prometheus 是 Docker 方式部署,`{scrape_configs.static_configs.targets}` 需要写本机的 IP。
-
-```yaml
-scrape_configs:
- - job_name: 'dynamic-thread-pool-job'
- scrape_interval: 5s
- metrics_path: '/actuator/prometheus'
- static_configs:
- - targets: [ '127.0.0.1:29999' ]
-```
-
-配置成功后 `exit` 退出容器,并进行 Prometheus 容器重启 `docker restart prometheus`。
-
-访问 Prometheus 控制台 `http://localhost:9090/graph` 路径,能够展示相关指标即为配置成功。
-
-
-
-## 配置 Grafana
-
-```shell
-docker run -d -p 3000:3000 --name=grafana grafana/grafana
-```
-
-访问 Grafana 地址,[http://localhost:3000](http://localhost:3000) 用户名密码:`admin`
-
-Grafana 访问 `http://localhost:3000/datasources` 导入 Prometheus 数据源。
-
-
-
-> 如果 Prometheus 为 Docker 方式部署,HTTP URL 需要为本地 IP,比如:http://192.168.1.5:9090
-
-关注公众号 `龙台的技术笔记`,回复:`监控`,获取 Hippo4j Grafana DashBoard JSON 配置。
-
-| 公众号 | 回复关键词 |
-|:------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------:|
-|  |  |
-
-获取到 JSON 文件后,通过 `http://localhost:3000/dashboard/import` 将 JSON 文件导入至 Grafana DashBoard。
-
-
-
-下拉框内动态选择创建好的 Prometheus 数据源,并点击 `Import`。
-
-
-
-即可使用炫酷的 Hippo4j 动态线程池监控 DashBoard。大家伙儿也可以根据个人喜好进行定制 DashBoard,如果觉得有优化点,欢迎和我联系贡献。
-
-
-
-如果项目客户端启动多个示例,动态线程池监控效果图如下:
-
-
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/hippo4j-config-more.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/hippo4j-config-more.md
deleted file mode 100644
index 09452013..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/hippo4j-config-more.md
+++ /dev/null
@@ -1,80 +0,0 @@
----
-sidebar_position: 3
----
-
-# 个性化配置
-
-以下所述特性自 hippo4j-config v1.4.2 及以上版本提供,由 hippo4j 核心开发者 [@pizihao](https://github.com/pizihao) 完成相应功能开发。
-
-## 需求背景
-
-**1)容器及三方框架线程池自定义启用**
-
-最初设计容器线程池和三方框架线程池的动态变更是和启动无关的。也就是说,启动时不会根据配置文件中相关参数去修改两者对应的线程池配置。
-
-这么设计的初衷是因为,不想让 hippo4j 过多的去介入框架原有的功能。因为容器和三方框架都支持线程池参数的自定义。
-
-也就造成,可能你在配置中心配置了对应的容器和三方框架线程池参数,启动时是无效的。但当修改配置文件任一配置,容器和三方框架线程池配置将生效。
-
-为了更好的用户体验,决定加入启用标识来控制:是否在项目初始化启动时,对容器和三方框架线程池参数进行修改。
-
-**2)客户端集群个性化配置**
-
-大家都知道,hippo4j-config 是依赖配置中心做线程池配置动态变更。这种模式有一种缺点:改动配置文件后,所有客户端都会变更。
-
-有些小伙伴希望 hippo4j-config 能够像 hippo4j-server 一样,能够针对单独的客户端进行配置变更。
-
-## 容器及三方框架线程池自定义启用
-
-容器及三方框架线程池添加启用配置,为了保持统一,动态线程池配置中也有该参数配置。配置项默认开启。
-
-```yaml
-spring:
- dynamic:
- thread-pool:
- web:
- enable: true
- executors:
- - thread-pool-id: message-consume
- enable: false
- adapter-executors:
- - threadPoolKey: 'input'
- enable: true
-```
-
-## 客户端集群个性化配置
-
-分别在动态线程池、容器线程池以及三方框架线程池配置下增加 `nodes` 配置节点,通过该配置可匹配需要变更的节点。
-
-```yaml
-spring:
- dynamic:
- thread-pool:
- web:
- nodes: 192.168.1.5:*,192.168.1.6:8080
- executors:
- - thread-pool-id: message-consume
- nodes: 192.168.1.5:*
- adapter-executors:
- - threadPoolKey: 'input'
- nodes: 192.168.1.5:*
-```
-
-来一段代码方法中的注释,大家就基本明白如何使用了。
-
-```java
-/**
- * Matching nodes
- * nodes is ip + port.Get 'nodes' in the new Properties,Compare this with the ip + port of Application.
- * support prefix pattern matching. e.g:
- *
- * 192.168.1.5:* -- Matches all ports of 192.168.1.5
- * 192.168.1.*:2009 -- Matches 2009 port of 192.168.1.*
- * * -- all
- * empty -- all
- *
- * The format of ip + port is ip : port.
- */
-```
-
-`nodes` 可与 `enable` 同时使用。如此,基于配置中心的动态线程池实现方式,将能够更方便的支持个性化需求。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/hippo4j-config-springboot1x-adapter.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/hippo4j-config-springboot1x-adapter.md
deleted file mode 100644
index a1885e0c..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/hippo4j-config-springboot1x-adapter.md
+++ /dev/null
@@ -1,121 +0,0 @@
----
-sidebar_position: 5
----
-
-# 适配SpringBoot1x
-
-目前已支持 Nacos、Apollo 配置中心适配 SpringBoot 1.5.x 版本。
-
-```xml
-
- cn.hippo4j
- hippo4j-config-spring-boot-1x-starter
- 1.5.0
-
-```
-
-Nacos SpringBoot 配置如下:
-
-```yaml
-spring:
- cloud:
- nacos:
- config:
- ext-config:
- - data-id: hippo4j-nacos.yaml
- group: DEFAULT_GROUP
- refresh: true
- server-addr: 127.0.0.1:8848
- dynamic:
- thread-pool:
- config-file-type: yml
- nacos:
- data-id: hippo4j-nacos.yaml
- group: DEFAULT_GROUP
-```
-
-Apollo SpringBoot 配置如下:
-
-```yaml
-apollo:
- autoUpdateInjectedSpringProperties: true
- bootstrap:
- eagerLoad:
- enabled: true
- enabled: true
- namespaces: application
- meta: http://127.0.0.1:8080
-app:
- id: dynamic-threadpool-example
-spring:
- dynamic:
- thread-pool:
- apollo:
- namespace: application
-```
-
-动态线程池通用配置如下:
-
-```yaml
-management:
- context-path: /actuator
- security:
- enabled: false
-server:
- port: 8091
- servlet:
- context-path: /example
-spring:
- application:
- name: dynamic-threadpool-example
- dynamic:
- thread-pool:
- banner: true
- check-state-interval: 5
- collect-type: micrometer
- config-file-type: properties
- enable: true
- executors:
- - active-alarm: 80
- alarm: true
- allow-core-thread-time-out: true
- blocking-queue: LinkedBlockingQueue
- capacity-alarm: 80
- core-pool-size: 1
- execute-time-out: 1000
- keep-alive-time: 6691
- maximum-pool-size: 1
- notify:
- interval: 8
- receives: chen.ma
- queue-capacity: 1
- rejected-handler: AbortPolicy
- thread-name-prefix: message-consume
- thread-pool-id: message-consume
- - active-alarm: 80
- alarm: true
- allow-core-thread-time-out: true
- blocking-queue: LinkedBlockingQueue
- capacity-alarm: 80
- core-pool-size: 1
- execute-time-out: 1000
- keep-alive-time: 6691
- maximum-pool-size: 1
- notify:
- interval: 8
- receives: chen.ma
- queue-capacity: 1
- rejected-handler: AbortPolicy
- thread-name-prefix: message-produce
- thread-pool-id: message-produce
- notify-platforms:
- - platform: WECHAT
- token: ac0426a5-c712-474c-9bff-72b8b8f5caff
- profiles:
- active: dev
-```
-
-具体 Demo 运行请参考以下示例模块,已验证对应线程池动态变更、报警以及运行时监控功能。
-
-- `/hippo4j-config-nacos-spring-boot-1x-starter-example`
-- `hippo4j-example/hippo4j-config-apollo-spring-boot-1x-starter-example`
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/hippo4j-config-start.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/hippo4j-config-start.md
deleted file mode 100644
index 6ead578b..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/config/hippo4j-config-start.md
+++ /dev/null
@@ -1,193 +0,0 @@
----
-sidebar_position: 1
----
-
-# 接入流程
-
-Nacos、Apollo、Zookeeper、ETCD、Polaris、Consul 配置中心任选其一。
-
-## hippo4j 配置
-
-```xml
-
- cn.hippo4j
- hippo4j-config-spring-boot-starter
- 1.5.0
-
-```
-
-启动类上添加注解 `@EnableDynamicThreadPool`。
-
-```java
-@SpringBootApplication
-@EnableDynamicThreadPool
-public class ExampleApplication {
- public static void main(String[] args) {
- SpringApplication.run(ExampleApplication.class, args);
- }
-}
-```
-
-SpringBoot 应用配置文件添加:
-
-```yaml
-server:
- port: 8090
- servlet:
- context-path: /example
-
-spring:
- profiles:
- active: dev
-
- dynamic:
- thread-pool:
- # 是否开启动态线程池
- enable: true
- # 是否打印 banner
- banner: true
- # 是否开启线程池数据采集,对接 Micrometer、ES、Log 等
- collect: true
- # 检查线程池状态,是否达到报警条件,单位毫秒
- check-state-interval: 3000
- # 通知报警平台,请替换为自己创建的群机器人
- notify-platforms:
- - platform: 'WECHAT'
- token: xxx
- - platform: 'DING'
- token: xxx
- secret: xxx # 加签专属
- - platform: 'LARK'
- token: xxx
- # Nacos、Apollo、Zookeeper、ETCD、Polaris、Consul 任选其一
- nacos:
- data-id: xxx
- group: xxx
- apollo:
- namespace: xxxx
- # 配置中心文件格式
- config-file-type: yml
- # 支持 tomcat、undertow、jetty 三种容器线程池
- web:
- core-pool-size: 100
- maximum-pool-size: 200
- keep-alive-time: 1000
- # 全局通知配置-是否报警
- alarm: true
- # 活跃度报警阈值;假设线程池最大线程数 10,当线程数达到 8 发起报警
- active-alarm: 80
- # 容量报警阈值;假设阻塞队列容量 100,当容量达到 80 发起报警
- capacity-alarm: 80
- # 报警间隔,同一线程池下同一报警纬度,在 interval 时间内只会报警一次,单位秒
- alarm-interval: 8
- # 企业微信填写用户 ID(填写其它将无法达到 @ 效果)、钉钉填手机号、飞书填 ou_ 开头唯一 ID
- receives: xxx
- # 动态线程池列表
- executors:
- - thread-pool-id: 'message-consume'
- # 核心线程数
- core-pool-size: 1
- # 最大线程数
- maximum-pool-size: 1
- # 阻塞队列名称,参考 BlockingQueueTypeEnum,支持 SPI
- blocking-queue: 'LinkedBlockingQueue'
- # 阻塞队列大小
- queue-capacity: 1
- # 执行超时时间,超过此时间发起报警,单位毫秒
- execute-time-out: 1000
- # 拒绝策略名称,参考 RejectedPolicyTypeEnum,支持 SPI
- rejected-handler: 'AbortPolicy'
- # 线程存活时间,单位秒
- keep-alive-time: 1024
- # 是否允许核心线程超时
- allow-core-thread-time-out: true
- # 线程工厂名称前缀
- thread-name-prefix: 'message-consume'
- # 是否报警
- alarm: true
- # 活跃度报警阈值;假设线程池最大线程数 10,当线程数达到 8 发起报警
- active-alarm: 80
- # 容量报警阈值;假设阻塞队列容量 100,当容量达到 80 发起报警
- capacity-alarm: 80
- # 通知配置,线程池中通知配置如果存在,则会覆盖全局通知配置
- notify:
- # 报警间隔,同一线程池下同一报警纬度,在 interval 时间内只会报警一次,单位分钟
- interval: 8
- # 企业微信填写用户 ID(填写其它将无法达到 @ 效果)、钉钉填手机号、飞书填 ou_ 开头唯一 ID
- receives: xxx
- - thread-pool-id: 'message-produce'
- core-pool-size: 1
- maximum-pool-size: 1
- queue-capacity: 1
- execute-time-out: 1000
- blocking-queue: 'LinkedBlockingQueue'
- rejected-handler: 'AbortPolicy'
- keep-alive-time: 1024
- allow-core-thread-time-out: true
- thread-name-prefix: 'message-consume'
- alarm: true
- active-alarm: 80
- capacity-alarm: 80
- notify:
- interval: 8
- receives: xxx
-```
-
-## ThreadPoolExecutor 适配
-
-添加线程池配置类,通过 `@DynamicThreadPool` 注解修饰。`threadPoolId` 为服务端创建的线程池 ID。
-
-```java
-package cn.hippo4j.example;
-
-import cn.hippo4j.core.executor.DynamicThreadPool;
-import cn.hippo4j.core.executor.support.ThreadPoolBuilder;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import java.util.concurrent.ThreadPoolExecutor;
-
-@Configuration
-public class ThreadPoolConfig {
-
- @Bean
- @DynamicThreadPool
- public ThreadPoolExecutor messageConsumeDynamicExecutor() {
- String threadPoolId = "message-consume";
- ThreadPoolExecutor messageConsumeDynamicExecutor = ThreadPoolBuilder.builder()
- .threadFactory(threadPoolId)
- .threadPoolId(threadPoolId)
- .dynamicPool()
- .build();
- return messageConsumeDynamicExecutor;
- }
-
- @Bean
- @DynamicThreadPool
- public ThreadPoolExecutor messageProduceDynamicExecutor() {
- String threadPoolId = "message-produce";
- ThreadPoolExecutor messageProduceDynamicExecutor = ThreadPoolBuilder.builder()
- .threadFactory(threadPoolId)
- .threadPoolId(threadPoolId)
- .dynamicPool()
- .build();
- return messageProduceDynamicExecutor;
- }
-
-}
-```
-
-通过 ThreadPoolBuilder 构建动态线程池,只有 threadFactory、threadPoolId 为必填项,其它参数会从配置中心拉取。
-
-项目中使用上述定义的动态线程池,如下所示:
-
-```java
-@Resource
-private ThreadPoolExecutor messageConsumeDynamicExecutor;
-
-messageConsumeDynamicExecutor.execute(() -> xxx);
-
-@Resource
-private ThreadPoolExecutor messageProduceDynamicExecutor;
-
-messageProduceDynamicExecutor.execute(() -> xxx);
-```
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/difference.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/difference.md
deleted file mode 100644
index 549da02d..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/difference.md
+++ /dev/null
@@ -1,37 +0,0 @@
----
-sidebar_position: 0
----
-
-# 运行模式介绍
-
-1.1.0 版本发布后,Hippo4j 分为两种使用模式:轻量级依赖配置中心以及无中间件依赖版本。
-
-
-
-### Hippo4j config
-
-**轻量级动态线程池管理**,依赖 Nacos、Apollo、Zookeeper、ETCD、Polaris、Consul 等三方配置中心(任选其一)完成线程池参数动态变更,支持运行时报警、监控等功能。
-
-> 监控功能配置详见:[线程池监控](/docs/user_docs/getting_started/config/hippo4j-config-monitor)
-
-
-
-### Hippo4j server
-
-**部署 Hippo4j server 服务**,通过可视化 Web 界面完成线程池的创建、变更以及查看,不依赖三方中间件。
-
-相比较 Hippo4j config,功能会更强大,但同时也引入了一定的复杂性。需要部署一个 Java 服务,以及依赖 MySQL 数据库。
-
-
-
-### 使用总结
-
-| | Hippo4j config | Hippo4j server |
-| ---- |-------------------------------------------------------|--------------------------------------------------------|
-| 依赖 | Nacos、Apollo、Zookeeper、ETCD、Polaris、Consul 配置中心(任选其一) | 部署 Hippo4j server(内部无依赖中间件) |
-| 使用 | 配置中心补充线程池相关参数 | Hippo4j server web 控制台添加线程池记录 |
-| 功能 | 包含基础功能:参数动态化、运行时监控、报警等 | 基础功能之外扩展控制台界面、线程池堆栈查看、线程池运行信息实时查看、历史运行信息查看、线程池配置集群个性化等 |
-
-使用建议:根据公司情况选择,如果基本功能可以满足使用,选择 Hippo4j config 使用即可;如果希望更多的功能,可以选择 Hippo4j server。
-
-**两者在进行替换的时候,无需修改业务代码**。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/hippo4j-adapter.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/hippo4j-adapter.md
deleted file mode 100644
index 68a48288..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/hippo4j-adapter.md
+++ /dev/null
@@ -1,72 +0,0 @@
----
-sidebar_position: 6
----
-
-# 三方框架线程池适配
-
-Hippo4j 目前已支持的三方框架线程池列表:
-
-- Dubbo
-- Hystrix
-- RabbitMQ
-- RocketMQ
-- AlibabaDubbo
-- RocketMQSpringCloudStream
-- RabbitMQSpringCloudStream
-
-引入 Hippo4j Server 或 Core 的 Maven Jar 坐标后,还需要引入对应的框架适配 Jar:
-
-```xml
-
- cn.hippo4j
-
- hippo4j-spring-boot-starter-adapter-dubbo
-
- hippo4j-spring-boot-starter-adapter-alibaba-dubbo
-
- hippo4j-spring-boot-starter-adapter-hystrix
-
- hippo4j-spring-boot-starter-adapter-rabbitmq
-
- hippo4j-spring-boot-starter-adapter-rocketmq
-
- hippo4j-spring-boot-starter-adapter-spring-cloud-stream-rocketmq
-
- hippo4j-spring-boot-starter-adapter-spring-cloud-stream-rabbitmq
- 1.5.0
-
-```
-
-如果想省事,仅需引入一个全量包,框架底层会根据条件判断加载具体线程池适配器。
-
-```xml
-
- cn.hippo4j
- hippo4j-spring-boot-starter-adapter-all
- 1.5.0
-
-```
-
-## Hippo4j Server
-
-Hippo4j Server 仅需要引入上述 Jar 包,即可在 Hippo4j Server 的控制台进行查看及修改三方框架线程池。
-
-
-
-## Hippo4j Config
-
-Hippo4j Config 除了依赖上述适配 Jar 包外,还需要在配置中心添加以下配置项。
-
-```yaml
-spring:
- dynamic:
- thread-pool:
- # 省略其它配置
- adapter-executors:
- # threadPoolKey 代表线程池标识
- - threadPoolKey: 'input'
- # mark 为三方线程池框架类型,参见文初已支持框架集合
- mark: 'RocketMQSpringCloudStream'
- corePoolSize: 10
- maximumPoolSize: 10
-```
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/img/docsVersionDropdown.png b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/img/docsVersionDropdown.png
deleted file mode 100644
index 97e41646..00000000
Binary files a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/img/docsVersionDropdown.png and /dev/null differ
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/img/grafana-monitor.jpg b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/img/grafana-monitor.jpg
deleted file mode 100644
index 336bd980..00000000
Binary files a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/img/grafana-monitor.jpg and /dev/null differ
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/img/localeDropdown.png b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/img/localeDropdown.png
deleted file mode 100644
index e257edc1..00000000
Binary files a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/img/localeDropdown.png and /dev/null differ
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/server/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/server/_category_.json
deleted file mode 100644
index 4063c17f..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/server/_category_.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "label": "无中间件依赖",
- "position": 3,
- "collapsed": true
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/server/hippo4j-server-config.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/server/hippo4j-server-config.md
deleted file mode 100644
index e1ef853f..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/server/hippo4j-server-config.md
+++ /dev/null
@@ -1,19 +0,0 @@
----
-sidebar_position: 3
----
-
-# 服务端配置
-
-`hippo4j.core.clean-history-data-enable`
-
-是否开启线程池历史数据清洗,默认开启。
-
-`hippo4j.core.clean-history-data-period`
-
-线程池历史数据保留时间,默认值:30,单位分钟。
-
-服务端会保留这个配置时间的数据,超过这个时间则会被清理。比如按照默认值 30 分钟来说,12:00 收集到的数据,12:30 就会被清理删除。
-
-`hippo4j.core.monitor.report-type`
-
-客户端监控上报服务端类型,可选值:http、netty,默认 http。服务端开启 netty 配置后,需要在客户端对应开启才可生效。用来应对大量动态线程池监控场景。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/server/hippo4j-server-monitor.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/server/hippo4j-server-monitor.md
deleted file mode 100644
index 08d89fa2..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/server/hippo4j-server-monitor.md
+++ /dev/null
@@ -1,132 +0,0 @@
----
-sidebar_position: 2
----
-
-# 线程池监控
-
-Server 模式默认内置线程池运行时采集和监控功能,如果想要使用 Prometheus + Grafana 的方式可以查看以下内容。
-
-## 线程池监控配置
-
-接下来引入 SpringBoot Actuator。Spring 2.x 一般都有版本指定,所以这里不用写版本号。
-
-```xml
-
- io.micrometer
- micrometer-registry-prometheus
-
-
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-```
-
-添加动态线程池监控相关配置:
-
-```yaml
-management:
- metrics:
- export:
- prometheus:
- enabled: true
- server:
- port: 29999 # 可选配置,如果不配置该 port,直接使用 ${server.port}
- endpoints:
- web:
- exposure:
- include: '*' # 测试使用,开启了所有端点,生产环境不建议 *
-spring:
- dynamic:
- thread-pool:
- monitor:
- enable: true # 是否开启采集线程池运行时数据
- collect-interval: 5000 # 采集线程池运行数据频率
- collect-types: server,micrometer # 采集线程池运行数据的类型。eg:server、micrometer。多个可以同时使用,默认 server
- initial-delay: 10000 # 项目启动后延迟多久进行采集
- thread-pool-types: dynamic # 采集线程池的类型。eg:dynamic、web、adapter。可任意配置,默认 dynamic
-```
-
-如果使用 `micrometer` 类型的监控指标,需要添加以下依赖。
-
-```xml
-
- cn.hippo4j
- hippo4j-spring-boot-starter-monitor-micrometer
- 1.5.0
-
-```
-
-项目启动,访问 `http://localhost:29999/actuator/prometheus` 出现 `dynamic_thread_pool_` 前缀的指标,即为成功。
-
-
-
-## 配置 Prometheus
-
-通过 Docker 启动 Prometheus 服务。
-
-```shell
-docker run -d -p 9090:9090 --name prometheus prom/prometheus
-```
-
-添加 Prometheus 抽取数据任务。
-
-```shell
-# 进入 prometheus 容器内部
-docker exec -it prometheus /bin/sh
-# 编辑 prometheus 配置文件
-vi /etc/prometheus/prometheus.yml
-```
-
-scrape_configs 节点下新添加一个 job,如果 Prometheus 是 Docker 方式部署,`{scrape_configs.static_configs.targets}` 需要写本机的 IP。
-
-```yaml
-scrape_configs:
- - job_name: 'dynamic-thread-pool-job'
- scrape_interval: 5s
- metrics_path: '/actuator/prometheus'
- static_configs:
- - targets: [ '127.0.0.1:29999' ]
-```
-
-配置成功后 `exit` 退出容器,并进行 Prometheus 容器重启 `docker restart prometheus`。
-
-访问 Prometheus 控制台 `http://localhost:9090/graph` 路径,能够展示相关指标即为配置成功。
-
-
-
-## 配置 Grafana
-
-```shell
-docker run -d -p 3000:3000 --name=grafana grafana/grafana
-```
-
-访问 Grafana 地址,[http://localhost:3000](http://localhost:3000) 用户名密码:`admin`
-
-Grafana 访问 `http://localhost:3000/datasources` 导入 Prometheus 数据源。
-
-
-
-> 如果 Prometheus 为 Docker 方式部署,HTTP URL 需要为本地 IP,比如:http://192.168.1.5:9090
-
-关注公众号 `龙台的技术笔记`,回复:`监控`,获取 Hippo4j Grafana DashBoard JSON 配置。
-
-| 公众号 | 回复关键词 |
-|:------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------:|
-|  |  |
-
-获取到 JSON 文件后,通过 `http://localhost:3000/dashboard/import` 将 JSON 文件导入至 Grafana DashBoard。
-
-
-
-下拉框内动态选择创建好的 Prometheus 数据源,并点击 `Import`。
-
-
-
-即可使用炫酷的 Hippo4j 动态线程池监控 DashBoard。大家伙儿也可以根据个人喜好进行定制 DashBoard,如果觉得有优化点,欢迎和我联系贡献。
-
-
-
-如果项目客户端启动多个示例,动态线程池监控效果图如下:
-
-
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/server/hippo4j-server-start.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/server/hippo4j-server-start.md
deleted file mode 100644
index 17ec5224..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/getting_started/server/hippo4j-server-start.md
+++ /dev/null
@@ -1,127 +0,0 @@
----
-sidebar_position: 1
----
-
-# 接入流程
-
-部署服务端,参考 [部署手册](/docs/user_docs/ops/hippo4j-server-deploy)。
-
-服务端创建 [租户、项目](/community/faq#租户和项目在-hippo4j-中是什么意思) 和线程池记录。
-
-需要注意,项目 ID 需要与配置文件 `{application.name}` 保持一致。
-
-:::note
-租户、项目、线程池 ID 如果由多个词组成,建议以 - 进行分割。比如:message-center。
-:::
-
-## Hippo4j 配置
-
-SpringBoot Pom 引入 Hippo4j Starter Jar。
-
-```xml
-
- cn.hippo4j
- hippo4j-spring-boot-starter
- 1.5.0
-
-```
-
-启动类上添加注解 `@EnableDynamicThreadPool`。
-
-```java
-@SpringBootApplication
-@EnableDynamicThreadPool
-public class ExampleApplication {
- public static void main(String[] args) {
- SpringApplication.run(ExampleApplication.class, args);
- }
-}
-```
-
-SpringBoot 应用配置文件添加:
-
-```yaml
-spring:
- profiles:
- active: dev
- application:
- # 服务端创建的项目 id 需要与 application.name 保持一致
- name: dynamic-threadpool-example
- dynamic:
- thread-pool:
- # 服务端地址
- server-addr: http://localhost:6691
- # 用户名
- username: admin
- # 密码
- password: 123456
- # 租户 id, 对应 tenant 表
- namespace: prescription
- # 项目 id, 对应 item 表
- item-id: ${spring.application.name}
-```
-
-## ThreadPoolExecutor 适配
-
-添加线程池配置类,通过 `@DynamicThreadPool` 注解修饰。`threadPoolId` 为服务端创建的线程池 ID。
-
-```java
-package cn.hippo4j.example;
-
-import cn.hippo4j.core.executor.DynamicThreadPool;
-import cn.hippo4j.core.executor.support.ThreadPoolBuilder;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import java.util.concurrent.ThreadPoolExecutor;
-
-@Configuration
-public class ThreadPoolConfig {
-
- @Bean
- @DynamicThreadPool
- public ThreadPoolExecutor messageConsumeDynamicExecutor() {
- String threadPoolId = "message-consume";
- ThreadPoolExecutor messageConsumeDynamicExecutor = ThreadPoolBuilder.builder()
- .threadFactory(threadPoolId)
- .threadPoolId(threadPoolId)
- .dynamicPool()
- .build();
- return messageConsumeDynamicExecutor;
- }
-
- @Bean
- @DynamicThreadPool
- public ThreadPoolExecutor messageProduceDynamicExecutor() {
- String threadPoolId = "message-produce";
- ThreadPoolExecutor messageProduceDynamicExecutor = ThreadPoolBuilder.builder()
- .threadFactory(threadPoolId)
- .threadPoolId(threadPoolId)
- .dynamicPool()
- .build();
- return messageProduceDynamicExecutor;
- }
-
-}
-```
-
-通过 ThreadPoolBuilder 构建动态线程池,只有 threadFactory、threadPoolId 为必填项,其它参数会从 hippo4j-server 服务拉取。
-
-:::note
-创建线程池时建议填充实际的参数。如果在连接 Hippo4j Server 端失败时,会使用填充配置创建线程池。
-:::
-
-项目中使用上述定义的动态线程池,如下所示:
-
-```java
-@Resource
-private ThreadPoolExecutor messageConsumeDynamicExecutor;
-
-messageConsumeDynamicExecutor.execute(() -> xxx);
-
-@Resource
-private ThreadPoolExecutor messageProduceDynamicExecutor;
-
-messageProduceDynamicExecutor.execute(() -> xxx);
-```
-
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/intro.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/intro.md
deleted file mode 100644
index af470274..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/intro.md
+++ /dev/null
@@ -1,70 +0,0 @@
----
-sidebar_position: 1
----
-
-# 简介
-
-## 线程池痛点
-
-线程池是一种基于池化思想管理线程的工具,使用线程池可以减少创建销毁线程的开销,避免线程过多导致系统资源耗尽。在高并发以及大批量的任务处理场景,线程池的使用是必不可少的。
-
-如果有在项目中实际使用线程池,相信你可能会遇到以下痛点:
-
-- 线程池随便定义,线程资源过多,造成服务器高负载。
-
-- 线程池参数不易评估,随着业务的并发提升,业务面临出现故障的风险。
-- 线程池任务执行时间超过平均执行周期,开发人员无法感知。
-- 线程池任务堆积,触发拒绝策略,影响既有业务正常运行。
-- 当业务出现超时、熔断等问题时,因为没有监控,无法确定是不是线程池引起。
-- 原生线程池不支持运行时变量的传递,比如 MDC 上下文遇到线程池就 GG。
-- 无法执行优雅关闭,当项目关闭时,大量正在运行的线程池任务被丢弃。
-- 线程池运行中,任务执行停止,怀疑发生死锁或执行耗时操作,但是无从下手。
-
-## 什么是 Hippo4j
-
-Hippo4j 通过对 JDK 线程池增强,以及扩展三方框架底层线程池等功能,为业务系统提高线上运行保障能力。
-
-提供以下功能支持:
-
-- 全局管控 - 管理应用线程池实例。
-
-- 动态变更 - 应用运行时动态变更线程池参数,包括不限于:核心、最大线程数、阻塞队列容量、拒绝策略等。
-- 通知报警 - 内置四种报警通知策略,线程池活跃度、容量水位、拒绝策略以及任务执行时间超长。
-- 运行监控 - 实时查看线程池运行时数据,最近半小时线程池运行数据图表展示。
-- 功能扩展 - 支持线程池任务传递上下文;项目关闭时,支持等待线程池在指定时间内完成任务。
-- 多种模式 - 内置两种使用模式:[依赖配置中心](https://hippo4j.cn/docs/user_docs/getting_started/config/hippo4j-config-start) 和 [无中间件依赖](https://hippo4j.cn/docs/user_docs/getting_started/server/hippo4j-server-start)。
-- 容器管理 - Tomcat、Jetty、Undertow 容器线程池运行时查看和线程数变更。
-- 框架适配 - Dubbo、Hystrix、RabbitMQ、RocketMQ 等消费线程池运行时数据查看和线程数变更。
-
-## 快速开始
-
-对于本地演示目的,请参阅 [Quick start](https://hippo4j.cn/docs/user_docs/user_guide/quick-start)
-
-演示环境: [http://console.hippo4j.cn/index.html](http://console.hippo4j.cn/index.html)
-
-## 接入登记
-
-更多接入的公司,欢迎在 [登记地址](https://github.com/opengoofy/hippo4j/issues/13) 登记,登记仅仅为了产品推广。
-
-## 联系我
-
-开源不易,右上角点个 Star 鼓励一下吧!
-
-如果大家想要实时关注 Hippo4j 更新的文章以及分享的干货的话,可以关注我的公众号。
-
-使用过程中有任何问题,或者对项目有什么建议,关注公众号回复:加群,和 1000+ 志同道合的朋友交流讨论。
-
-
-
-## 友情链接
-
-- [[ LiteFlow ]](https://liteflow.yomahub.com/):轻量,快速,稳定可编排的组件式规则引擎。
-
-- [[ Sa-Token ]](https://github.com/dromara/sa-token):一个轻量级 java 权限认证框架,让鉴权变得简单、优雅!
-- [[ HertzBeat ]](https://github.com/dromara/hertzbeat):易用友好的云监控系统, 无需 Agent, 强大自定义监控能力。
-- [[ JavaGuide ]](https://github.com/Snailclimb/JavaGuide):一份涵盖大部分 Java 程序员所需要掌握的核心知识。
-- [[ toBeBetterJavaer ]](https://github.com/itwanger/toBeBetterJavaer):一份通俗易懂、风趣幽默的 Java 学习指南。
-
-## 贡献者
-
-感谢所有为项目作出贡献的开发者。如果有意贡献,参考 [good first issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/ops/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/ops/_category_.json
deleted file mode 100644
index d5b7d1e8..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/ops/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "运维指南",
- "position": 4,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/ops/hippo4j-server-deploy.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/ops/hippo4j-server-deploy.md
deleted file mode 100644
index ffbc2306..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/ops/hippo4j-server-deploy.md
+++ /dev/null
@@ -1,45 +0,0 @@
----
-sidebar_position: 1
----
-
-# 源码包部署
-
-[RELEASE](https://github.com/opengoofy/hippo4j/releases) 页面下载对应版本并进行解压。
-
-## 初始化
-
-修改数据库相关信息。
-
-```txt
-/conf/application.properties
-```
-
-如果是新运行 Hippo4j,数据库执行下述 SQL 脚本即可。
-
-```txt
-/conf/hippo4j_manager.sql
-```
-
-如果是对已运行 Hippo4j 升级,请查看 `/conf/sql-upgrade` 目录下,是否有目标版本对应的升级脚本。
-
-## 直接运行
-
-Mac Linux 启动执行。
-
-```txt
-sh ./bin/startup.sh
-```
-
-Windows 启动执行。
-
-```txt
-bin/startup.cmd
-```
-
-## 访问控制台
-
-启动成功后,访问链接。用户名密码:admin 123456
-
-```txt
-localhost:6691/index.html
-```
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/ops/server-docker.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/ops/server-docker.md
deleted file mode 100644
index 0812b931..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/ops/server-docker.md
+++ /dev/null
@@ -1,55 +0,0 @@
----
-sidebar_position: 2
----
-
-# Docker部署
-
-## 镜像启动
-
-Docker 镜像默认使用内置 H2 数据库,数据持久化到 Docker 容器存储卷中。
-
-```shell
-docker run -d -p 6691:6691 --name hippo4j-server hippo4j/hippo4j-server
-```
-
-或者,底层存储数据库切换为 MySQL。`DATASOURCE_HOST` 需要切换为本地 IP,不能使用 `127.0.0.1` 或 `localhost`。
-
-```shell
-docker run -d -p 6691:6691 --name hippo4j-server \
--e DATASOURCE_MODE=mysql \
--e DATASOURCE_HOST=xxx.xxx.xxx.xxx \
--e DATASOURCE_PORT=3306 \
--e DATASOURCE_DB=hippo4j_manager \
--e DATASOURCE_USERNAME=root \
--e DATASOURCE_PASSWORD=root \
-hippo4j/hippo4j-server
-```
-
-访问 Server 控制台,路径 `http://localhost:6691/index.html` ,默认用户名密码:admin / 123456
-
-## 镜像构建
-
-如果想要自定义镜像,可以通过以下命令快速构建 Hippo4j Server:
-
-方式一:
-
-```shell
-# 进入到 threadpool/server/bootstrap 工程路径下
-mvn clean package -Dskip.spotless.apply=true
-# 进入到 docker 工程路径下
-# 默认打包是打包的 tag 是 latest
-docker build -t hippo4j/hippo4j-server ../docker
-
-# 构建多平台版本
-docker buildx build --platform linux/arm64 -t hippo4j/hippo4j-server ../docker
-docker buildx build --platform linux/amd64 -t hippo4j/hippo4j-server ../docker
-```
-
-方式二:
-
-通过 `maven docker plugin`
-
-```shell
-# 进入到 threadpool/server/bootstrap 工程路径下
-mvn clean package -DskipTests -Dskip.spotless.apply=true docker:build
-```
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/other/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/other/_category_.json
deleted file mode 100644
index a74d7432..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/other/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "其它",
- "position": 6,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/other/official-ccounts.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/other/official-ccounts.md
deleted file mode 100644
index 63e07ea7..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/other/official-ccounts.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-sidebar_position: 5
----
-
-# 推荐公众号
-
-## JavaGuide
-
-专注Java后端学习和大厂面试的公众号!
-
-
-
-## HelloGitHub
-
-HelloGitHub,专注于开源社区技术和知识内容分享。
-
-
-
-## macrozheng
-
-专注Java技术分享,解析优质开源项目。涵盖SpringBoot、SpringCloud、Docker、K8S等实用技术,作者Github开源项目mall(50K+Star)。
-
-
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/other/operation.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/other/operation.md
deleted file mode 100644
index 62661c55..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/other/operation.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-sidebar_position: 6
----
-
-# 公众号合作
-
-## 推荐须知
-
-hippo4j 作为一款新兴动态线程池框架,开源出来的时间比较晚,目前迫切需要不同的途径进行推广。
-
-如果您是公众号运营者或者开源爱好者,欢迎将 hippo4j 推荐给您的粉丝。
-
-1. 您无需为 hippo4j 专门撰写文案,只需要直接导入 [推荐文章](https://mp.weixin.qq.com/s/JTTwcBEiK_MnFcPTZl3zGA) 即可。
-2. 在文章底部或内容中留下项目官网或者 GitHub 仓库链接。
-3. 文章需至少 1000+ 的阅读量。
-
-作为推荐回报,hippo4j 可以为您:
-
-1. 在框架官方文档 [推荐公众号](/docs/user_docs/other/official-ccounts) 页面处留下您的公众号二维码。
-2. 在框架官方交流群里@全体成员推广您的公众号一次,附带介绍语。
-3. 您的公众号所有新推文章都可以将链接发送到 hippo4j 交流群中,增加阅读量。
-
-如果您还有除公众号以外的其它途径可以与 hippo4j 相互推荐,欢迎 [加群沟通](/group)。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/other/question.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/other/question.md
deleted file mode 100644
index 49fd4d77..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/other/question.md
+++ /dev/null
@@ -1,246 +0,0 @@
----
-sidebar_position: 3
----
-
-# 问题提问
-
-文档引用自:[提问的智慧](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)
-
-## 在提问之前
-
-在你准备要通过电子邮件、新闻群组或者聊天室提出技术问题前,请先做到以下事情:
-
-1. 尝试在你准备提问的论坛的旧文章中搜索答案。
-2. 尝试上网搜索以找到答案。
-3. 尝试阅读手册以找到答案。
-4. 尝试阅读常见问题文件(FAQ)以找到答案。
-5. 尝试自己检查或试验以找到答案。
-6. 向你身边的强者朋友打听以找到答案。
-7. 如果你是程序开发者,请尝试阅读源代码以找到答案。
-
-当你提出问题的时候,请先表明你已经做了上述的努力;这将有助于树立你并不是一个不劳而获且浪费别人的时间的提问者。如果你能一并表达在做了上述努力的过程中所**学到**的东西会更好,因为我们更乐于回答那些表现出能从答案中学习的人的问题。
-
-## 当你提问时
-
-### 慎选提问的论坛
-小心选择你要提问的场合。如果你做了下述的事情,你很可能被忽略掉或者被看作失败者:
-
-* 在与主题不合的论坛上贴出你的问题。
-* 在探讨进阶技术问题的论坛张贴非常初级的问题;反之亦然。
-* 在太多的不同新闻群组上重复转贴同样的问题(cross-post)。
-* 向既非熟人也没有义务解决你问题的人发送私人电邮。
-
-因此,第一步是找到对的论坛。再说一次,Google 和其它搜索引擎还是你的朋友,用它们来找到与你遭遇到困难的软硬件问题最相关的网站。通常那儿都有常见问题(FAQ)、邮件列表及相关说明文件的链接。如果你的努力(包括**阅读** FAQ)都没有结果,网站上也许还有报告 Bug(Bug-reporting)的流程或链接,如果是这样,链过去看看。
-
-### 使用有意义且描述明确的标题
-
-在邮件列表、新闻群组或论坛中,大约 50 字以内的标题是抓住资深专家注意力的好机会。别用喋喋不休的帮帮忙、跪求、急(更别说救命啊!!!!这样让人反感的话,用这种标题会被条件反射式地忽略)来浪费这个机会。不要妄想用你的痛苦程度来打动我们,而应该是在这点空间中使用极简单扼要的描述方式来提出问题。
-
-一个好标题范例是`目标 —— 差异`式的描述,许多技术支持组织就是这样做的。在`目标`部分指出是哪一个或哪一组东西有问题,在`差异`部分则描述与期望的行为不一致的地方。
-
-> 蠢问题:救命啊!我的笔记本电脑不能正常显示了!
-
-> 聪明问题:X.org 6.8.1 的鼠标指针会变形,某牌显卡 MV1005 芯片组。
-
-> 更聪明问题:X.org 6.8.1 的鼠标指针,在某牌显卡 MV1005 芯片组环境下 - 会变形。
-
-### 使用清晰、正确、精准且合乎语法的语句
-
-我们从经验中发现,粗心的提问者通常也会粗心地写程序与思考(我敢打包票)。回答粗心大意者的问题很不值得,我们宁愿把时间耗在别处。
-
-正确的拼写、标点符号和大小写是很重要的。一般来说,如果你觉得这样做很麻烦,不想在乎这些,那我们也觉得麻烦,不想在乎你的提问。花点额外的精力斟酌一下字句,用不着太僵硬与正式 —— 事实上,黑客文化很看重能准确地使用非正式、俚语和幽默的语句。但它**必须很**准确,而且有迹象表明你是在思考和关注问题。
-
-### 精确地描述问题并言之有物
-
-* 仔细、清楚地描述你的问题或 Bug 的症状。
-* 描述问题发生的环境(机器配置、操作系统、应用程序、以及相关的信息),提供经销商的发行版和版本号(如:`Fedora Core 4`、`Slackware 9.1`等)。
-* 描述在提问前你是怎样去研究和理解这个问题的。
-* 描述在提问前为确定问题而采取的诊断步骤。
-* 描述最近做过什么可能相关的硬件或软件变更。
-* 尽可能地提供一个可以`重现这个问题的可控环境`的方法。
-
-尽量去揣测一个黑客会怎样反问你,在你提问之前预先将黑客们可能提出的问题回答一遍。
-
-以上几点中,当你报告的是你认为可能在代码中的问题时,给黑客一个可以重现你的问题的环境尤其重要。当你这么做时,你得到有效的回答的机会和速度都会大大的提升。
-
-[Simon Tatham](http://www.chiark.greenend.org.uk/~sgtatham/) 写过一篇名为《[如何有效的报告 Bug](http://www.chiark.greenend.org.uk/~sgtatham/bugs-cn.html)》的出色文章。强力推荐你也读一读。
-
-### 话不在多而在精
-
-你需要提供精确有内容的信息。这并不是要求你简单的把成堆的出错代码或者资料完全转录到你的提问中。如果你有庞大而复杂的测试样例能重现程序挂掉的情境,尽量将它剪裁得越小越好。
-
-这样做的用处至少有三点。
-第一,表现出你为简化问题付出了努力,这可以使你得到回答的机会增加;
-第二,简化问题使你更有可能得到**有用**的答案;
-第三,在精炼你的 bug 报告的过程中,你很可能就自己找到了解决方法或权宜之计。
-
-### 别动辄声称找到 Bug
-
-当你在使用软件中遇到问题,除非你非常、**非常**的有根据,不要动辄声称找到了 Bug。提示:除非你能提供解决问题的源代码补丁,或者提供回归测试来表明前一版本中行为不正确,否则你都多半不够完全确信。这同样适用在网页和文件,如果你(声称)发现了文件的`Bug`,你应该能提供相应位置的修正或替代文件。
-
-请记得,还有其他许多用户没遇到你发现的问题,否则你在阅读文件或搜索网页时就应该发现了(你在抱怨前[已经做了这些,是吧](#在提问之前)?)。这也意味着很有可能是你弄错了而不是软件本身有问题。
-
-编写软件的人总是非常辛苦地使它尽可能完美。如果你声称找到了 Bug,也就是在质疑他们的能力,即使你是对的,也有可能会冒犯到其中某部分人。当你在标题中嚷嚷着有`Bug`时,这尤其严重。
-
-提问时,即使你私下非常确信已经发现一个真正的 Bug,最好写得像是**你**做错了什么。如果真的有 Bug,你会在回复中看到这点。这样做的话,如果真有 Bug,维护者就会向你道歉,这总比你惹恼别人然后欠别人一个道歉要好一点。
-
-### 低声下气不能代替你的功课
-
-有些人明白他们不该粗鲁或傲慢的提问并要求得到答复,但他们选择另一个极端 —— 低声下气:`我知道我只是个可悲的新手,一个撸瑟,但...`。这既使人困扰,也没有用,尤其是伴随着与实际问题含糊不清的描述时更令人反感。
-
-别用原始灵长类动物的把戏来浪费你我的时间。取而代之的是,尽可能清楚地描述背景条件和你的问题情况。这比低声下气更好地定位了你的位置。
-
-有时网页论坛会设有专为新手提问的版面,如果你真的认为遇到了初学者的问题,到那去就是了,但一样别那么低声下气。
-
-### 描述问题症状而非你的猜测
-
-告诉黑客们你认为问题是怎样造成的并没什么帮助。(如果你的推断如此有效,还用向别人求助吗?),因此要确信你原原本本告诉了他们问题的症状,而不是你的解释和理论;让黑客们来推测和诊断。如果你认为陈述自己的猜测很重要,清楚地说明这只是你的猜测,并描述为什么它们不起作用。
-
-**蠢问题**
-
-> 我在编译内核时接连遇到 SIG11 错误,
-> 我怀疑某条飞线搭在主板的走线上了,这种情况应该怎样检查最好?
-
-**聪明问题**
-
-> 我的组装电脑是 FIC-PA2007 主机板搭载 AMD K6/233 CPU(威盛 Apollo VP2 芯片组),
-> 256MB Corsair PC133 SDRAM 内存,在编译内核时,从开机 20 分钟以后就频频产生 SIG11 错误,
-> 但是在头 20 分钟内从没发生过相同的问题。重新启动也没有用,但是关机一晚上就又能工作 20 分钟。
-> 所有内存都换过了,没有效果。相关部分的标准编译记录如下…
-
-由于以上这点似乎让许多人觉得难以配合,这里有句话可以提醒你:`所有的诊断专家都来自密苏里州。` 美国国务院的官方座右铭则是:`让我看看`(出自国会议员 Willard D. Vandiver 在 1899 年时的讲话:`我来自一个出产玉米,棉花,牛蒡和民主党人的国家,滔滔雄辩既不能说服我,也不会让我满意。我来自密苏里州,你必须让我看看。`) 针对诊断者而言,这并不是一种怀疑,而只是一种真实而有用的需求,以便让他们看到的是与你看到的原始证据尽可能一致的东西,而不是你的猜测与归纳的结论。所以,大方的展示给我们看吧!
-
-### 按发生时间先后列出问题症状
-
-问题发生前的一系列操作,往往就是对找出问题最有帮助的线索。因此,你的说明里应该包含你的操作步骤,以及机器和软件的反应,直到问题发生。在命令行处理的情况下,提供一段操作记录(例如运行脚本工具所生成的),并引用相关的若干行(如 20 行)记录会非常有帮助。
-
-如果挂掉的程序有诊断选项(如 -v 的详述开关),试着选择这些能在记录中增加调试信息的选项。记住,`多`不等于`好`。试着选取适当的调试级别以便提供有用的信息而不是让读者淹没在垃圾中。
-
-如果你的说明很长(如超过四个段落),在开头简述问题,接下来再按时间顺序详述会有所帮助。这样黑客们在读你的记录时就知道该注意哪些内容了。
-
-### 描述目标而不是过程
-
-如果你想弄清楚如何做某事(而不是报告一个 Bug),在开头就描述你的目标,然后才陈述重现你所卡住的特定步骤。
-
-经常寻求技术帮助的人在心中有个更高层次的目标,而他们在自以为能达到目标的特定道路上被卡住了,然后跑来问该怎么走,但没有意识到这条路本身就有问题。结果要费很大的劲才能搞定。
-
-**蠢问题**
-
-> 我怎样才能从某绘图程序的颜色选择器中取得十六进制的 RGB 值?
-
-**聪明问题**
-
-> 我正试着用替换一幅图片的色码(color table)成自己选定的色码,我现在知道的唯一方法是编辑每个色码区块(table slot),
-> 但却无法从某绘图程序的颜色选择器取得十六进制的 RGB 值。
-
-第二种提问法比较聪明,你可能得到像是```建议采用另一个更合适的工具```的回复。
-
-### 清楚明确的表达你的问题以及需求
-
-漫无边际的提问是近乎无休无止的时间黑洞。最有可能给你有用答案的人通常也正是最忙的人(他们忙是因为要亲自完成大部分工作)。这样的人对无节制的时间黑洞相当厌恶,所以他们也倾向于厌恶那些漫无边际的提问。
-
-如果你明确表述需要回答者做什么(如提供指点、发送一段代码、检查你的补丁、或是其他等等),就最有可能得到有用的答案。因为这会定出一个时间和精力的上限,便于回答者能集中精力来帮你。这么做很棒。
-
-要理解专家们所处的世界,请把专业技能想像为充裕的资源,而回复的时间则是稀缺的资源。你要求他们奉献的时间越少,你越有可能从真正专业而且很忙的专家那里得到解答。
-
-所以,界定一下你的问题,使专家花在辨识你的问题和回答所需要付出的时间减到最少,这技巧对你有用答案相当有帮助 —— 但这技巧通常和简化问题有所区别。因此,问`我想更好地理解 X,可否指点一下哪有好一点说明?`通常比问`你能解释一下 X 吗?`更好。如果你的代码不能运作,通常请别人看看哪里有问题,比要求别人替你改正要明智得多。
-
-### 礼多人不怪,而且有时还很有帮助
-
-彬彬有礼,多用`请`和`谢谢您的关注`,或`谢谢你的关照`。让大家都知道你对他们花时间免费提供帮助心存感激。
-
-坦白说,这一点并没有比使用清晰、正确、精准且合乎语法和避免使用专用格式重要(也不能取而代之)。黑客们一般宁可读有点唐突但技术上鲜明的 Bug 报告,而不是那种有礼但含糊的报告。(如果这点让你不解,记住我们是按问题能教给我们什么来评价问题的价值的)
-
-然而,如果你有一串的问题待解决,客气一点肯定会增加你得到有用回应的机会。
-
-(我们注意到,自从本指南发布后,从资深黑客那里得到的唯一严重缺陷反馈,就是对预先道谢这一条。一些黑客觉得`先谢了`意味着事后就不用再感谢任何人的暗示。我们的建议是要么先说`先谢了`,**然后**事后再对回复者表示感谢,或者换种方式表达感激,譬如用`谢谢你的关注`或`谢谢你的关照`。)
-
-## 不该问的问题
-
-以下是几个经典蠢问题,以及黑客没回答时心中所想的:
-
-问题:[我能在哪找到 X 程序或 X 资源?](#q1)
-
-问题:[我怎样用 X 做 Y?](#q2)
-
-问题:[我的程序/设定/SQL 语句没有用](#q3)
-
-问题:[我的 Windows 电脑有问题,你能帮我吗?](#q4)
-
-问题:[我的程序不会动了,我认为系统工具 X 有问题](#q5)
-
-问题:[我在安装 Linux(或者 X )时有问题,你能帮我吗?](#q6)
-
-问题:[我怎么才能破解 root 帐号/窃取 OP 特权/读别人的邮件呢?](#q7)
-
----
-
-> 问题:我能在哪找到 X 程序或 X 资源?
-
-回答:就在我找到它的地方啊,白痴 —— 搜索引擎的那一头。天哪!难道还有人不会用 [Google](https://www.google.com) 吗?
-
-> 问题:我怎样用 X 做 Y?
-
-回答:如果你想解决的是 Y ,提问时别给出可能并不恰当的方法。这种问题说明提问者不但对 X 完全无知,也对 Y 要解决的问题糊涂,还被特定形势禁锢了思维。最好忽略这种人,等他们把问题搞清楚了再说。
-
-> 问题:我的{程序/设定/SQL 语句}没有用
-
-回答:这不算是问题吧,我对要我问你二十个问题才找得出你真正问题的问题没兴趣 —— 我有更有意思的事要做呢。在看到这类问题的时候,我的反应通常不外如下三种
-
-* 你还有什么要补充的吗?
-* 真糟糕,希望你能搞定。
-* 这关我屁事?
-
-> 问题:我的 Windows 电脑有问题,你能帮我吗?
-
-回答:能啊,扔掉微软的垃圾,换个像 Linux 或 BSD 的开源操作系统吧。
-
-注意:如果程序有官方版 Windows 或者与 Windows 有互动(如 Samba),你**可以**问与 Windows 相关的问题,只是别对问题是由 Windows 操作系统而不是程序本身造成的回复感到惊讶, 因为 Windows 一般来说实在太烂,这种说法通常都是对的。
-
-> 问题:我的程序不会动了,我认为系统工具 X 有问题
-
-回答:你完全有可能是第一个注意到被成千上万用户反复使用的系统调用与函数库文件有明显缺陷的人,更有可能的是你完全没有根据。不同凡响的说法需要不同凡响的证据,当你这样声称时,你必须有清楚而详尽的缺陷说明文件作后盾。
-
-> 问题:我在安装 Linux(或者 X )时有问题,你能帮我吗?
-
-回答:不能,我只有亲自在你的电脑上动手才能找到毛病。还是去找你当地的 Linux 使用群组者寻求实际的指导吧(你能在[这儿](http://www.linux.org/groups/index.html)找到用户群组的清单)。
-
-注意:如果安装问题与某 Linux 的发行版有关,在它的邮件列表、论坛或本地用户群组中提问也许是恰当的。此时,应描述问题的准确细节。在此之前,先用 `Linux` 和**所有**被怀疑的硬件作关键词仔细搜索。
-
-> 问题:我怎么才能破解 root 帐号/窃取 OP 特权/读别人的邮件呢?
-
-回答:想要这样做,说明了你是个卑鄙小人;想找个黑客帮你,说明你是个白痴!
-
-## 好问题与蠢问题
-
-最后,我将透过举一些例子,来说明怎样聪明的提问;同一个问题的两种问法被放在一起,一种是愚蠢的,另一种才是明智的。
-
-**蠢问题**:
-
-> 我从 foo 项目找来的源码没法编译。它怎么这么烂?
-
-他觉得都是别人的错,这个傲慢自大的提问者。
-
-**聪明问题**:
-
-> foo 项目代码在 Nulix 6.2 版下无法编译通过。我读过了 FAQ,但里面没有提到跟 Nulix 有关的问题。这是我编译过程的记录,我有什么做的不对的地方吗?
-
-提问者已经指明了环境,也读过了 FAQ,还列出了错误,并且他没有把问题的责任推到别人头上,他的问题值得被关注。
-
-**蠢问题**:
-
-> 我的主机板有问题了,谁来帮我?
-
-某黑客对这类问题的回答通常是:`好的,还要帮你拍拍背和换尿布吗?`,然后按下删除键。
-
-**聪明问题**:
-
-> 我在 S2464 主机板上试过了 X 、 Y 和 Z ,但没什么作用,我又试了 A 、 B 和 C 。请注意当我尝试 C 时的奇怪现象。显然 florbish 正在 grommicking,但结果出人意料。通常在 Athlon MP 主机板上引起 grommicking 的原因是什么?有谁知道接下来我该做些什么测试才能找出问题?
-
-## 如果得不到回答
-
-如果仍得不到回答,请不要以为我们觉得无法帮助你。有时只是看到你问题的人不知道答案罢了。没有回应不代表你被忽视,虽然不可否认这种差别很难区分。
-
-总的来说,简单的重复张贴问题是个很糟的点子。这将被视为无意义的喧闹。有点耐心,知道你问题答案的人可能生活在不同的时区,可能正在睡觉,也有可能你的问题一开始就没有组织好。
-
-你可以通过其他渠道获得帮助,这些渠道通常更适合初学者的需要。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/user_guide/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/user_guide/_category_.json
deleted file mode 100644
index 9c505a51..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/user_guide/_category_.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "label": "用户指南",
- "position": 2,
- "link": {
- "type": "generated-index",
- "description": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/user_guide/frame.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/user_guide/frame.md
deleted file mode 100644
index 5992f735..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/user_guide/frame.md
+++ /dev/null
@@ -1,60 +0,0 @@
----
-sidebar_position: 1
----
-
-# 为什么写
-
-[美团线程池文章](https://tech.meituan.com/2020/04/02/java-pooling-pratice-in-meituan.html "美团线程池文章") 介绍中,因为业务对线程池参数没有合理配置,触发过几起生产事故,进而引发了一系列思考。最终决定封装线程池动态参数调整,扩展线程池监控以及消息报警等功能。
-
-在开源平台找了挺多动态线程池项目,从功能性以及健壮性而言,个人感觉不满足企业级应用。
-
-因为对动态线程池比较感兴趣,加上想写一个有意义的项目,所以决定自己来造一个轻量级的轮子。
-
-想给项目起一个简单易记的名字,类似于 Eureka、Nacos、Redis;后和朋友商量,决定命名:**Hippo4j**。
-
-
-
-## 它解决了什么问题
-
-线程池在业务系统应该都有使用到,帮助业务流程提升效率以及管理线程,多数场景应用于大量的异步任务处理。
-
-虽然线程池提供了我们许多便利,但也并非尽善尽美,比如下面这些问题就无法很好解决。
-
-- 线程池随便定义,线程资源过多,造成服务器高负载。
-
-- 线程池参数不易评估,随着业务的并发提升,业务面临出现故障的风险。
-
-- 线程池任务执行时间超过平均执行周期,开发人员无法感知。
-
-- 线程池任务堆积,触发拒绝策略,影响既有业务正常运行。
-
-- 当业务出现超时、熔断等问题时,因为没有监控,无法确定是不是线程池引起。
-
-- 原生线程池不支持运行时变量的传递,比如 MDC 上下文遇到线程池就 GG。
-
-- 无法执行优雅关闭,当项目关闭时,大量正在运行的线程池任务被丢弃。
-
-- 线程池运行中,任务执行停止,怀疑发生死锁或执行耗时操作,但是无从下手。
-
-Hippo4j 很好解决了这些问题,它将业务中所有线程池统一管理,增强原生线程池系列功能。
-
-## 它有什么特性
-
-应用系统中线程池并不容易管理。参考美团的设计,Hippo4j 按照租户、项目、线程池的维度划分。再加上系统权限,让不同的开发、管理人员负责自己系统的线程池操作。
-
-举个例子,小编在一家公司的公共组件团队,团队中负责消息、短链接网关等项目。公共组件是租户,消息或短链接就是项目。
-
-Hippo4j 除去动态修改线程池,还包含实时查看线程池运行时指标、负载报警、配置日志管理等。
-
-- `hippo4j-adapter`:适配对第三方框架中的线程池进行监控,如 Dubbo、RocketMQ、Hystrix 等;
-- `hippo4j-auth`:用户、角色、权限等;
-- `hippo4j-common`:多个模块公用代码实现;
-- `hippo4j-config`:提供线程池准实时参数更新功能;
-- `hippo4j-console`:对接前端控制台;
-- `hippo4j-core`:核心的依赖,包括配置、核心包装类等;
-- `hippo4j-discovery`:提供线程池项目实例注册、续约、下线等功能;
-- `hippo4j-example` :示例工程;
-- `hippo4j-message` :配置变更以及报警通知发送;
-- `hippo4j-monitor` :线程池运行时监控;
-- `hippo4j-server` :Server 端发布需要的模块聚合;
-- `hippo4j-spring-boot`:SpringBoot Starter。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/user_guide/framework.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/user_guide/framework.md
deleted file mode 100644
index 33e24d1c..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/user_guide/framework.md
+++ /dev/null
@@ -1,51 +0,0 @@
----
-sidebar_position: 2
----
-
-# 架构设计
-
-简单来说,Hippo4j 从部署的角度上分为两种角色:Server 端和 Client 端。
-
-Server 端是 Hippo4j 项目打包出的 Java 进程,功能包括用户权限、线程池监控以及执行持久化的动作。
-
-Client 端指的是我们 SpringBoot 应用,通过引入 Hippo4j Starter Jar 包负责与 Server 端进行交互。
-
-比如拉取 Server 端线程池数据、动态更新线程池配置以及采集上报线程池运行时数据等。
-
-## 基础组件
-
-### 配置中心(Config)
-
-配置中心位于 Server 端,它的主要作用是监控 Server 端线程池配置变更,实时通知到 Client 实例执行线程池变更流程。
-
-代码设计基于 Nacos 1.x 版本的 **长轮询以及异步 Servlet 机制** 实现。
-
-### 注册中心(Discovery)
-
-负责管理 Client 端(单机或集群)注册到 Server 端的实例,包括不限于**实例注册、续约、过期剔除** 等操作,代码基于 Eureka 源码实现。
-
-上面的配置中心很容易理解,动态线程池参数变更的根本。但是注册中心是用来做什么的?
-
-注册中心管理 Client 端注册的实例,通过这些实例可以 **实时获取线程池的运行时参数信息**。
-
-目前的设计是如此,不排除后续基于 Discovery 做更多的扩展。
-
-### 控制台(Console)
-
-对接前端项目,包括不限于以下模块管理:
-
-
-
-## 消息通知(Notify)
-
-Hippo4j 内置了很多需要通知的事件,比如:线程池参数变更通知、线程池活跃度报警、拒绝策略执行报警以及阻塞队列容量报警等。
-
-目前 Notify 已经接入了钉钉、企业微信和飞书,后续持续集成邮件、短信等通知渠道;并且,Notify 模块提供了消息事件的 SPI 方案,可以接受三方自定义的推送。
-
-## Hippo4j-Spring-Boot-Starter
-
-熟悉 SpringBoot 的小伙伴对 Starter 应该不会陌生。Hippo4j 提供以 Starter Jar 包的形式嵌套在应用内,负责与 Server 端完成交互。
-
-## 功能架构
-
-
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/user_guide/notify.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/user_guide/notify.md
deleted file mode 100644
index 7aa7e915..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/user_guide/notify.md
+++ /dev/null
@@ -1,75 +0,0 @@
----
-sidebar_position: 4
----
-
-# 通知报警
-
-现阶段已集成钉钉、企业微信、飞书的消息推送,后续会持续接入邮箱、短信和自定义通知渠道。
-
-
-
-**通知平台**
-
-- DING:钉钉平台;
-
-- LARK:飞书平台;
-
-- WECHAT:企业微信。
-
-**通知类型**
-
-- CONFIG:线程池配置变更推送;
-
-- ALARM:线程池运行报警推送。
-
-**Token**
-
-获取 DING、LARK、WECHAT 机器人 Token。
-
-**报警间隔**
-
-- CONFIG 类型通知没有报警间隔;
-
-- ALARM 类型设置报警间隔后,某一节点下的同一线程池指定间隔只会发送一次报警通知。
-
-**接收者**
-
-```tex
-多个接收者使用英文逗号 , 分割 (注意不要有空格)
-DING:填写手机号
-WECHART:填写user_id会以@的消息发给用户,填写姓名则是普通的@,如:龙台
-LARK:填写ou_开头用户唯一标识会以@的消息发给用户,填写手机号则是普通的@
-```
-
-
-## 钉钉平台
-
-[钉钉创建群机器人](https://www.dingtalk.com/qidian/help-detail-20781541.html)
-
-| 配置变更 | 报警通知 |
-| :---: | :---: |
-|  |  |
-
-添加钉钉机器人后,需在机器人配置自定义关键字,才可发送成功。如下所示:
-
-
-
-:::tip
-如果使用 1.4.3 及以上版本,`警报` 替换为 `告警`。
-:::
-
-## 企业微信
-
-[企业微信创建群机器人](https://open.work.weixin.qq.com/help2/pc/14931?person_id=1&from=homesearch)
-
-| 配置变更 | 报警通知 |
-| :---: | :---: |
-|  |  |
-
-## 飞书平台
-
-[飞书创建群机器人](https://www.feishu.cn/hc/zh-CN/articles/360024984973)
-
-
-
-
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/user_guide/quick-start.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/user_guide/quick-start.md
deleted file mode 100644
index 59c5cdd5..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/user_docs/user_guide/quick-start.md
+++ /dev/null
@@ -1,40 +0,0 @@
----
-sidebar_position: 3
----
-
-# 快速开始
-
-## 服务启动
-
-使用 Docker 运行服务端,默认使用内置 H2 数据库,数据持久化到 Docker 容器存储卷中。
-
-```shell
-docker run -d -p 6691:6691 --name hippo4j-server hippo4j/hippo4j-server
-```
-
-> 如果没有 Docker,可以使用源码编译的方式,启动 [Hippo4j-Server/Hippo4j-Bootstrap](https://github.com/longtai-cn/hippo4j/tree/develop/hippo4j-server/hippo4j-bootstrap) 模块下 ServerApplication 应用类。
-
-启动示例项目,[hippo4j-spring-boot-starter-example](https://github.com/opengoofy/hippo4j/tree/develop/hippo4j-example/hippo4j-spring-boot-starter-example) 模块下 ServerExampleApplication 应用类。
-
-访问 Server 控制台,路径 `http://localhost:6691/index.html`,默认用户名密码:admin / 123456
-
-## 配置变更
-
-访问控制台动态线程池菜单下线程池实例,修改动态线程池相关参数。
-
-
-
-观察 Hippo4j-Example 控制台日志输出,日志输出包括不限于此信息即为成功。
-
-```tex
-2022-09-10 00:23:29.783 INFO 50322 --- [change.config_0] c.h.s.s.c.ServerThreadPoolDynamicRefresh : [message-consume] Dynamic thread pool change parameter.
- corePoolSize: 2 => 4
- maximumPoolSize: 6 => 12
- capacity: 1024 => 2048
- keepAliveTime: 9999 => 9999
- executeTimeOut: 800 => 3000
- rejectedType: SyncPutQueuePolicy => RunsOldestTaskPolicy
- allowCoreThreadTimeOut: true => true
-```
-
-另外,当 Client 集群部署时,可以修改某一个实例,或选择 `全部修改` 按钮,修改所有实例线程池信息。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2.json b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2.json
deleted file mode 100644
index 4393497b..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2.json
+++ /dev/null
@@ -1,82 +0,0 @@
-{
- "version.label": {
- "message": "1.4.2",
- "description": "The label for version 1.4.2"
- },
- "sidebar.tutorialSidebar.category.user_docs": {
- "message": "user_docs",
- "description": "The label for category user_docs in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar tutorialSidebar"
- },
- "sidebar.user_docs.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar user_docs"
- },
- "sidebar.user_docs.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar user_docs"
- },
- "sidebar.user_docs.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar user_docs"
- },
- "sidebar.user_docs.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar user_docs"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/dev_manual/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/dev_manual/_category_.json
deleted file mode 100644
index 9117307f..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/dev_manual/_category_.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "label": "开发者手册",
- "position": 5,
- "link": {
- "type": "generated-index",
- "description": "Hippo4j 留给使用者能够扩展的知识点。"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/dev_manual/rejected-policy-custom.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/dev_manual/rejected-policy-custom.md
deleted file mode 100644
index e0405061..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/dev_manual/rejected-policy-custom.md
+++ /dev/null
@@ -1,57 +0,0 @@
----
-sidebar_position: 1
----
-
-# 拒绝策略自定义
-
-Hippo4j 通过 SPI 的方式对拒绝策略进行扩展,可以让用户在 Hippo4j 中完成自定义拒绝策略实现。
-
-## Hippo4j Server 拒绝策略扩展
-
-自定义拒绝策略,实现 `CustomRejectedExecutionHandler` 接口,示例如下:
-
-```java
-public class ErrorLogRejectedExecutionHandler implements CustomRejectedExecutionHandler {
-
- @Override
- public Integer getType() {
- return 12;
- }
-
- @Override
- public RejectedExecutionHandler generateRejected() {
- return new CustomErrorLogRejectedExecutionHandler();
- }
-
- public static class CustomErrorLogRejectedExecutionHandler implements RejectedExecutionHandler {
-
- @Override
- public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
- Logger logger = LoggerFactory.getLogger(this.getClass());
- logger.error("线程池抛出拒绝策略");
- }
- }
-}
-```
-
-创建 `src/main/resources/META-INF/services` 目录,创建 SPI 自定义拒绝策略文件 `cn.hippo4j.common.executor.support.CustomRejectedExecutionHandler`。
-
-`cn.hippo4j.common.executor.support.CustomRejectedExecutionHandler` 文件内仅放一行自定义拒绝策略全限定名即可,示例:
-
-```text
-cn.hippo4j.example.core.handler.ErrorLogRejectedExecutionHandler
-```
-
-创建、修改线程池页面选择 `CustomRejectedPolicy(自定义 SPI 策略)`。
-
-
-
-拒绝策略触发时,完成上述代码效果,仅打印异常日志提示。
-
-```text
-2022-08-01 21:27:49.515 ERROR 48928 --- [ateHandler.test] r$CustomErrorLogRejectedExecutionHandler : 线程池抛出拒绝策略
-```
-
-:::note
-具体参考 `hippo4j-example/hippo4j-spring-boot-starter-example` 模块。
-:::
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/dev_manual/rejected-policy-info.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/dev_manual/rejected-policy-info.md
deleted file mode 100644
index d5c68138..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/dev_manual/rejected-policy-info.md
+++ /dev/null
@@ -1,50 +0,0 @@
----
-sidebar_position: 0
----
-
-# 内置拒绝策略
-
-内置两种拒绝策略说明:
-
-**RunsOldestTaskPolicy**:添加新任务并由主线程运行最早的任务。
-
-```java
-public class RunsOldestTaskPolicy implements RejectedExecutionHandler {
-
- @Override
- public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
- if (executor.isShutdown()) {
- return;
- }
- BlockingQueue workQueue = executor.getQueue();
- Runnable firstWork = workQueue.poll();
- boolean newTaskAdd = workQueue.offer(r);
- if (firstWork != null) {
- firstWork.run();
- }
- if (!newTaskAdd) {
- executor.execute(r);
- }
- }
-}
-```
-
-**SyncPutQueuePolicy**:主线程把拒绝任务以阻塞的方式添加到队列。
-
-```java
-@Slf4j
-public class SyncPutQueuePolicy implements RejectedExecutionHandler {
-
- @Override
- public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
- if (executor.isShutdown()) {
- return;
- }
- try {
- executor.getQueue().put(r);
- } catch (InterruptedException e) {
- log.error("Adding Queue task to thread pool failed.", e);
- }
- }
-}
-```
\ No newline at end of file
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/_category_.json
deleted file mode 100644
index 72b1e151..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "快速开始",
- "position": 3,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/_category_.json
deleted file mode 100644
index 78b3d9c4..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/_category_.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "label": "依赖配置中心",
- "position": 2,
- "collapsed": true
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/hippo4j-config-default.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/hippo4j-config-default.md
deleted file mode 100644
index 9c9e0fc9..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/hippo4j-config-default.md
+++ /dev/null
@@ -1,45 +0,0 @@
----
-sidebar_position: 4
----
-
-# 参数默认配置
-
-曾有多名小伙伴反馈说,项目中线程池一多,配置文件中配置就显得很臃肿。为此 hippo4j-config 开发出了动态线程池默认配置。
-
-```yaml
-spring:
- dynamic:
- thread-pool:
- default-executor:
- core-pool-size: 4
- maximum-pool-size: 6
- blocking-queue: ResizableCapacityLinkedBlockingQueue
- queue-capacity: 1024
- execute-time-out: 1000
- keep-alive-time: 9999
- rejected-handler: AbortPolicy
- active-alarm: 90
- capacity-alarm: 85
- alarm: true
- allow-core-thread-time-out: true
- notify:
- interval: 5
- receives: chen.ma
- executors:
- - thread-pool-id: message-produce
- - thread-pool-id: message-consume
- core-pool-size: 80
- maximum-pool-size: 100
- execute-time-out: 1000
- notify:
- interval: 6
- receives: chen.ma
-```
-
-`spring.dynamic.thread-pool.executors` 层级下,仅需要配置 `thread-pool-id`,其余配置从 `spring.dynamic.thread-pool.default-executor` 读取。
-
-如果 `spring.dynamic.thread-pool.executors` 下配置和 `spring.dynamic.thread-pool.default-executor` 冲突,以前者为主。
-
-通过该自定义配置方式,可减少大量重复线程池参数配置项,提高核心配置简洁度。
-
-提示:`spring.dynamic.thread-pool.default-executor` 层级下参数,不提供动态刷新功能。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/hippo4j-config-monitor.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/hippo4j-config-monitor.md
deleted file mode 100644
index e4aade51..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/hippo4j-config-monitor.md
+++ /dev/null
@@ -1,117 +0,0 @@
----
-sidebar_position: 3
----
-
-# 线程池监控
-
-## 线程池监控配置
-
-监控前置条件:需要先完成 hippo4j-config 的 [接入工作](/docs/user_docs/getting_started/config/hippo4j-config-start)。
-
-接下来引入 SpringBoot Actuator。Spring 2.x 一般都有版本指定,所以这里不用写版本号。
-
-```xml
-
- io.micrometer
- micrometer-registry-prometheus
-
-
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-```
-
-添加动态线程池监控相关配置:
-
-```yaml
-management:
- metrics:
- export:
- prometheus:
- enabled: true
- server:
- port: 29999 # 可选配置,如果不配置该 port,直接使用 ${server.port}
- endpoints:
- web:
- exposure:
- include: '*' # 测试使用,开启了所有端点,生产环境不建议 *
-spring:
- dynamic:
- thread-pool:
- collect-type: micrometer
-```
-
-项目启动,访问 `http://localhost:29999/actuator/prometheus` 出现 `dynamic_thread_pool_` 前缀的指标,即为成功。
-
-
-
-## 配置 Prometheus
-
-通过 Docker 启动 Prometheus 服务。
-
-```shell
-docker run -d -p 9090:9090 --name prometheus prom/prometheus
-```
-
-添加 Prometheus 抽取数据任务。
-
-```shell
-# 进入 prometheus 容器内部
-docker exec -it prometheus /bin/sh
-# 编辑 prometheus 配置文件
-vi /etc/prometheus/prometheus.yml
-```
-
-scrape_configs 节点下新添加一个 job,如果 Prometheus 是 Docker 方式部署,`{scrape_configs.static_configs.targets}` 需要写本机的 IP。
-
-```yaml
-scrape_configs:
- - job_name: 'dynamic-thread-pool-job'
- scrape_interval: 5s
- metrics_path: '/actuator/prometheus'
- static_configs:
- - targets: [ '127.0.0.1:29999' ]
-```
-
-配置成功后 `exit` 退出容器,并进行 Prometheus 容器重启 `docker restart prometheus`。
-
-访问 Prometheus 控制台 `http://localhost:9090/graph` 路径,能够展示相关指标即为配置成功。
-
-
-
-## 配置 Grafana
-
-```shell
-docker run -d -p 3000:3000 --name=grafana grafana/grafana
-```
-
-访问 Grafana 地址,[http://localhost:3000](http://localhost:3000) 用户名密码:`admin`
-
-Grafana 访问 `http://localhost:3000/datasources` 导入 Prometheus 数据源。
-
-
-
-> 如果 Prometheus 为 Docker 方式部署,HTTP URL 需要为本地 IP,比如:http://192.168.1.5:9090
-
-关注公众号 `龙台的技术笔记`,回复:`监控`,获取 Hippo4j Grafana DashBoard JSON 配置。
-
-| 公众号 | 回复关键词 |
-|:------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------:|
-|  |  |
-
-获取到 JSON 文件后,通过 `http://localhost:3000/dashboard/import` 将 JSON 文件导入至 Grafana DashBoard。
-
-
-
-下拉框内动态选择创建好的 Prometheus 数据源,并点击 `Import`。
-
-
-
-即可使用炫酷的 Hippo4j 动态线程池监控 DashBoard。大家伙儿也可以根据个人喜好进行定制 DashBoard,如果觉得有优化点,欢迎和我联系贡献。
-
-
-
-如果项目客户端启动多个示例,动态线程池监控效果图如下:
-
-
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/hippo4j-config-more.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/hippo4j-config-more.md
deleted file mode 100644
index 2511b4f3..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/hippo4j-config-more.md
+++ /dev/null
@@ -1,80 +0,0 @@
----
-sidebar_position: 3
----
-
-# 个性化配置
-
-以下所述特性自 hippo4j-config v1.4.2 及以上版本提供,由 hippo4j 核心开发者 [@pizihao](https://github.com/pizihao) 完成相应功能开发。
-
-## 需求背景
-
-**1)容器及三方框架线程池自定义启用**
-
-最初设计容器线程池和三方框架线程池的动态变更是和启动无关的。也就是说,启动时不会根据配置文件中相关参数去修改两者对应的线程池配置。
-
-这么设计的初衷是因为,不想让 hippo4j 过多的去介入框架原有的功能。因为容器和三方框架都支持线程池参数的自定义。
-
-也就造成,可能你在配置中心配置了对应的容器和三方框架线程池参数,启动时是无效的。但当修改配置文件任一配置,容器和三方框架线程池配置将生效。
-
-为了更好的用户体验,决定加入启用标识来控制:是否在项目初始化启动时,对容器和三方框架线程池参数进行修改。
-
-**2)客户端集群个性化配置**
-
-大家都知道,hippo4j-config 是依赖配置中心做线程池配置动态变更。这种模式有一种缺点:改动配置文件后,所有客户端都会变更。
-
-有些小伙伴希望 hippo4j-config 能够像 hippo4j-server 一样,能够针对单独的客户端进行配置变更。
-
-## 容器及三方框架线程池自定义启用
-
-容器及三方框架线程池添加启用配置,为了保持统一,动态线程池配置中也有该参数配置。配置项默认开启。
-
-```yaml
-spring:
- dynamic:
- thread-pool:
- tomcat:
- enable: true
- executors:
- - thread-pool-id: message-consume
- enable: false
- adapter-executors:
- - threadPoolKey: 'input'
- enable: true
-```
-
-## 客户端集群个性化配置
-
-分别在动态线程池、容器线程池以及三方框架线程池配置下增加 `nodes` 配置节点,通过该配置可匹配需要变更的节点。
-
-```yaml
-spring:
- dynamic:
- thread-pool:
- tomcat:
- nodes: 192.168.1.5:*,192.168.1.6:8080
- executors:
- - thread-pool-id: message-consume
- nodes: 192.168.1.5:*
- adapter-executors:
- - threadPoolKey: 'input'
- nodes: 192.168.1.5:*
-```
-
-来一段代码方法中的注释,大家就基本明白如何使用了。
-
-```java
-/**
- * Matching nodes
- * nodes is ip + port.Get 'nodes' in the new Properties,Compare this with the ip + port of Application.
- * support prefix pattern matching. e.g:
- *
- * 192.168.1.5:* -- Matches all ports of 192.168.1.5
- * 192.168.1.*:2009 -- Matches 2009 port of 192.168.1.*
- * * -- all
- * empty -- all
- *
- * The format of ip + port is ip : port.
- */
-```
-
-`nodes` 可与 `enable` 同时使用。如此,基于配置中心的动态线程池实现方式,将能够更方便的支持个性化需求。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/hippo4j-config-springboot1x-adapter.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/hippo4j-config-springboot1x-adapter.md
deleted file mode 100644
index 693dd341..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/hippo4j-config-springboot1x-adapter.md
+++ /dev/null
@@ -1,121 +0,0 @@
----
-sidebar_position: 5
----
-
-# 适配SpringBoot1x
-
-目前已支持 Nacos、Apollo 配置中心适配 SpringBoot 1.5.x 版本。
-
-```xml
-
- cn.hippo4j
- hippo4j-config-spring-boot-1x-starter
- 1.4.2
-
-```
-
-Nacos SpringBoot 配置如下:
-
-```yaml
-spring:
- cloud:
- nacos:
- config:
- ext-config:
- - data-id: hippo4j-nacos.yaml
- group: DEFAULT_GROUP
- refresh: true
- server-addr: 127.0.0.1:8848
- dynamic:
- thread-pool:
- config-file-type: yml
- nacos:
- data-id: hippo4j-nacos.yaml
- group: DEFAULT_GROUP
-```
-
-Apollo SpringBoot 配置如下:
-
-```yaml
-apollo:
- autoUpdateInjectedSpringProperties: true
- bootstrap:
- eagerLoad:
- enabled: true
- enabled: true
- namespaces: application
- meta: http://127.0.0.1:8080
-app:
- id: dynamic-threadpool-example
-spring:
- dynamic:
- thread-pool:
- apollo:
- namespace: application
-```
-
-动态线程池通用配置如下:
-
-```yaml
-management:
- context-path: /actuator
- security:
- enabled: false
-server:
- port: 8091
- servlet:
- context-path: /example
-spring:
- application:
- name: dynamic-threadpool-example
- dynamic:
- thread-pool:
- banner: true
- check-state-interval: 5
- collect-type: micrometer
- config-file-type: properties
- enable: true
- executors:
- - active-alarm: 80
- alarm: true
- allow-core-thread-time-out: true
- blocking-queue: LinkedBlockingQueue
- capacity-alarm: 80
- core-pool-size: 1
- execute-time-out: 1000
- keep-alive-time: 6691
- maximum-pool-size: 1
- notify:
- interval: 8
- receives: chen.ma
- queue-capacity: 1
- rejected-handler: AbortPolicy
- thread-name-prefix: message-consume
- thread-pool-id: message-consume
- - active-alarm: 80
- alarm: true
- allow-core-thread-time-out: true
- blocking-queue: LinkedBlockingQueue
- capacity-alarm: 80
- core-pool-size: 1
- execute-time-out: 1000
- keep-alive-time: 6691
- maximum-pool-size: 1
- notify:
- interval: 8
- receives: chen.ma
- queue-capacity: 1
- rejected-handler: AbortPolicy
- thread-name-prefix: message-produce
- thread-pool-id: message-produce
- notify-platforms:
- - platform: WECHAT
- token: ac0426a5-c712-474c-9bff-72b8b8f5caff
- profiles:
- active: dev
-```
-
-具体 Demo 运行请参考以下示例模块,已验证对应线程池动态变更、报警以及运行时监控功能。
-
-- `/hippo4j-config-nacos-spring-boot-1x-starter-example`
-- `hippo4j-example/hippo4j-config-apollo-spring-boot-1x-starter-example`
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/hippo4j-config-start.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/hippo4j-config-start.md
deleted file mode 100644
index 33f658c2..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/config/hippo4j-config-start.md
+++ /dev/null
@@ -1,193 +0,0 @@
----
-sidebar_position: 1
----
-
-# 接入流程
-
-Nacos、Apollo、Zookeeper、ETCD、Polaris 配置中心任选其一。
-
-## hippo4j 配置
-
-```xml
-
- cn.hippo4j
- hippo4j-config-spring-boot-starter
- 1.4.2
-
-```
-
-启动类上添加注解 `@EnableDynamicThreadPool`。
-
-```java
-@SpringBootApplication
-@EnableDynamicThreadPool
-public class ExampleApplication {
- public static void main(String[] args) {
- SpringApplication.run(ExampleApplication.class, args);
- }
-}
-```
-
-SpringBoot 应用配置文件添加:
-
-```yaml
-server:
- port: 8090
- servlet:
- context-path: /example
-
-spring:
- profiles:
- active: dev
-
- dynamic:
- thread-pool:
- # 是否开启动态线程池
- enable: true
- # 是否打印 banner
- banner: true
- # 是否开启线程池数据采集,对接 Micrometer、ES、Log 等
- collect: true
- # 检查线程池状态,是否达到报警条件,单位毫秒
- check-state-interval: 3000
- # 通知报警平台,请替换为自己创建的群机器人
- notify-platforms:
- - platform: 'WECHAT'
- token: xxx
- - platform: 'DING'
- token: xxx
- secret: xxx # 加签专属
- - platform: 'LARK'
- token: xxx
- # Nacos、Apollo、Zookeeper、ETCD、Polaris 任选其一
- nacos:
- data-id: xxx
- group: xxx
- apollo:
- namespace: xxxx
- # 配置中心文件格式
- config-file-type: yml
- # tomcat、undertow、jetty 三种容器线程池,任选其一
- undertow:
- core-pool-size: 100
- maximum-pool-size: 200
- keep-alive-time: 1000
- # 全局通知配置-是否报警
- alarm: true
- # 活跃度报警阈值;假设线程池最大线程数 10,当线程数达到 8 发起报警
- active-alarm: 80
- # 容量报警阈值;假设阻塞队列容量 100,当容量达到 80 发起报警
- capacity-alarm: 80
- # 报警间隔,同一线程池下同一报警纬度,在 interval 时间内只会报警一次,单位秒
- alarm-interval: 8
- # 企业微信填写用户 ID(填写其它将无法达到 @ 效果)、钉钉填手机号、飞书填 ou_ 开头唯一 ID
- receives: xxx
- # 动态线程池列表
- executors:
- - thread-pool-id: 'message-consume'
- # 核心线程数
- core-pool-size: 1
- # 最大线程数
- maximum-pool-size: 1
- # 阻塞队列名称,参考 BlockingQueueTypeEnum,支持 SPI
- blocking-queue: 'LinkedBlockingQueue'
- # 阻塞队列大小
- queue-capacity: 1
- # 执行超时时间,超过此时间发起报警,单位毫秒
- execute-time-out: 1000
- # 拒绝策略名称,参考 RejectedPolicyTypeEnum,支持 SPI
- rejected-handler: 'AbortPolicy'
- # 线程存活时间,单位秒
- keep-alive-time: 1024
- # 是否允许核心线程超时
- allow-core-thread-time-out: true
- # 线程工厂名称前缀
- thread-name-prefix: 'message-consume'
- # 是否报警
- alarm: true
- # 活跃度报警阈值;假设线程池最大线程数 10,当线程数达到 8 发起报警
- active-alarm: 80
- # 容量报警阈值;假设阻塞队列容量 100,当容量达到 80 发起报警
- capacity-alarm: 80
- # 通知配置,线程池中通知配置如果存在,则会覆盖全局通知配置
- notify:
- # 报警间隔,同一线程池下同一报警纬度,在 interval 时间内只会报警一次,单位分钟
- interval: 8
- # 企业微信填写用户 ID(填写其它将无法达到 @ 效果)、钉钉填手机号、飞书填 ou_ 开头唯一 ID
- receives: xxx
- - thread-pool-id: 'message-produce'
- core-pool-size: 1
- maximum-pool-size: 1
- queue-capacity: 1
- execute-time-out: 1000
- blocking-queue: 'LinkedBlockingQueue'
- rejected-handler: 'AbortPolicy'
- keep-alive-time: 1024
- allow-core-thread-time-out: true
- thread-name-prefix: 'message-consume'
- alarm: true
- active-alarm: 80
- capacity-alarm: 80
- notify:
- interval: 8
- receives: xxx
-```
-
-## ThreadPoolExecutor 适配
-
-添加线程池配置类,通过 `@DynamicThreadPool` 注解修饰。`threadPoolId` 为服务端创建的线程池 ID。
-
-```java
-package cn.hippo4j.example;
-
-import cn.hippo4j.core.executor.DynamicThreadPool;
-import cn.hippo4j.core.executor.support.ThreadPoolBuilder;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import java.util.concurrent.ThreadPoolExecutor;
-
-@Configuration
-public class ThreadPoolConfig {
-
- @Bean
- @DynamicThreadPool
- public ThreadPoolExecutor messageConsumeDynamicExecutor() {
- String threadPoolId = "message-consume";
- ThreadPoolExecutor messageConsumeDynamicExecutor = ThreadPoolBuilder.builder()
- .threadFactory(threadPoolId)
- .threadPoolId(threadPoolId)
- .dynamicPool()
- .build();
- return messageConsumeDynamicExecutor;
- }
-
- @Bean
- @DynamicThreadPool
- public ThreadPoolExecutor messageProduceDynamicExecutor() {
- String threadPoolId = "message-produce";
- ThreadPoolExecutor messageProduceDynamicExecutor = ThreadPoolBuilder.builder()
- .threadFactory(threadPoolId)
- .threadPoolId(threadPoolId)
- .dynamicPool()
- .build();
- return messageProduceDynamicExecutor;
- }
-
-}
-```
-
-通过 ThreadPoolBuilder 构建动态线程池,只有 threadFactory、threadPoolId 为必填项,其它参数会从配置中心拉取。
-
-项目中使用上述定义的动态线程池,如下所示:
-
-```java
-@Resource
-private ThreadPoolExecutor messageConsumeDynamicExecutor;
-
-messageConsumeDynamicExecutor.execute(() -> xxx);
-
-@Resource
-private ThreadPoolExecutor messageProduceDynamicExecutor;
-
-messageProduceDynamicExecutor.execute(() -> xxx);
-```
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/difference.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/difference.md
deleted file mode 100644
index eddaa550..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/difference.md
+++ /dev/null
@@ -1,37 +0,0 @@
----
-sidebar_position: 0
----
-
-# 运行模式介绍
-
-1.1.0 版本发布后,Hippo4j 分为两种使用模式:轻量级依赖配置中心以及无中间件依赖版本。
-
-
-
-### hippo4j-config
-
-**轻量级动态线程池管理**,依赖 Nacos、Apollo、Zookeeper、ETCD、Polaris 等三方配置中心(任选其一)完成线程池参数动态变更,支持运行时报警、监控等功能。
-
-> 监控功能配置详见:[线程池监控](/docs/user_docs/getting_started/config/hippo4j-config-monitor)
-
-
-
-### hippo4j-server
-
-**部署 hippo4j-server 服务**,通过可视化 Web 界面完成线程池的创建、变更以及查看,不依赖三方中间件。
-
-相比较 hippo4j-config,功能会更强大,但同时也引入了一定的复杂性。需要部署一个 Java 服务,以及依赖 MySQL 数据库。
-
-
-
-### 使用总结
-
-| | hippo4j-config | hippo4j-server |
-| ---- | ---------------------------------------------------- | ------------------------------------------------------------ |
-| 依赖 | Nacos、Apollo、Zookeeper、ETCD、Polaris 配置中心(任选其一) | 部署 Hippo4j Server(内部无依赖中间件) |
-| 使用 | 配置中心补充线程池相关参数 | Hippo4j Server Web 控制台添加线程池记录 |
-| 功能 | 包含基础功能:参数动态化、运行时监控、报警等 | 基础功能之外扩展控制台界面、线程池堆栈查看、线程池运行信息实时查看、历史运行信息查看、线程池配置集群个性化等 |
-
-使用建议:根据公司情况选择,如果基本功能可以满足使用,选择 hippo4j-config 使用即可;如果希望更多的功能,可以选择 hippo4j-server。
-
-**两者在进行替换的时候,无需修改业务代码**。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/hippo4j-adapter.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/hippo4j-adapter.md
deleted file mode 100644
index 6fac0e9d..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/hippo4j-adapter.md
+++ /dev/null
@@ -1,72 +0,0 @@
----
-sidebar_position: 6
----
-
-# 三方框架线程池适配
-
-Hippo4j 目前已支持的三方框架线程池列表:
-
-- Dubbo
-- Hystrix
-- RabbitMQ
-- RocketMQ
-- AlibabaDubbo
-- RocketMQSpringCloudStream
-- RabbitMQSpringCloudStream
-
-引入 Hippo4j Server 或 Core 的 Maven Jar 坐标后,还需要引入对应的框架适配 Jar:
-
-```xml
-
- cn.hippo4j
-
- hippo4j-spring-boot-starter-adapter-dubbo
-
- hippo4j-spring-boot-starter-adapter-alibaba-dubbo
-
- hippo4j-spring-boot-starter-adapter-hystrix
-
- hippo4j-spring-boot-starter-adapter-rabbitmq
-
- hippo4j-spring-boot-starter-adapter-rocketmq
-
- hippo4j-spring-boot-starter-adapter-spring-cloud-stream-rocketmq
-
- hippo4j-spring-boot-starter-adapter-spring-cloud-stream-rabbitmq
- 1.4.2
-
-```
-
-如果想省事,仅需引入一个全量包,框架底层会根据条件判断加载具体线程池适配器。
-
-```xml
-
- cn.hippo4j
- hippo4j-spring-boot-starter-adapter-all
- 1.4.2
-
-```
-
-## Hippo4j Server
-
-Hippo4j Server 仅需要引入上述 Jar 包,即可在 Hippo4j Server 的控制台进行查看及修改三方框架线程池。
-
-
-
-## Hippo4j Config
-
-Hippo4j Config 除了依赖上述适配 Jar 包外,还需要在配置中心添加以下配置项。
-
-```yaml
-spring:
- dynamic:
- thread-pool:
- # 省略其它配置
- adapter-executors:
- # threadPoolKey 代表线程池标识
- - threadPoolKey: 'input'
- # mark 为三方线程池框架类型,参见文初已支持框架集合
- mark: 'RocketMQSpringCloudStream'
- corePoolSize: 10
- maximumPoolSize: 10
-```
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/img/docsVersionDropdown.png b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/img/docsVersionDropdown.png
deleted file mode 100644
index 97e41646..00000000
Binary files a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/img/docsVersionDropdown.png and /dev/null differ
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/img/grafana-monitor.jpg b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/img/grafana-monitor.jpg
deleted file mode 100644
index 336bd980..00000000
Binary files a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/img/grafana-monitor.jpg and /dev/null differ
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/img/localeDropdown.png b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/img/localeDropdown.png
deleted file mode 100644
index e257edc1..00000000
Binary files a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/img/localeDropdown.png and /dev/null differ
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/server/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/server/_category_.json
deleted file mode 100644
index 4063c17f..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/server/_category_.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "label": "无中间件依赖",
- "position": 3,
- "collapsed": true
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/server/hippo4j-server-config.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/server/hippo4j-server-config.md
deleted file mode 100644
index 24bf9a13..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/server/hippo4j-server-config.md
+++ /dev/null
@@ -1,19 +0,0 @@
----
-sidebar_position: 4
----
-
-# 服务端配置
-
-`hippo4j.core.clean-history-data-enable`
-
-是否开启线程池历史数据清洗,默认开启。
-
-`hippo4j.core.clean-history-data-period`
-
-线程池历史数据保留时间,默认值:30,单位分钟。
-
-服务端会保留这个配置时间的数据,超过这个时间则会被清理。比如按照默认值 30 分钟来说,12:00 收集到的数据,12:30 就会被清理删除。
-
-`hippo4j.core.monitor.report-type`
-
-客户端监控上报服务端类型,可选值:http、netty,默认 http。服务端开启 netty 配置后,需要在客户端对应开启才可生效。用来应对大量动态线程池监控场景。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/server/hippo4j-server-start.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/server/hippo4j-server-start.md
deleted file mode 100644
index a04aca3d..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/getting_started/server/hippo4j-server-start.md
+++ /dev/null
@@ -1,127 +0,0 @@
----
-sidebar_position: 3
----
-
-# 接入流程
-
-部署服务端,参考 [部署手册](/docs/user_docs/ops/hippo4j-server-deploy)。
-
-服务端创建 [租户、项目](/community/faq#租户和项目在-hippo4j-中是什么意思) 和线程池记录。
-
-需要注意,项目 ID 需要与配置文件 `{application.name}` 保持一致。
-
-:::note
-租户、项目、线程池 ID 如果由多个词组成,建议以 - 进行分割。比如:message-center。
-:::
-
-## Hippo4j 配置
-
-SpringBoot Pom 引入 Hippo4j Starter Jar。
-
-```xml
-
- cn.hippo4j
- hippo4j-spring-boot-starter
- 1.4.2
-
-```
-
-启动类上添加注解 `@EnableDynamicThreadPool`。
-
-```java
-@SpringBootApplication
-@EnableDynamicThreadPool
-public class ExampleApplication {
- public static void main(String[] args) {
- SpringApplication.run(ExampleApplication.class, args);
- }
-}
-```
-
-SpringBoot 应用配置文件添加:
-
-```yaml
-spring:
- profiles:
- active: dev
- application:
- # 服务端创建的项目 id 需要与 application.name 保持一致
- name: dynamic-threadpool-example
- dynamic:
- thread-pool:
- # 服务端地址
- server-addr: http://localhost:6691
- # 用户名
- username: admin
- # 密码
- password: 123456
- # 租户 id, 对应 tenant 表
- namespace: prescription
- # 项目 id, 对应 item 表
- item-id: ${spring.application.name}
-```
-
-## ThreadPoolExecutor 适配
-
-添加线程池配置类,通过 `@DynamicThreadPool` 注解修饰。`threadPoolId` 为服务端创建的线程池 ID。
-
-```java
-package cn.hippo4j.example;
-
-import cn.hippo4j.core.executor.DynamicThreadPool;
-import cn.hippo4j.core.executor.support.ThreadPoolBuilder;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import java.util.concurrent.ThreadPoolExecutor;
-
-@Configuration
-public class ThreadPoolConfig {
-
- @Bean
- @DynamicThreadPool
- public ThreadPoolExecutor messageConsumeDynamicExecutor() {
- String threadPoolId = "message-consume";
- ThreadPoolExecutor messageConsumeDynamicExecutor = ThreadPoolBuilder.builder()
- .threadFactory(threadPoolId)
- .threadPoolId(threadPoolId)
- .dynamicPool()
- .build();
- return messageConsumeDynamicExecutor;
- }
-
- @Bean
- @DynamicThreadPool
- public ThreadPoolExecutor messageProduceDynamicExecutor() {
- String threadPoolId = "message-produce";
- ThreadPoolExecutor messageProduceDynamicExecutor = ThreadPoolBuilder.builder()
- .threadFactory(threadPoolId)
- .threadPoolId(threadPoolId)
- .dynamicPool()
- .build();
- return messageProduceDynamicExecutor;
- }
-
-}
-```
-
-通过 ThreadPoolBuilder 构建动态线程池,只有 threadFactory、threadPoolId 为必填项,其它参数会从 hippo4j-server 服务拉取。
-
-:::note
-创建线程池时建议填充实际的参数。如果在连接 Hippo4j Server 端失败时,会使用填充配置创建线程池。
-:::
-
-项目中使用上述定义的动态线程池,如下所示:
-
-```java
-@Resource
-private ThreadPoolExecutor messageConsumeDynamicExecutor;
-
-messageConsumeDynamicExecutor.execute(() -> xxx);
-
-@Resource
-private ThreadPoolExecutor messageProduceDynamicExecutor;
-
-messageProduceDynamicExecutor.execute(() -> xxx);
-```
-
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/intro.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/intro.md
deleted file mode 100644
index 4bdab7d8..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/intro.md
+++ /dev/null
@@ -1,69 +0,0 @@
----
-sidebar_position: 1
----
-
-# 简介
-
-## 线程池痛点
-
-线程池是一种基于池化思想管理线程的工具,使用线程池可以减少创建销毁线程的开销,避免线程过多导致系统资源耗尽。在高并发以及大批量的任务处理场景,线程池的使用是必不可少的。
-
-如果有在项目中实际使用线程池,相信你可能会遇到以下痛点:
-
-- 线程池随便定义,线程资源过多,造成服务器高负载。
-
-- 线程池参数不易评估,随着业务的并发提升,业务面临出现故障的风险。
-- 线程池任务执行时间超过平均执行周期,开发人员无法感知。
-- 线程池任务堆积,触发拒绝策略,影响既有业务正常运行。
-- 当业务出现超时、熔断等问题时,因为没有监控,无法确定是不是线程池引起。
-- 原生线程池不支持运行时变量的传递,比如 MDC 上下文遇到线程池就 GG。
-- 无法执行优雅关闭,当项目关闭时,大量正在运行的线程池任务被丢弃。
-- 线程池运行中,任务执行停止,怀疑发生死锁或执行耗时操作,但是无从下手。
-
-## 什么是 Hippo4j
-
-Hippo4j 通过对 JDK 线程池增强,以及扩展三方框架底层线程池等功能,为业务系统提高线上运行保障能力。
-
-提供以下功能支持:
-
-- 全局管控 - 管理应用线程池实例。
-
-- 动态变更 - 应用运行时动态变更线程池参数,包括不限于:核心、最大线程数、阻塞队列容量、拒绝策略等。
-- 通知报警 - 内置四种报警通知策略,线程池活跃度、容量水位、拒绝策略以及任务执行时间超长。
-- 运行监控 - 实时查看线程池运行时数据,最近半小时线程池运行数据图表展示。
-- 功能扩展 - 支持线程池任务传递上下文;项目关闭时,支持等待线程池在指定时间内完成任务。
-- 多种模式 - 内置两种使用模式:[依赖配置中心](https://hippo4j.cn/docs/user_docs/getting_started/config/hippo4j-config-start) 和 [无中间件依赖](https://hippo4j.cn/docs/user_docs/getting_started/server/hippo4j-server-start)。
-- 容器管理 - Tomcat、Jetty、Undertow 容器线程池运行时查看和线程数变更。
-- 框架适配 - Dubbo、Hystrix、RabbitMQ、RocketMQ 等消费线程池运行时数据查看和线程数变更。
-
-## 快速开始
-
-对于本地演示目的,请参阅 [Quick start](https://hippo4j.cn/docs/user_docs/user_guide/quick-start)
-
-演示环境: [http://console.hippo4j.cn/index.html](http://console.hippo4j.cn/index.html)
-
-## 接入登记
-
-更多接入的公司,欢迎在 [登记地址](https://github.com/opengoofy/hippo4j/issues/13) 登记,登记仅仅为了产品推广。
-
-## 联系我
-
-开源不易,右上角点个 Star 鼓励一下吧!
-
-如果大家想要实时关注 Hippo4j 更新的文章以及分享的干货的话,可以关注我的公众号。
-
-使用过程中有任何问题,或者对项目有什么建议,关注公众号回复:加群,和 1000+ 志同道合的朋友交流讨论。
-
-
-
-## 友情链接
-- [[ LiteFlow ]](https://liteflow.yomahub.com/):轻量,快速,稳定可编排的组件式规则引擎。
-
-- [[ Sa-Token ]](https://github.com/dromara/sa-token):一个轻量级 java 权限认证框架,让鉴权变得简单、优雅!
-- [[ HertzBeat ]](https://github.com/dromara/hertzbeat):易用友好的云监控系统, 无需 Agent, 强大自定义监控能力。
-- [[ JavaGuide ]](https://github.com/Snailclimb/JavaGuide):一份涵盖大部分 Java 程序员所需要掌握的核心知识。
-- [[ toBeBetterJavaer ]](https://github.com/itwanger/toBeBetterJavaer):一份通俗易懂、风趣幽默的 Java 学习指南。
-
-## 贡献者
-
-感谢所有为项目作出贡献的开发者。如果有意贡献,参考 [good first issue](https://github.com/opengoofy/hippo4j/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/ops/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/ops/_category_.json
deleted file mode 100644
index d5b7d1e8..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/ops/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "运维指南",
- "position": 4,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/ops/hippo4j-server-deploy.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/ops/hippo4j-server-deploy.md
deleted file mode 100644
index ffbc2306..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/ops/hippo4j-server-deploy.md
+++ /dev/null
@@ -1,45 +0,0 @@
----
-sidebar_position: 1
----
-
-# 源码包部署
-
-[RELEASE](https://github.com/opengoofy/hippo4j/releases) 页面下载对应版本并进行解压。
-
-## 初始化
-
-修改数据库相关信息。
-
-```txt
-/conf/application.properties
-```
-
-如果是新运行 Hippo4j,数据库执行下述 SQL 脚本即可。
-
-```txt
-/conf/hippo4j_manager.sql
-```
-
-如果是对已运行 Hippo4j 升级,请查看 `/conf/sql-upgrade` 目录下,是否有目标版本对应的升级脚本。
-
-## 直接运行
-
-Mac Linux 启动执行。
-
-```txt
-sh ./bin/startup.sh
-```
-
-Windows 启动执行。
-
-```txt
-bin/startup.cmd
-```
-
-## 访问控制台
-
-启动成功后,访问链接。用户名密码:admin 123456
-
-```txt
-localhost:6691/index.html
-```
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/ops/server-docker.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/ops/server-docker.md
deleted file mode 100644
index 826bb99f..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/ops/server-docker.md
+++ /dev/null
@@ -1,50 +0,0 @@
----
-sidebar_position: 2
----
-
-# Docker部署
-
-## 镜像启动
-
-Docker 镜像默认使用内置 H2 数据库,数据持久化到 Docker 容器存储卷中。
-
-```shell
-docker run -d -p 6691:6691 --name hippo4j-server hippo4j/hippo4j-server
-```
-
-或者,底层存储数据库切换为 MySQL。`DATASOURCE_HOST` 需要切换为本地 IP,不能使用 `127.0.0.1` 或 `localhost`。
-
-```shell
-docker run -d -p 6691:6691 --name hippo4j-server \
--e DATASOURCE_MODE=mysql \
--e DATASOURCE_HOST=xxx.xxx.xxx.xxx \
--e DATASOURCE_PORT=3306 \
--e DATASOURCE_DB=hippo4j_manager \
--e DATASOURCE_USERNAME=root \
--e DATASOURCE_PASSWORD=root \
-hippo4j/hippo4j-server
-```
-
-访问 Server 控制台,路径 `http://localhost:6691/index.html` ,默认用户名密码:admin / 123456
-
-## 镜像构建
-
-如果想要自定义镜像,可以通过以下命令快速构建 Hippo4j Server:
-
-方式一:
-
-```shell
-# 进入到 hippo4j-server/hippo4j-bootstrap 工程路径下
-mvn clean package -Dskip.spotless.apply=true
-# 默认打包是打包的 tag 是 latest
-docker build -t hippo4j/hippo4j-server ../hippo4j-bootstrap
-```
-
-方式二:
-
-通过 `maven docker plugin`
-
-```shell
-# 进入到 hippo4j-server 工程路径下
-mvn clean package -DskipTests -Dskip.spotless.apply=true docker:build
-```
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/other/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/other/_category_.json
deleted file mode 100644
index a74d7432..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/other/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "其它",
- "position": 6,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/other/official-ccounts.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/other/official-ccounts.md
deleted file mode 100644
index 63e07ea7..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/other/official-ccounts.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-sidebar_position: 5
----
-
-# 推荐公众号
-
-## JavaGuide
-
-专注Java后端学习和大厂面试的公众号!
-
-
-
-## HelloGitHub
-
-HelloGitHub,专注于开源社区技术和知识内容分享。
-
-
-
-## macrozheng
-
-专注Java技术分享,解析优质开源项目。涵盖SpringBoot、SpringCloud、Docker、K8S等实用技术,作者Github开源项目mall(50K+Star)。
-
-
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/other/operation.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/other/operation.md
deleted file mode 100644
index 62661c55..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/other/operation.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-sidebar_position: 6
----
-
-# 公众号合作
-
-## 推荐须知
-
-hippo4j 作为一款新兴动态线程池框架,开源出来的时间比较晚,目前迫切需要不同的途径进行推广。
-
-如果您是公众号运营者或者开源爱好者,欢迎将 hippo4j 推荐给您的粉丝。
-
-1. 您无需为 hippo4j 专门撰写文案,只需要直接导入 [推荐文章](https://mp.weixin.qq.com/s/JTTwcBEiK_MnFcPTZl3zGA) 即可。
-2. 在文章底部或内容中留下项目官网或者 GitHub 仓库链接。
-3. 文章需至少 1000+ 的阅读量。
-
-作为推荐回报,hippo4j 可以为您:
-
-1. 在框架官方文档 [推荐公众号](/docs/user_docs/other/official-ccounts) 页面处留下您的公众号二维码。
-2. 在框架官方交流群里@全体成员推广您的公众号一次,附带介绍语。
-3. 您的公众号所有新推文章都可以将链接发送到 hippo4j 交流群中,增加阅读量。
-
-如果您还有除公众号以外的其它途径可以与 hippo4j 相互推荐,欢迎 [加群沟通](/group)。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/other/question.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/other/question.md
deleted file mode 100644
index 49fd4d77..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/other/question.md
+++ /dev/null
@@ -1,246 +0,0 @@
----
-sidebar_position: 3
----
-
-# 问题提问
-
-文档引用自:[提问的智慧](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)
-
-## 在提问之前
-
-在你准备要通过电子邮件、新闻群组或者聊天室提出技术问题前,请先做到以下事情:
-
-1. 尝试在你准备提问的论坛的旧文章中搜索答案。
-2. 尝试上网搜索以找到答案。
-3. 尝试阅读手册以找到答案。
-4. 尝试阅读常见问题文件(FAQ)以找到答案。
-5. 尝试自己检查或试验以找到答案。
-6. 向你身边的强者朋友打听以找到答案。
-7. 如果你是程序开发者,请尝试阅读源代码以找到答案。
-
-当你提出问题的时候,请先表明你已经做了上述的努力;这将有助于树立你并不是一个不劳而获且浪费别人的时间的提问者。如果你能一并表达在做了上述努力的过程中所**学到**的东西会更好,因为我们更乐于回答那些表现出能从答案中学习的人的问题。
-
-## 当你提问时
-
-### 慎选提问的论坛
-小心选择你要提问的场合。如果你做了下述的事情,你很可能被忽略掉或者被看作失败者:
-
-* 在与主题不合的论坛上贴出你的问题。
-* 在探讨进阶技术问题的论坛张贴非常初级的问题;反之亦然。
-* 在太多的不同新闻群组上重复转贴同样的问题(cross-post)。
-* 向既非熟人也没有义务解决你问题的人发送私人电邮。
-
-因此,第一步是找到对的论坛。再说一次,Google 和其它搜索引擎还是你的朋友,用它们来找到与你遭遇到困难的软硬件问题最相关的网站。通常那儿都有常见问题(FAQ)、邮件列表及相关说明文件的链接。如果你的努力(包括**阅读** FAQ)都没有结果,网站上也许还有报告 Bug(Bug-reporting)的流程或链接,如果是这样,链过去看看。
-
-### 使用有意义且描述明确的标题
-
-在邮件列表、新闻群组或论坛中,大约 50 字以内的标题是抓住资深专家注意力的好机会。别用喋喋不休的帮帮忙、跪求、急(更别说救命啊!!!!这样让人反感的话,用这种标题会被条件反射式地忽略)来浪费这个机会。不要妄想用你的痛苦程度来打动我们,而应该是在这点空间中使用极简单扼要的描述方式来提出问题。
-
-一个好标题范例是`目标 —— 差异`式的描述,许多技术支持组织就是这样做的。在`目标`部分指出是哪一个或哪一组东西有问题,在`差异`部分则描述与期望的行为不一致的地方。
-
-> 蠢问题:救命啊!我的笔记本电脑不能正常显示了!
-
-> 聪明问题:X.org 6.8.1 的鼠标指针会变形,某牌显卡 MV1005 芯片组。
-
-> 更聪明问题:X.org 6.8.1 的鼠标指针,在某牌显卡 MV1005 芯片组环境下 - 会变形。
-
-### 使用清晰、正确、精准且合乎语法的语句
-
-我们从经验中发现,粗心的提问者通常也会粗心地写程序与思考(我敢打包票)。回答粗心大意者的问题很不值得,我们宁愿把时间耗在别处。
-
-正确的拼写、标点符号和大小写是很重要的。一般来说,如果你觉得这样做很麻烦,不想在乎这些,那我们也觉得麻烦,不想在乎你的提问。花点额外的精力斟酌一下字句,用不着太僵硬与正式 —— 事实上,黑客文化很看重能准确地使用非正式、俚语和幽默的语句。但它**必须很**准确,而且有迹象表明你是在思考和关注问题。
-
-### 精确地描述问题并言之有物
-
-* 仔细、清楚地描述你的问题或 Bug 的症状。
-* 描述问题发生的环境(机器配置、操作系统、应用程序、以及相关的信息),提供经销商的发行版和版本号(如:`Fedora Core 4`、`Slackware 9.1`等)。
-* 描述在提问前你是怎样去研究和理解这个问题的。
-* 描述在提问前为确定问题而采取的诊断步骤。
-* 描述最近做过什么可能相关的硬件或软件变更。
-* 尽可能地提供一个可以`重现这个问题的可控环境`的方法。
-
-尽量去揣测一个黑客会怎样反问你,在你提问之前预先将黑客们可能提出的问题回答一遍。
-
-以上几点中,当你报告的是你认为可能在代码中的问题时,给黑客一个可以重现你的问题的环境尤其重要。当你这么做时,你得到有效的回答的机会和速度都会大大的提升。
-
-[Simon Tatham](http://www.chiark.greenend.org.uk/~sgtatham/) 写过一篇名为《[如何有效的报告 Bug](http://www.chiark.greenend.org.uk/~sgtatham/bugs-cn.html)》的出色文章。强力推荐你也读一读。
-
-### 话不在多而在精
-
-你需要提供精确有内容的信息。这并不是要求你简单的把成堆的出错代码或者资料完全转录到你的提问中。如果你有庞大而复杂的测试样例能重现程序挂掉的情境,尽量将它剪裁得越小越好。
-
-这样做的用处至少有三点。
-第一,表现出你为简化问题付出了努力,这可以使你得到回答的机会增加;
-第二,简化问题使你更有可能得到**有用**的答案;
-第三,在精炼你的 bug 报告的过程中,你很可能就自己找到了解决方法或权宜之计。
-
-### 别动辄声称找到 Bug
-
-当你在使用软件中遇到问题,除非你非常、**非常**的有根据,不要动辄声称找到了 Bug。提示:除非你能提供解决问题的源代码补丁,或者提供回归测试来表明前一版本中行为不正确,否则你都多半不够完全确信。这同样适用在网页和文件,如果你(声称)发现了文件的`Bug`,你应该能提供相应位置的修正或替代文件。
-
-请记得,还有其他许多用户没遇到你发现的问题,否则你在阅读文件或搜索网页时就应该发现了(你在抱怨前[已经做了这些,是吧](#在提问之前)?)。这也意味着很有可能是你弄错了而不是软件本身有问题。
-
-编写软件的人总是非常辛苦地使它尽可能完美。如果你声称找到了 Bug,也就是在质疑他们的能力,即使你是对的,也有可能会冒犯到其中某部分人。当你在标题中嚷嚷着有`Bug`时,这尤其严重。
-
-提问时,即使你私下非常确信已经发现一个真正的 Bug,最好写得像是**你**做错了什么。如果真的有 Bug,你会在回复中看到这点。这样做的话,如果真有 Bug,维护者就会向你道歉,这总比你惹恼别人然后欠别人一个道歉要好一点。
-
-### 低声下气不能代替你的功课
-
-有些人明白他们不该粗鲁或傲慢的提问并要求得到答复,但他们选择另一个极端 —— 低声下气:`我知道我只是个可悲的新手,一个撸瑟,但...`。这既使人困扰,也没有用,尤其是伴随着与实际问题含糊不清的描述时更令人反感。
-
-别用原始灵长类动物的把戏来浪费你我的时间。取而代之的是,尽可能清楚地描述背景条件和你的问题情况。这比低声下气更好地定位了你的位置。
-
-有时网页论坛会设有专为新手提问的版面,如果你真的认为遇到了初学者的问题,到那去就是了,但一样别那么低声下气。
-
-### 描述问题症状而非你的猜测
-
-告诉黑客们你认为问题是怎样造成的并没什么帮助。(如果你的推断如此有效,还用向别人求助吗?),因此要确信你原原本本告诉了他们问题的症状,而不是你的解释和理论;让黑客们来推测和诊断。如果你认为陈述自己的猜测很重要,清楚地说明这只是你的猜测,并描述为什么它们不起作用。
-
-**蠢问题**
-
-> 我在编译内核时接连遇到 SIG11 错误,
-> 我怀疑某条飞线搭在主板的走线上了,这种情况应该怎样检查最好?
-
-**聪明问题**
-
-> 我的组装电脑是 FIC-PA2007 主机板搭载 AMD K6/233 CPU(威盛 Apollo VP2 芯片组),
-> 256MB Corsair PC133 SDRAM 内存,在编译内核时,从开机 20 分钟以后就频频产生 SIG11 错误,
-> 但是在头 20 分钟内从没发生过相同的问题。重新启动也没有用,但是关机一晚上就又能工作 20 分钟。
-> 所有内存都换过了,没有效果。相关部分的标准编译记录如下…
-
-由于以上这点似乎让许多人觉得难以配合,这里有句话可以提醒你:`所有的诊断专家都来自密苏里州。` 美国国务院的官方座右铭则是:`让我看看`(出自国会议员 Willard D. Vandiver 在 1899 年时的讲话:`我来自一个出产玉米,棉花,牛蒡和民主党人的国家,滔滔雄辩既不能说服我,也不会让我满意。我来自密苏里州,你必须让我看看。`) 针对诊断者而言,这并不是一种怀疑,而只是一种真实而有用的需求,以便让他们看到的是与你看到的原始证据尽可能一致的东西,而不是你的猜测与归纳的结论。所以,大方的展示给我们看吧!
-
-### 按发生时间先后列出问题症状
-
-问题发生前的一系列操作,往往就是对找出问题最有帮助的线索。因此,你的说明里应该包含你的操作步骤,以及机器和软件的反应,直到问题发生。在命令行处理的情况下,提供一段操作记录(例如运行脚本工具所生成的),并引用相关的若干行(如 20 行)记录会非常有帮助。
-
-如果挂掉的程序有诊断选项(如 -v 的详述开关),试着选择这些能在记录中增加调试信息的选项。记住,`多`不等于`好`。试着选取适当的调试级别以便提供有用的信息而不是让读者淹没在垃圾中。
-
-如果你的说明很长(如超过四个段落),在开头简述问题,接下来再按时间顺序详述会有所帮助。这样黑客们在读你的记录时就知道该注意哪些内容了。
-
-### 描述目标而不是过程
-
-如果你想弄清楚如何做某事(而不是报告一个 Bug),在开头就描述你的目标,然后才陈述重现你所卡住的特定步骤。
-
-经常寻求技术帮助的人在心中有个更高层次的目标,而他们在自以为能达到目标的特定道路上被卡住了,然后跑来问该怎么走,但没有意识到这条路本身就有问题。结果要费很大的劲才能搞定。
-
-**蠢问题**
-
-> 我怎样才能从某绘图程序的颜色选择器中取得十六进制的 RGB 值?
-
-**聪明问题**
-
-> 我正试着用替换一幅图片的色码(color table)成自己选定的色码,我现在知道的唯一方法是编辑每个色码区块(table slot),
-> 但却无法从某绘图程序的颜色选择器取得十六进制的 RGB 值。
-
-第二种提问法比较聪明,你可能得到像是```建议采用另一个更合适的工具```的回复。
-
-### 清楚明确的表达你的问题以及需求
-
-漫无边际的提问是近乎无休无止的时间黑洞。最有可能给你有用答案的人通常也正是最忙的人(他们忙是因为要亲自完成大部分工作)。这样的人对无节制的时间黑洞相当厌恶,所以他们也倾向于厌恶那些漫无边际的提问。
-
-如果你明确表述需要回答者做什么(如提供指点、发送一段代码、检查你的补丁、或是其他等等),就最有可能得到有用的答案。因为这会定出一个时间和精力的上限,便于回答者能集中精力来帮你。这么做很棒。
-
-要理解专家们所处的世界,请把专业技能想像为充裕的资源,而回复的时间则是稀缺的资源。你要求他们奉献的时间越少,你越有可能从真正专业而且很忙的专家那里得到解答。
-
-所以,界定一下你的问题,使专家花在辨识你的问题和回答所需要付出的时间减到最少,这技巧对你有用答案相当有帮助 —— 但这技巧通常和简化问题有所区别。因此,问`我想更好地理解 X,可否指点一下哪有好一点说明?`通常比问`你能解释一下 X 吗?`更好。如果你的代码不能运作,通常请别人看看哪里有问题,比要求别人替你改正要明智得多。
-
-### 礼多人不怪,而且有时还很有帮助
-
-彬彬有礼,多用`请`和`谢谢您的关注`,或`谢谢你的关照`。让大家都知道你对他们花时间免费提供帮助心存感激。
-
-坦白说,这一点并没有比使用清晰、正确、精准且合乎语法和避免使用专用格式重要(也不能取而代之)。黑客们一般宁可读有点唐突但技术上鲜明的 Bug 报告,而不是那种有礼但含糊的报告。(如果这点让你不解,记住我们是按问题能教给我们什么来评价问题的价值的)
-
-然而,如果你有一串的问题待解决,客气一点肯定会增加你得到有用回应的机会。
-
-(我们注意到,自从本指南发布后,从资深黑客那里得到的唯一严重缺陷反馈,就是对预先道谢这一条。一些黑客觉得`先谢了`意味着事后就不用再感谢任何人的暗示。我们的建议是要么先说`先谢了`,**然后**事后再对回复者表示感谢,或者换种方式表达感激,譬如用`谢谢你的关注`或`谢谢你的关照`。)
-
-## 不该问的问题
-
-以下是几个经典蠢问题,以及黑客没回答时心中所想的:
-
-问题:[我能在哪找到 X 程序或 X 资源?](#q1)
-
-问题:[我怎样用 X 做 Y?](#q2)
-
-问题:[我的程序/设定/SQL 语句没有用](#q3)
-
-问题:[我的 Windows 电脑有问题,你能帮我吗?](#q4)
-
-问题:[我的程序不会动了,我认为系统工具 X 有问题](#q5)
-
-问题:[我在安装 Linux(或者 X )时有问题,你能帮我吗?](#q6)
-
-问题:[我怎么才能破解 root 帐号/窃取 OP 特权/读别人的邮件呢?](#q7)
-
----
-
-> 问题:我能在哪找到 X 程序或 X 资源?
-
-回答:就在我找到它的地方啊,白痴 —— 搜索引擎的那一头。天哪!难道还有人不会用 [Google](https://www.google.com) 吗?
-
-> 问题:我怎样用 X 做 Y?
-
-回答:如果你想解决的是 Y ,提问时别给出可能并不恰当的方法。这种问题说明提问者不但对 X 完全无知,也对 Y 要解决的问题糊涂,还被特定形势禁锢了思维。最好忽略这种人,等他们把问题搞清楚了再说。
-
-> 问题:我的{程序/设定/SQL 语句}没有用
-
-回答:这不算是问题吧,我对要我问你二十个问题才找得出你真正问题的问题没兴趣 —— 我有更有意思的事要做呢。在看到这类问题的时候,我的反应通常不外如下三种
-
-* 你还有什么要补充的吗?
-* 真糟糕,希望你能搞定。
-* 这关我屁事?
-
-> 问题:我的 Windows 电脑有问题,你能帮我吗?
-
-回答:能啊,扔掉微软的垃圾,换个像 Linux 或 BSD 的开源操作系统吧。
-
-注意:如果程序有官方版 Windows 或者与 Windows 有互动(如 Samba),你**可以**问与 Windows 相关的问题,只是别对问题是由 Windows 操作系统而不是程序本身造成的回复感到惊讶, 因为 Windows 一般来说实在太烂,这种说法通常都是对的。
-
-> 问题:我的程序不会动了,我认为系统工具 X 有问题
-
-回答:你完全有可能是第一个注意到被成千上万用户反复使用的系统调用与函数库文件有明显缺陷的人,更有可能的是你完全没有根据。不同凡响的说法需要不同凡响的证据,当你这样声称时,你必须有清楚而详尽的缺陷说明文件作后盾。
-
-> 问题:我在安装 Linux(或者 X )时有问题,你能帮我吗?
-
-回答:不能,我只有亲自在你的电脑上动手才能找到毛病。还是去找你当地的 Linux 使用群组者寻求实际的指导吧(你能在[这儿](http://www.linux.org/groups/index.html)找到用户群组的清单)。
-
-注意:如果安装问题与某 Linux 的发行版有关,在它的邮件列表、论坛或本地用户群组中提问也许是恰当的。此时,应描述问题的准确细节。在此之前,先用 `Linux` 和**所有**被怀疑的硬件作关键词仔细搜索。
-
-> 问题:我怎么才能破解 root 帐号/窃取 OP 特权/读别人的邮件呢?
-
-回答:想要这样做,说明了你是个卑鄙小人;想找个黑客帮你,说明你是个白痴!
-
-## 好问题与蠢问题
-
-最后,我将透过举一些例子,来说明怎样聪明的提问;同一个问题的两种问法被放在一起,一种是愚蠢的,另一种才是明智的。
-
-**蠢问题**:
-
-> 我从 foo 项目找来的源码没法编译。它怎么这么烂?
-
-他觉得都是别人的错,这个傲慢自大的提问者。
-
-**聪明问题**:
-
-> foo 项目代码在 Nulix 6.2 版下无法编译通过。我读过了 FAQ,但里面没有提到跟 Nulix 有关的问题。这是我编译过程的记录,我有什么做的不对的地方吗?
-
-提问者已经指明了环境,也读过了 FAQ,还列出了错误,并且他没有把问题的责任推到别人头上,他的问题值得被关注。
-
-**蠢问题**:
-
-> 我的主机板有问题了,谁来帮我?
-
-某黑客对这类问题的回答通常是:`好的,还要帮你拍拍背和换尿布吗?`,然后按下删除键。
-
-**聪明问题**:
-
-> 我在 S2464 主机板上试过了 X 、 Y 和 Z ,但没什么作用,我又试了 A 、 B 和 C 。请注意当我尝试 C 时的奇怪现象。显然 florbish 正在 grommicking,但结果出人意料。通常在 Athlon MP 主机板上引起 grommicking 的原因是什么?有谁知道接下来我该做些什么测试才能找出问题?
-
-## 如果得不到回答
-
-如果仍得不到回答,请不要以为我们觉得无法帮助你。有时只是看到你问题的人不知道答案罢了。没有回应不代表你被忽视,虽然不可否认这种差别很难区分。
-
-总的来说,简单的重复张贴问题是个很糟的点子。这将被视为无意义的喧闹。有点耐心,知道你问题答案的人可能生活在不同的时区,可能正在睡觉,也有可能你的问题一开始就没有组织好。
-
-你可以通过其他渠道获得帮助,这些渠道通常更适合初学者的需要。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/user_guide/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/user_guide/_category_.json
deleted file mode 100644
index 9c505a51..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/user_guide/_category_.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "label": "用户指南",
- "position": 2,
- "link": {
- "type": "generated-index",
- "description": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/user_guide/frame.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/user_guide/frame.md
deleted file mode 100644
index 5992f735..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/user_guide/frame.md
+++ /dev/null
@@ -1,60 +0,0 @@
----
-sidebar_position: 1
----
-
-# 为什么写
-
-[美团线程池文章](https://tech.meituan.com/2020/04/02/java-pooling-pratice-in-meituan.html "美团线程池文章") 介绍中,因为业务对线程池参数没有合理配置,触发过几起生产事故,进而引发了一系列思考。最终决定封装线程池动态参数调整,扩展线程池监控以及消息报警等功能。
-
-在开源平台找了挺多动态线程池项目,从功能性以及健壮性而言,个人感觉不满足企业级应用。
-
-因为对动态线程池比较感兴趣,加上想写一个有意义的项目,所以决定自己来造一个轻量级的轮子。
-
-想给项目起一个简单易记的名字,类似于 Eureka、Nacos、Redis;后和朋友商量,决定命名:**Hippo4j**。
-
-
-
-## 它解决了什么问题
-
-线程池在业务系统应该都有使用到,帮助业务流程提升效率以及管理线程,多数场景应用于大量的异步任务处理。
-
-虽然线程池提供了我们许多便利,但也并非尽善尽美,比如下面这些问题就无法很好解决。
-
-- 线程池随便定义,线程资源过多,造成服务器高负载。
-
-- 线程池参数不易评估,随着业务的并发提升,业务面临出现故障的风险。
-
-- 线程池任务执行时间超过平均执行周期,开发人员无法感知。
-
-- 线程池任务堆积,触发拒绝策略,影响既有业务正常运行。
-
-- 当业务出现超时、熔断等问题时,因为没有监控,无法确定是不是线程池引起。
-
-- 原生线程池不支持运行时变量的传递,比如 MDC 上下文遇到线程池就 GG。
-
-- 无法执行优雅关闭,当项目关闭时,大量正在运行的线程池任务被丢弃。
-
-- 线程池运行中,任务执行停止,怀疑发生死锁或执行耗时操作,但是无从下手。
-
-Hippo4j 很好解决了这些问题,它将业务中所有线程池统一管理,增强原生线程池系列功能。
-
-## 它有什么特性
-
-应用系统中线程池并不容易管理。参考美团的设计,Hippo4j 按照租户、项目、线程池的维度划分。再加上系统权限,让不同的开发、管理人员负责自己系统的线程池操作。
-
-举个例子,小编在一家公司的公共组件团队,团队中负责消息、短链接网关等项目。公共组件是租户,消息或短链接就是项目。
-
-Hippo4j 除去动态修改线程池,还包含实时查看线程池运行时指标、负载报警、配置日志管理等。
-
-- `hippo4j-adapter`:适配对第三方框架中的线程池进行监控,如 Dubbo、RocketMQ、Hystrix 等;
-- `hippo4j-auth`:用户、角色、权限等;
-- `hippo4j-common`:多个模块公用代码实现;
-- `hippo4j-config`:提供线程池准实时参数更新功能;
-- `hippo4j-console`:对接前端控制台;
-- `hippo4j-core`:核心的依赖,包括配置、核心包装类等;
-- `hippo4j-discovery`:提供线程池项目实例注册、续约、下线等功能;
-- `hippo4j-example` :示例工程;
-- `hippo4j-message` :配置变更以及报警通知发送;
-- `hippo4j-monitor` :线程池运行时监控;
-- `hippo4j-server` :Server 端发布需要的模块聚合;
-- `hippo4j-spring-boot`:SpringBoot Starter。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/user_guide/framework.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/user_guide/framework.md
deleted file mode 100644
index 33e24d1c..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/user_guide/framework.md
+++ /dev/null
@@ -1,51 +0,0 @@
----
-sidebar_position: 2
----
-
-# 架构设计
-
-简单来说,Hippo4j 从部署的角度上分为两种角色:Server 端和 Client 端。
-
-Server 端是 Hippo4j 项目打包出的 Java 进程,功能包括用户权限、线程池监控以及执行持久化的动作。
-
-Client 端指的是我们 SpringBoot 应用,通过引入 Hippo4j Starter Jar 包负责与 Server 端进行交互。
-
-比如拉取 Server 端线程池数据、动态更新线程池配置以及采集上报线程池运行时数据等。
-
-## 基础组件
-
-### 配置中心(Config)
-
-配置中心位于 Server 端,它的主要作用是监控 Server 端线程池配置变更,实时通知到 Client 实例执行线程池变更流程。
-
-代码设计基于 Nacos 1.x 版本的 **长轮询以及异步 Servlet 机制** 实现。
-
-### 注册中心(Discovery)
-
-负责管理 Client 端(单机或集群)注册到 Server 端的实例,包括不限于**实例注册、续约、过期剔除** 等操作,代码基于 Eureka 源码实现。
-
-上面的配置中心很容易理解,动态线程池参数变更的根本。但是注册中心是用来做什么的?
-
-注册中心管理 Client 端注册的实例,通过这些实例可以 **实时获取线程池的运行时参数信息**。
-
-目前的设计是如此,不排除后续基于 Discovery 做更多的扩展。
-
-### 控制台(Console)
-
-对接前端项目,包括不限于以下模块管理:
-
-
-
-## 消息通知(Notify)
-
-Hippo4j 内置了很多需要通知的事件,比如:线程池参数变更通知、线程池活跃度报警、拒绝策略执行报警以及阻塞队列容量报警等。
-
-目前 Notify 已经接入了钉钉、企业微信和飞书,后续持续集成邮件、短信等通知渠道;并且,Notify 模块提供了消息事件的 SPI 方案,可以接受三方自定义的推送。
-
-## Hippo4j-Spring-Boot-Starter
-
-熟悉 SpringBoot 的小伙伴对 Starter 应该不会陌生。Hippo4j 提供以 Starter Jar 包的形式嵌套在应用内,负责与 Server 端完成交互。
-
-## 功能架构
-
-
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/user_guide/notify.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/user_guide/notify.md
deleted file mode 100644
index 1be09e37..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/user_guide/notify.md
+++ /dev/null
@@ -1,71 +0,0 @@
----
-sidebar_position: 4
----
-
-# 通知报警
-
-现阶段已集成钉钉、企业微信、飞书的消息推送,后续会持续接入邮箱、短信和自定义通知渠道。
-
-
-
-**通知平台**
-
-- DING:钉钉平台;
-
-- LARK:飞书平台;
-
-- WECHAT:企业微信。
-
-**通知类型**
-
-- CONFIG:线程池配置变更推送;
-
-- ALARM:线程池运行报警推送。
-
-**Token**
-
-获取 DING、LARK、WECHAT 机器人 Token。
-
-**报警间隔**
-
-- CONFIG 类型通知没有报警间隔;
-
-- ALARM 类型设置报警间隔后,某一节点下的同一线程池指定间隔只会发送一次报警通知。
-
-**接收者**
-
-```tex
-多个接收者使用英文逗号 , 分割 (注意不要有空格)
-DING:填写手机号
-WECHART:填写user_id会以@的消息发给用户,填写姓名则是普通的@,如:龙台
-LARK:填写ou_开头用户唯一标识会以@的消息发给用户,填写手机号则是普通的@
-```
-
-
-## 钉钉平台
-
-[钉钉创建群机器人](https://www.dingtalk.com/qidian/help-detail-20781541.html)
-
-| 配置变更 | 报警通知 |
-| :---: | :---: |
-|  |  |
-
-添加钉钉机器人后,需在机器人配置自定义关键字,才可发送成功。如下所示:
-
-
-
-## 企业微信
-
-[企业微信创建群机器人](https://open.work.weixin.qq.com/help2/pc/14931?person_id=1&from=homesearch)
-
-| 配置变更 | 报警通知 |
-| :---: | :---: |
-|  |  |
-
-## 飞书平台
-
-[飞书创建群机器人](https://www.feishu.cn/hc/zh-CN/articles/360024984973)
-
-
-
-
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/user_guide/quick-start.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/user_guide/quick-start.md
deleted file mode 100644
index 59c5cdd5..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.2/user_docs/user_guide/quick-start.md
+++ /dev/null
@@ -1,40 +0,0 @@
----
-sidebar_position: 3
----
-
-# 快速开始
-
-## 服务启动
-
-使用 Docker 运行服务端,默认使用内置 H2 数据库,数据持久化到 Docker 容器存储卷中。
-
-```shell
-docker run -d -p 6691:6691 --name hippo4j-server hippo4j/hippo4j-server
-```
-
-> 如果没有 Docker,可以使用源码编译的方式,启动 [Hippo4j-Server/Hippo4j-Bootstrap](https://github.com/longtai-cn/hippo4j/tree/develop/hippo4j-server/hippo4j-bootstrap) 模块下 ServerApplication 应用类。
-
-启动示例项目,[hippo4j-spring-boot-starter-example](https://github.com/opengoofy/hippo4j/tree/develop/hippo4j-example/hippo4j-spring-boot-starter-example) 模块下 ServerExampleApplication 应用类。
-
-访问 Server 控制台,路径 `http://localhost:6691/index.html`,默认用户名密码:admin / 123456
-
-## 配置变更
-
-访问控制台动态线程池菜单下线程池实例,修改动态线程池相关参数。
-
-
-
-观察 Hippo4j-Example 控制台日志输出,日志输出包括不限于此信息即为成功。
-
-```tex
-2022-09-10 00:23:29.783 INFO 50322 --- [change.config_0] c.h.s.s.c.ServerThreadPoolDynamicRefresh : [message-consume] Dynamic thread pool change parameter.
- corePoolSize: 2 => 4
- maximumPoolSize: 6 => 12
- capacity: 1024 => 2048
- keepAliveTime: 9999 => 9999
- executeTimeOut: 800 => 3000
- rejectedType: SyncPutQueuePolicy => RunsOldestTaskPolicy
- allowCoreThreadTimeOut: true => true
-```
-
-另外,当 Client 集群部署时,可以修改某一个实例,或选择 `全部修改` 按钮,修改所有实例线程池信息。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3.json b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3.json
deleted file mode 100644
index a395bb56..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3.json
+++ /dev/null
@@ -1,82 +0,0 @@
-{
- "version.label": {
- "message": "1.4.3",
- "description": "The label for version 1.4.3"
- },
- "sidebar.tutorialSidebar.category.user_docs": {
- "message": "user_docs",
- "description": "The label for category user_docs in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar tutorialSidebar"
- },
- "sidebar.tutorialSidebar.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar tutorialSidebar"
- },
- "sidebar.user_docs.category.用户指南": {
- "message": "用户指南",
- "description": "The label for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.用户指南.link.generated-index.description": {
- "message": "帮助想要了解 Hippo4j 的用户快速掌握核心开发理念。",
- "description": "The generated-index page description for category 用户指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.快速开始": {
- "message": "快速开始",
- "description": "The label for category 快速开始 in sidebar user_docs"
- },
- "sidebar.user_docs.category.依赖配置中心": {
- "message": "依赖配置中心",
- "description": "The label for category 依赖配置中心 in sidebar user_docs"
- },
- "sidebar.user_docs.category.无中间件依赖": {
- "message": "无中间件依赖",
- "description": "The label for category 无中间件依赖 in sidebar user_docs"
- },
- "sidebar.user_docs.category.运维指南": {
- "message": "运维指南",
- "description": "The label for category 运维指南 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册": {
- "message": "开发者手册",
- "description": "The label for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.开发者手册.link.generated-index.description": {
- "message": "Hippo4j 留给使用者能够扩展的知识点。",
- "description": "The generated-index page description for category 开发者手册 in sidebar user_docs"
- },
- "sidebar.user_docs.category.其它": {
- "message": "其它",
- "description": "The label for category 其它 in sidebar user_docs"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/dev_manual/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/dev_manual/_category_.json
deleted file mode 100644
index 9117307f..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/dev_manual/_category_.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "label": "开发者手册",
- "position": 5,
- "link": {
- "type": "generated-index",
- "description": "Hippo4j 留给使用者能够扩展的知识点。"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/dev_manual/rejected-policy-custom.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/dev_manual/rejected-policy-custom.md
deleted file mode 100644
index e0405061..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/dev_manual/rejected-policy-custom.md
+++ /dev/null
@@ -1,57 +0,0 @@
----
-sidebar_position: 1
----
-
-# 拒绝策略自定义
-
-Hippo4j 通过 SPI 的方式对拒绝策略进行扩展,可以让用户在 Hippo4j 中完成自定义拒绝策略实现。
-
-## Hippo4j Server 拒绝策略扩展
-
-自定义拒绝策略,实现 `CustomRejectedExecutionHandler` 接口,示例如下:
-
-```java
-public class ErrorLogRejectedExecutionHandler implements CustomRejectedExecutionHandler {
-
- @Override
- public Integer getType() {
- return 12;
- }
-
- @Override
- public RejectedExecutionHandler generateRejected() {
- return new CustomErrorLogRejectedExecutionHandler();
- }
-
- public static class CustomErrorLogRejectedExecutionHandler implements RejectedExecutionHandler {
-
- @Override
- public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
- Logger logger = LoggerFactory.getLogger(this.getClass());
- logger.error("线程池抛出拒绝策略");
- }
- }
-}
-```
-
-创建 `src/main/resources/META-INF/services` 目录,创建 SPI 自定义拒绝策略文件 `cn.hippo4j.common.executor.support.CustomRejectedExecutionHandler`。
-
-`cn.hippo4j.common.executor.support.CustomRejectedExecutionHandler` 文件内仅放一行自定义拒绝策略全限定名即可,示例:
-
-```text
-cn.hippo4j.example.core.handler.ErrorLogRejectedExecutionHandler
-```
-
-创建、修改线程池页面选择 `CustomRejectedPolicy(自定义 SPI 策略)`。
-
-
-
-拒绝策略触发时,完成上述代码效果,仅打印异常日志提示。
-
-```text
-2022-08-01 21:27:49.515 ERROR 48928 --- [ateHandler.test] r$CustomErrorLogRejectedExecutionHandler : 线程池抛出拒绝策略
-```
-
-:::note
-具体参考 `hippo4j-example/hippo4j-spring-boot-starter-example` 模块。
-:::
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/dev_manual/rejected-policy-info.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/dev_manual/rejected-policy-info.md
deleted file mode 100644
index d5c68138..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/dev_manual/rejected-policy-info.md
+++ /dev/null
@@ -1,50 +0,0 @@
----
-sidebar_position: 0
----
-
-# 内置拒绝策略
-
-内置两种拒绝策略说明:
-
-**RunsOldestTaskPolicy**:添加新任务并由主线程运行最早的任务。
-
-```java
-public class RunsOldestTaskPolicy implements RejectedExecutionHandler {
-
- @Override
- public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
- if (executor.isShutdown()) {
- return;
- }
- BlockingQueue workQueue = executor.getQueue();
- Runnable firstWork = workQueue.poll();
- boolean newTaskAdd = workQueue.offer(r);
- if (firstWork != null) {
- firstWork.run();
- }
- if (!newTaskAdd) {
- executor.execute(r);
- }
- }
-}
-```
-
-**SyncPutQueuePolicy**:主线程把拒绝任务以阻塞的方式添加到队列。
-
-```java
-@Slf4j
-public class SyncPutQueuePolicy implements RejectedExecutionHandler {
-
- @Override
- public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
- if (executor.isShutdown()) {
- return;
- }
- try {
- executor.getQueue().put(r);
- } catch (InterruptedException e) {
- log.error("Adding Queue task to thread pool failed.", e);
- }
- }
-}
-```
\ No newline at end of file
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/getting_started/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/getting_started/_category_.json
deleted file mode 100644
index 72b1e151..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/getting_started/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "快速开始",
- "position": 3,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/getting_started/config/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/getting_started/config/_category_.json
deleted file mode 100644
index 78b3d9c4..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/getting_started/config/_category_.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "label": "依赖配置中心",
- "position": 2,
- "collapsed": true
-}
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/getting_started/config/hippo4j-config-default.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/getting_started/config/hippo4j-config-default.md
deleted file mode 100644
index 9c9e0fc9..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/getting_started/config/hippo4j-config-default.md
+++ /dev/null
@@ -1,45 +0,0 @@
----
-sidebar_position: 4
----
-
-# 参数默认配置
-
-曾有多名小伙伴反馈说,项目中线程池一多,配置文件中配置就显得很臃肿。为此 hippo4j-config 开发出了动态线程池默认配置。
-
-```yaml
-spring:
- dynamic:
- thread-pool:
- default-executor:
- core-pool-size: 4
- maximum-pool-size: 6
- blocking-queue: ResizableCapacityLinkedBlockingQueue
- queue-capacity: 1024
- execute-time-out: 1000
- keep-alive-time: 9999
- rejected-handler: AbortPolicy
- active-alarm: 90
- capacity-alarm: 85
- alarm: true
- allow-core-thread-time-out: true
- notify:
- interval: 5
- receives: chen.ma
- executors:
- - thread-pool-id: message-produce
- - thread-pool-id: message-consume
- core-pool-size: 80
- maximum-pool-size: 100
- execute-time-out: 1000
- notify:
- interval: 6
- receives: chen.ma
-```
-
-`spring.dynamic.thread-pool.executors` 层级下,仅需要配置 `thread-pool-id`,其余配置从 `spring.dynamic.thread-pool.default-executor` 读取。
-
-如果 `spring.dynamic.thread-pool.executors` 下配置和 `spring.dynamic.thread-pool.default-executor` 冲突,以前者为主。
-
-通过该自定义配置方式,可减少大量重复线程池参数配置项,提高核心配置简洁度。
-
-提示:`spring.dynamic.thread-pool.default-executor` 层级下参数,不提供动态刷新功能。
diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/getting_started/config/hippo4j-config-monitor.md b/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/getting_started/config/hippo4j-config-monitor.md
deleted file mode 100644
index 17d665e6..00000000
--- a/docs/i18n/zh/docusaurus-plugin-content-docs/version-1.4.3/user_docs/getting_started/config/hippo4j-config-monitor.md
+++ /dev/null
@@ -1,122 +0,0 @@
----
-sidebar_position: 3
----
-
-# 线程池监控
-
-## 线程池监控配置
-
-监控前置条件:需要先完成 hippo4j-config 的 [接入工作](/docs/user_docs/getting_started/config/hippo4j-config-start)。
-
-接下来引入 SpringBoot Actuator。Spring 2.x 一般都有版本指定,所以这里不用写版本号。
-
-```xml
-
-