The Agent Controller is a daemon process that enables client applications to launch host processes and interact with agents that coexist within host processes. A single configuration file is used to manage the extent of its behavior.
The Agent Controller can be extended in various ways such as adding or extending a function, or adding a new agent. To enable the Agent Controller to utilize your plug-in function, the Agent Controller configuration file needs to be modified. This can be done by extending the configuration generator which will enable a custom configuration file to be generated when SetConfig is run. By extending the configuration generator, you will have the ability to query user-specific information at setup time and use this information to generate a customized configuration file. As well, you can provide your own logic in the extension to generate platform-specific configuration files.
Follow the steps below to extend the configuration generator to generate a configuration file for your own plug-in:
public static String TAG = "<your plug-in package name>"; // e.g. org.eclipse.hyades.datacollection
public SetConfig() { super(TAG); }
public void init(Hashtable hash) { String home = HashUtility.getValue(hash, "RASERVER_HOME"); setFileName(home + sr + "plug-ins" + sr + TAG + sr + "config" + sr + "pluginconfig.xml"); }
//You should start this method with this section: doc = configFile.getDoc(); if(doc == null) { return; } pConfig = doc.createElement(PluginConfig.TAG); holder = configFile.getHolder(); holder.appendChild(pConfig); //End plug-in end the method with this section: option = doc.createElement(Option.TAG); Option.setName(option, TAG); Option.setType(option, "version"); Option.setValue(option, getString("Config.Plugin.Version")); pConfig.appendChild(option); configFile.saveToFile();
Refer to the Hyades project org.eclipse.hyades.collection.framework. The examples are located under the src.config source folder: