# HG changeset patch # User Omair Majid # Date 1361481970 18000 # Node ID e7411f4afdf10849b1a02cd548746cb5f216c703 # Parent a379ce735df595e80ee59170519f0a0f10ada6dd Add some javadocs to plugin-related classes Reviewed-by: rkennke Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2013-February/005798.html diff -r a379ce735df5 -r e7411f4afdf1 launcher/src/main/java/com/redhat/thermostat/launcher/internal/PluginCommandInfoSource.java --- a/launcher/src/main/java/com/redhat/thermostat/launcher/internal/PluginCommandInfoSource.java Thu Feb 21 13:34:34 2013 -0500 +++ b/launcher/src/main/java/com/redhat/thermostat/launcher/internal/PluginCommandInfoSource.java Thu Feb 21 16:26:10 2013 -0500 @@ -56,6 +56,16 @@ import com.redhat.thermostat.launcher.internal.PluginConfiguration.CommandExtensions; import com.redhat.thermostat.launcher.internal.PluginConfiguration.NewCommand; +/** + * Searches for plugins under $THERMOSTAT_HOME/plugins/ and + * provides information about all commands specified by them. + *

+ * Each plugin is located under + * $THERMOSTAT_HOME/plugins/$PLUGIN_NAME/ and must have a + * plugin.xml file in the main plugin directory. + * + * @see PluginConfigurationParser how the plugin.xml file is parsed + */ public class PluginCommandInfoSource implements CommandInfoSource { private static final String PLUGIN_CONFIG_FILE = "plugin.xml"; @@ -69,8 +79,7 @@ this(new File(internalJarRoot), new File(pluginRootDir), new PluginConfigurationParser()); } - public PluginCommandInfoSource(File internalJarRoot, File pluginRootDir, - PluginConfigurationParser parser) { + PluginCommandInfoSource(File internalJarRoot, File pluginRootDir, PluginConfigurationParser parser) { File[] pluginDirs = pluginRootDir.listFiles(); if (pluginDirs == null) { logger.log(Level.SEVERE, "plugin root dir " + pluginRootDir + " does not exist"); diff -r a379ce735df5 -r e7411f4afdf1 launcher/src/main/java/com/redhat/thermostat/launcher/internal/PluginConfigurationParser.java --- a/launcher/src/main/java/com/redhat/thermostat/launcher/internal/PluginConfigurationParser.java Thu Feb 21 13:34:34 2013 -0500 +++ b/launcher/src/main/java/com/redhat/thermostat/launcher/internal/PluginConfigurationParser.java Thu Feb 21 16:26:10 2013 -0500 @@ -64,7 +64,38 @@ /** * Parses the configuration of a plugin as specified in an {@code File} or an - * {@code InputStream}. + * {@code InputStream}. This configuration describes which new commands this + * plugin provides as well as additional jars to load for existing commands. + *

+ * A example configuration looks like the following: + * + *

+ * <?xml version="1.0"?>
+ * <plugin>
+ *   <commands>
+ *     <command type="extends">
+ *       <name>gui</name>
+ *       <bundles>
+ *         <bundle>hello-world-plugin-0.1-SNAPSHOT.jar</bundle>
+ *       </bundles>
+ *       <dependencies>
+ *         <dependency>thermostat-client-core-0.6.0-SNAPSHOT.jar</dependency>
+ *       </dependencies>
+ *     </command>
+ *     <command type="provides">
+ *       <name>hello</name>
+ *       <description>print hello</description>
+ *       <usage>hello</usage>
+ *       <bundles>
+ *         <bundle>hello-world-plugin-0.1-SNAPSHOT.jar</bundle>
+ *       </bundles>
+ *       <dependencies>
+ *         <dependency>thermostat-client-core-0.6.0-SNAPSHOT.jar</dependency>
+ *       </dependencies>
+ *     </command>
+ *   </commands>
+ * </plugin>
+ * 
*

* This class is thread-safe */