
Plugin-basiertes Java-Agenten-Management-Framework mit Unterstützung für dynamische Installation/Deinstallation von Agenten und Lifecycle-Hooks für einheitliches Monitoring und Instrumentierung.
Wenn ein Plugin den Lebenszyklus verfolgen möchte, kann es das PluginActivator-Interface implementieren:
public interface PluginActivator {
// Let the plugin itself decide whether to start
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;
}
Legen Sie eine plugin.properties-Datei im Plugin-Verzeichnis ab und fügen Sie die native Agent-Jar-Datei hinzu.
Beispiel:
type=traditional
name=demo-agent
version=1.0.0
agentJarPath=demo-agent.jar
Dann startet one-java-agent diesen demo-agent.
mvn clean install für bytekit ausgeführt werden.mvn clean package -DskipTests && mvn testmvn clean package -P local -DskipTests wird das Paket erstellen und die neueste Version lokal im Verzeichnis ~/oneoneagent installieren.