Advanced Customization > Services and Infrastructure Customization > System Configuration Collector Plugin > Creating a System Configuration Collector Plugin > Deploying the Plugin
  
Deploying the Plugin
Finally, the plugin packaged files must be bundled and deployed into Windchill. As mentioned in Compiling the Plugin, the System Configuration Collector makes use of a Java class loader to load all files that are custom plugins. For the class loader to recognize a plugin, a service file must be created and deployed with the plugin (see Solution Elements and Related Websites for information on this file).
The steps to have a functionally deployed plugin are:
1. Package the files.
2. Jar the files.
3. Deploy the Jar.
1. At the root location of your packaged source directory create a directory named “META-INF”. Inside that directory, create a sub-directory named “services”. Inside the services directory, create a text file named “com.ptc.customersupport.mbeans.PluginMBean”. This is the service file which the class loader will examine for plugin class files. This file must contain each plugin to be loaded and must follow a strict syntax format. The format for each plugin entry in the service file is of the form:
<java source package>.<plugin class name> (without the brackets).
For example, returning to the CustomPlugin example the corresponding service file would appear as, and only contain this one line:
com.ptc.customersupport.mbeans.plugins.CustomPlugin
Here is an example of the package structure for the CustomPlugin source, class files and service file.
The items of note are:
The package structure to the CustomPlugin source, com/ptc/customersupport/mbeans/plugins is maintained.
The .class files exist in the /plugins directory. Optionally, the .java source files can exist there as well.
The META-INF/services directory exists.
The /services directory contains the “com.ptc.customersupport.mbeans.PluginMBean” file with an entry for each plugin to be loaded.
2. After creating the package structure and the services file it is necessary to bundle the files into a Java .jar file. See Related Websites for complete details on using Java’s jar command.
Using a Windchill shell, navigate to your root package location and create the .jar file.
Returning to our example above showing the package structure and using the command
jar cvfM CustomPlugin.jar ./com ./META-INF
yields CustomPlugin.jar that contains all the contents of the /com and /META-INF directories, including their subdirectories.
3. Lastly, this .jar file needs to be deployed into the System Configuration Collector class loader location. Copy this file and place it in <Windchill>/utilities/SystemConfigurationCollector/plugins directory.
Now the plugin can be used in the System Configuration Collector page. To do so, simply refresh the browser and add the custom plugin to a custom category. See the help on using the System Configuration Collector for more information on creating custom categories.
For more information regarding the System Configuration Collector and its uses see System Configuration Collector.
Alternatively, you can deploy the plugin for use in a JMX console since all plugins are MBeans. Using a JMX Console navigate to the CustomerSupport MBean and run the reloadPlugins() operation. This operation forces the plugin MBean loader to reload all the available plugins including those at the deployment location. The below screen shot shows a user invoking the reloadPlugins CustomerSupport MBean operation.
After invoking the reloadPlugins CustomerSupport MBean operation, the custom plugin will be displayed under the com.ptc/plugins MBean node in the respective plugin type subdirectory for which the plugin was defined.
See Intended Outcome for more details and images regarding reloading plugins from a JMX Console.