optimize: fix StyleCheck errors for hippo4j-agent-bootstrap (#1292)

* optimize: fix StyleCheck errors for hippo4j-agent-bootstrap

* optimize: fix StyleCheck errors for hippo4j-agent-bootstrap

* optimize: fix StyleCheck errors for hippo4j-agent-bootstrap
pull/1294/head
Xin Chen 2 years ago committed by GitHub
parent a33a376cbb
commit 5a124e85a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -18,7 +18,6 @@
package cn.hippo4j.agent.bootstrap; package cn.hippo4j.agent.bootstrap;
import cn.hippo4j.agent.core.boot.AgentPackageNotFoundException; import cn.hippo4j.agent.core.boot.AgentPackageNotFoundException;
import cn.hippo4j.agent.core.boot.DefaultNamedThreadFactory;
import cn.hippo4j.agent.core.boot.ServiceManager; import cn.hippo4j.agent.core.boot.ServiceManager;
import cn.hippo4j.agent.core.conf.Config; import cn.hippo4j.agent.core.conf.Config;
import cn.hippo4j.agent.core.conf.SnifferConfigInitializer; import cn.hippo4j.agent.core.conf.SnifferConfigInitializer;
@ -49,15 +48,14 @@ import java.security.ProtectionDomain;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import static net.bytebuddy.matcher.ElementMatchers.nameContains; import static net.bytebuddy.matcher.ElementMatchers.nameContains;
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith; import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
import static net.bytebuddy.matcher.ElementMatchers.not; import static net.bytebuddy.matcher.ElementMatchers.not;
/**
* Hippo4j Agent
*/
public class Hippo4jAgent { public class Hippo4jAgent {
private static ILog LOGGER = LogManager.getLogger(Hippo4jAgent.class); private static ILog LOGGER = LogManager.getLogger(Hippo4jAgent.class);
@ -151,6 +149,9 @@ public class Hippo4jAgent {
.addShutdownHook(new Thread(ServiceManager.INSTANCE::shutdown, "hippo4j service shutdown thread")); .addShutdownHook(new Thread(ServiceManager.INSTANCE::shutdown, "hippo4j service shutdown thread"));
} }
/**
* transformer
*/
private static class Transformer implements AgentBuilder.Transformer { private static class Transformer implements AgentBuilder.Transformer {
private PluginFinder pluginFinder; private PluginFinder pluginFinder;
@ -193,6 +194,9 @@ public class Hippo4jAgent {
return nameStartsWith("cn.hippo4j").and(not(nameStartsWith("cn.hippo4j.agent.toolkit."))); return nameStartsWith("cn.hippo4j").and(not(nameStartsWith("cn.hippo4j.agent.toolkit.")));
} }
/**
* listener
*/
private static class Listener implements AgentBuilder.Listener { private static class Listener implements AgentBuilder.Listener {
@Override @Override
@ -235,6 +239,9 @@ public class Hippo4jAgent {
} }
} }
/**
* redefinition listener
*/
private static class RedefinitionListener implements AgentBuilder.RedefinitionStrategy.Listener { private static class RedefinitionListener implements AgentBuilder.RedefinitionStrategy.Listener {
@Override @Override

@ -30,4 +30,6 @@
<suppress checks="MagicNumber" files="DashboardServiceImpl.java"/> <suppress checks="MagicNumber" files="DashboardServiceImpl.java"/>
<suppress checks="MagicNumber" files="DefaultThreadPoolCheckAlarmHandler.java"/> <suppress checks="MagicNumber" files="DefaultThreadPoolCheckAlarmHandler.java"/>
<suppress checks="TypeName" files="SpringBootConfig.java"/> <suppress checks="TypeName" files="SpringBootConfig.java"/>
<suppress checks="ReturnCount" files="Hippo4jAgent.java"/>
<suppress checks="StaticVariableName" files="Hippo4jAgent.java"/>
</suppressions> </suppressions>

Loading…
Cancel
Save