public abstract class AbstractPreloadedPluginScanner extends java.lang.Object implements PluginContentScanner
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
PluginContentScanner.ExtensionMetaData| Modifier and Type | Field and Description | 
|---|---|
protected Plugin.ApiType | 
apiType  | 
protected java.lang.String | 
pluginName  | 
protected java.lang.String | 
pluginVersion  | 
protected java.util.Set<java.lang.Class<?>> | 
preloadedClasses  | 
EMPTY| Constructor and Description | 
|---|
AbstractPreloadedPluginScanner(java.lang.String pluginName,
                              java.lang.String pluginVersion,
                              java.util.Set<java.lang.Class<?>> preloadedClasses,
                              Plugin.ApiType apiType)  | 
| Modifier and Type | Method and Description | 
|---|---|
java.util.jar.Manifest | 
getManifest()
Return the plugin meta-data manifest 
 | 
java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.Iterable<PluginContentScanner.ExtensionMetaData>> | 
scan(java.lang.String pluginName,
    java.lang.Iterable<java.lang.Class<? extends java.lang.annotation.Annotation>> annotations)
Scans the plugin for declared public annotated classes 
 | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitentries, getEntry, getInputStreamprotected final java.lang.String pluginName
protected final java.lang.String pluginVersion
protected final java.util.Set<java.lang.Class<?>> preloadedClasses
protected final Plugin.ApiType apiType
public AbstractPreloadedPluginScanner(java.lang.String pluginName,
                                      java.lang.String pluginVersion,
                                      java.util.Set<java.lang.Class<?>> preloadedClasses,
                                      Plugin.ApiType apiType)
public java.util.jar.Manifest getManifest()
                                   throws java.io.IOException
PluginContentScannergetManifest in interface PluginContentScannerjava.io.IOException - if an I/O problem occurred whilst accessing the Manifestpublic java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.Iterable<PluginContentScanner.ExtensionMetaData>> scan(java.lang.String pluginName, java.lang.Iterable<java.lang.Class<? extends java.lang.annotation.Annotation>> annotations) throws InvalidPluginException
PluginContentScannerscan in interface PluginContentScannerpluginName - the plugin nameannotations - annotations declared by the plugin classesInvalidPluginException - if the plugin is not valid or corrupted