in disco-java-agent/disco-java-agent-core/src/main/java/software/amazon/disco/agent/DiscoAgentTemplate.java [119:149]
public Collection<PluginOutcome> install(Instrumentation instrumentation, Set<Installable> installables, ElementMatcher.Junction<? super TypeDescription> customIgnoreMatcher) {
if (config.isRuntimeOnly()) {
log.info("DiSCo(Core) setting agent as runtime-only. Ignoring all Installables, including those in Plugins.");
installables.clear();
}
//give the Plugin Discovery subsystem the chance to scan any configured plugin folder.
if (allowPlugins) {
PluginDiscovery.scan(instrumentation, config);
installables.addAll(PluginDiscovery.processInstallables());
} else {
if (config.getPluginPath() != null) {
log.warn("DiSCo(Core) plugin path set but agent is disallowing plugins. No plugins will be loaded");
}
}
//give each installable the chance to handle command line args
for (Installable installable: installables) {
log.info("DiSCo(Core) passing arguments to " + installable.getClass().getSimpleName() + " to process");
installable.handleArguments(config.getArgs());
}
interceptionInstaller.install(instrumentation, installables, config, customIgnoreMatcher);
//after Installables have been installed, process the remaining plugin behaviour
if (allowPlugins) {
return PluginDiscovery.apply();
} else {
return new ArrayList<>(0);
}
}