Cool-Coding commented on code in PR #146:
URL: https://github.com/apache/skywalking-java/pull/146#discussion_r848017887
##########
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java:
##########
@@ -234,4 +235,12 @@ static void configureLogger() {
LogManager.setLogResolver(new PatternLogResolver());
}
}
+
+ public static void pluginInitCompleted() {
+ IS_PLUGIN_INIT_COMPLETED = true;
+ }
+
+ public static boolean isPluginInitCompleted() {
+ return IS_PLUGIN_INIT_COMPLETED;
+ }
Review Comment:
> @Cool-Coding I think this part of codes has not been polished yet.
I have polished the `WriterFactoryTest` UT adding the code `
BDDMockito.given(SnifferConfigInitializer.isPluginInitCompleted()).willReturn(true)`.
The UT passed.
And the statement `SnifferConfigInitializer.pluginInitCompleted()` has been
moved after `installOn(instrumentation)`.
```
agentBuilder.type(pluginFinder.buildMatch())
.transform(new Transformer(pluginFinder))
.with(AgentBuilder.RedefinitionStrategy.RETRANSFORMATION)
.with(new RedefinitionListener())
.with(new Listener())
.installOn(instrumentation);
SnifferConfigInitializer.pluginInitCompleted();
try {
ServiceManager.INSTANCE.boot();
} catch (Exception e) {
LOGGER.error(e, "Skywalking agent boot failure.");
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]