
Cadre de gestion d'agents Java basé sur des plugins prenant en charge l'installation/désinstallation dynamique d'agents et des hooks de cycle de vie pour une surveillance et une instrumentation unifiées.
Si un plugin souhaite être notifié du cycle de vie, il peut implémenter l'interface :
PluginActivatorpublic interface PluginActivator {
// 让插件本身判断是否要启动
boolean enabled(PluginContext context);
public void init(PluginContext context) throws Exception;
/**
* Before calling this method, the {@link PluginState} is
* {@link PluginState#STARTING}, after calling, the {@link PluginState} is
* {@link PluginState#ACTIVE}
*
* @param context
*/
public void start(PluginContext context) throws Exception;
/**
* Before calling this method, the {@link PluginState} is
* {@link PluginState#STOPPING}, after calling, the {@link PluginState} is
* {@link PluginState#RESOLVED}
*
* @param context
*/
public void stop(PluginContext context) throws Exception;
}
Placez un fichier plugin.properties dans le répertoire du plugin, ainsi que le fichier jar de l'agent natif.
Par exemple :
type=traditional
name=demo-agent
version=1.0.0
agentJarPath=demo-agent.jar
one-java-agent lancera alors ce demo-agent.
mvn clean install pour bytekit.mvn clean package -DskipTests && mvn testmvn clean package -P local -DskipTests empaquette puis installe la dernière version localement dans le répertoire ~/oneoneagent.