public class ScmModuleDescriptor extends BaseWeightedModuleDescriptor<Scm>
ModuleDescriptor which interprets <scm/> tags in atlassian-plugin.xml.
<scm id="scm" class="com.example.scm.CustomScm" weight="100"/>
Because this module descriptor uses the ModuleFactory to create the Scm instance, the "class" for the
Scm may also reference a bean:
<component id="customScm" class="com.example.scm.CustomScm"/>
<scm id="scm" class="bean:customScm"/>
Using the "bean:" approach allows plugins to declare their custom Scm implementations as public components,
allowing other plugins to component-import them and use them.
This module descriptor caches the Scm instance it creates, and returns the same instance on subsequent calls
until the module is disabled or uninstalled. As a result, as documented on the Scm interface, implementations
are required to be thread-safe, because the same instance will be used by multiple threads.
SCMs are weighted, which is used to control the order they are returned in when retrieving
available SCMs. The higher the weight, the later in the set they will
appear. Additionally, if multiple SCMs are registered with the same ID, the one with the lowest
weight will be used.
| Modifier and Type | Field and Description |
|---|---|
static String |
XML_ELEMENT_NAME |
key, moduleClass, moduleClassName, moduleFactory, name, plugin, resourcesCOMPARABLE| Constructor and Description |
|---|
ScmModuleDescriptor(com.atlassian.plugin.module.ModuleFactory moduleFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
disabled()
Clears the cached
Scm. |
Scm |
getModule()
Retrieves the
Scm instance for this descriptor. |
compareTo, getWeight, initassertModuleClassImplements, checkPermissions, destroy, enabled, equals, getCompleteKey, getDescription, getDescriptionKey, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getModuleClassName, getName, getParams, getPlugin, getPluginKey, getRequiredPermissions, getResourceDescriptor, getResourceDescriptors, getResourceLocation, getScopeKey, hashCode, isBroken, isEnabled, isEnabledByDefault, isSystemModule, loadClass, provideValidationRules, satisfiesMinJavaVersion, setBroken, setPlugin, toString, validatepublic static final String XML_ELEMENT_NAME
public ScmModuleDescriptor(com.atlassian.plugin.module.ModuleFactory moduleFactory)
Copyright © 2024 Atlassian. All rights reserved.