Package com.google.gerrit.server.plugins
Class AbstractPreloadedPluginScanner
- java.lang.Object
- 
- com.google.gerrit.server.plugins.AbstractPreloadedPluginScanner
 
- 
- All Implemented Interfaces:
- PluginContentScanner
 
 public abstract class AbstractPreloadedPluginScanner extends Object implements 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 Summary- 
Nested classes/interfaces inherited from interface com.google.gerrit.server.plugins.PluginContentScannerPluginContentScanner.ExtensionMetaData
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected Plugin.ApiTypeapiTypeprotected StringpluginNameprotected StringpluginVersionprotected Set<Class<?>>preloadedClasses- 
Fields inherited from interface com.google.gerrit.server.plugins.PluginContentScannerEMPTY
 
- 
 - 
Constructor SummaryConstructors Constructor Description AbstractPreloadedPluginScanner(String pluginName, String pluginVersion, Set<Class<?>> preloadedClasses, Plugin.ApiType apiType)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ManifestgetManifest()Return 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 classes- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface com.google.gerrit.server.plugins.PluginContentScannerentries, getEntry, getInputStream
 
- 
 
- 
- 
- 
Field Detail- 
pluginNameprotected final String pluginName 
 - 
pluginVersionprotected final String pluginVersion 
 - 
apiTypeprotected final Plugin.ApiType apiType 
 
- 
 - 
Constructor Detail- 
AbstractPreloadedPluginScannerpublic AbstractPreloadedPluginScanner(String pluginName, String pluginVersion, Set<Class<?>> preloadedClasses, Plugin.ApiType apiType) 
 
- 
 - 
Method Detail- 
getManifestpublic Manifest getManifest() throws IOException Description 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
 
 
- 
 
-