Feat: add Enabled flag for JarLoader module

- libagent: gate JarLoaderService::onLoaded on the JarLoader.Enabled key (default false) so the module can be turned off from config

- examples: set Enabled = true in inject-via-java-api, load-via-injector-exe and retransform-class config.toml
This commit is contained in:
xiaozhou233 committed 2026-10-14 21:46:18 +08:00
1 parent f38a28e8b3
commit 56a1c32f49
4 files changed
+11

No files matched your search

@@ -35,6 +35,14 @@ private:
auto& agent = Agent::getInstance();
auto& cfg = agent.getConfig();
const bool enabled = cfg.get<bool>(
"JarLoader.Enabled", false);
if (!enabled) {
spdlog::info("[JarLoaderService] Disabled by config");
return;
}
const std::string injection_dir = cfg.getPath(
"JarLoader.InjectionDir",
(cfg.getRuntimeDir() / "injection").string()