Package com.google.gerrit.server.plugins
Class AbstractPreloadedPluginScanner
java.lang.Object
com.google.gerrit.server.plugins.AbstractPreloadedPluginScanner
- All Implemented Interfaces:
- PluginContentScanner
Base plugin scanner for a set of pre-loaded classes.
 
Utility base class for simplifying the development of Server plugin scanner based on a set of externally pre-loaded classes.
Extending this class you can implement very easily a PluginContentScanner from a set of pre-loaded Java Classes and an API Type. The convention used by this class is: - there is at most one Guice module per Gerrit module type (SysModule, HttpModule, SshModule) - plugin is set to be restartable in Gerrit Plugin MANIFEST - only Export and Listen annotated classes can be self-discovered
- 
Nested Class SummaryNested classes/interfaces inherited from interface com.google.gerrit.server.plugins.PluginContentScannerPluginContentScanner.ExtensionMetaData
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final Plugin.ApiTypeprotected final Stringprotected final StringFields inherited from interface com.google.gerrit.server.plugins.PluginContentScannerEMPTY
- 
Constructor SummaryConstructorsConstructorDescriptionAbstractPreloadedPluginScanner(String pluginName, String pluginVersion, Set<Class<?>> preloadedClasses, Plugin.ApiType apiType) 
- 
Method SummaryModifier and TypeMethodDescriptionReturn the plugin meta-data manifestMap<Class<? extends Annotation>,Iterable<PluginContentScanner.ExtensionMetaData>> scan(String pluginName, Iterable<Class<? extends Annotation>> annotations) Scans the plugin for declared public annotated classesMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.gerrit.server.plugins.PluginContentScannerentries, getEntry, getInputStream
- 
Field Details- 
pluginName
- 
pluginVersion
- 
preloadedClasses
- 
apiType
 
- 
- 
Constructor Details- 
AbstractPreloadedPluginScannerpublic AbstractPreloadedPluginScanner(String pluginName, String pluginVersion, Set<Class<?>> preloadedClasses, Plugin.ApiType apiType) 
 
- 
- 
Method Details- 
getManifestDescription copied from interface:PluginContentScannerReturn the plugin meta-data manifest- Specified by:
- getManifestin interface- PluginContentScanner
- Returns:
- Manifest of the plugin or null if plugin has no meta-data
- Throws:
- IOException- if an I/O problem occurred whilst accessing the Manifest
 
- 
scanpublic Map<Class<? extends Annotation>,Iterable<PluginContentScanner.ExtensionMetaData>> scan(String pluginName, Iterable<Class<? extends Annotation>> annotations) throws InvalidPluginException Description copied from interface:PluginContentScannerScans the plugin for declared public annotated classes- Specified by:
- scanin interface- PluginContentScanner
- Parameters:
- pluginName- the plugin name
- annotations- annotations declared by the plugin classes
- Returns:
- map of annotations and associated plugin classes found
- Throws:
- InvalidPluginException- if the plugin is not valid or corrupted
 
 
-