This plugin demonstrates how to write a plugin that implements PropertiesChecker interface. Further details can be found in the server programming guide.
If you want to try this plugin, you'll need to copy the file propertieschecker.zip of this sample into the plugins folder of your server installation and restart the server. You can verify whether the plugin has been activated in the 'Plug-Ins' dialog of the configuration module.
As a next step you can start to write your own custom server plugin. It has to implement the interface com.inet.plugin.ServerPlugin
and must have an empty public constructor. Your custom implementation of the PropertiesChecker has to be registered in the method registerExtension
to be recognized by the server.
This can look like:
public void registerExtension( ServerPluginManager spm ) { spm.register( PropertiesChecker.class, new CustomPropertiesChecker() ); }
Please refer to the sample com.inet.samples.propertieschecker.CustomPropertiesChecker
for a full code sample.
The following steps need to be taken if changes are made to the plugin code.
The plugin.properties
and server plugin class are preconfigured to be used without modifications. If the sample is the basis for a custom plugin or just needs some adaptions, please refer to the platform programming guide for detailed instructions.
In order to build this plugin the following jar files are required at the least:
inetcore.jar
(included in the core
directory)reporting.jar
(included in the plugins/reporting.zip
file)You can copy these files to the current sample directory or link them into the project of your IDE.
The plugin must be compiled into a jar file that is named like the id of the plugin. In this example it is propertieschecker.jar
. It also must contain the compiled sources as well as required language resources and images.
The target plugin is a zip file, named propertieschecker.zip
in this example. It contains the compiled jar file and the plugin.properties
which configures the custom plugin.
The provided build.gradle
in the sample can be used to build the plugin. Different build systems can be used as well but have to be configured manually.
Copy the ZIP file of the plugin into the plugins directory of the server and restart it. If there are problems, please check the log file of the server for more details. The "Config" logger is used to log plugin registration issues.