Package com.atlassian.bitbucket.scm
Class ScmModuleDescriptor
java.lang.Object
com.atlassian.plugin.descriptors.AbstractModuleDescriptor<T>
com.atlassian.bitbucket.scm.BaseWeightedModuleDescriptor<Scm>
com.atlassian.bitbucket.scm.ScmModuleDescriptor
- All Implemented Interfaces:
Weighted
,com.atlassian.plugin.ModuleDescriptor<Scm>
,com.atlassian.plugin.Resourced
,com.atlassian.plugin.ScopeAware
,com.atlassian.plugin.StateAware
,Comparable<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.
-
Field Summary
Fields inherited from class com.atlassian.plugin.descriptors.AbstractModuleDescriptor
key, moduleClass, moduleClassName, moduleFactory, name, plugin, resources
Fields inherited from interface com.atlassian.bitbucket.util.Weighted
COMPARABLE
-
Constructor Summary
ConstructorDescriptionScmModuleDescriptor
(com.atlassian.plugin.module.ModuleFactory moduleFactory) -
Method Summary
Methods inherited from class com.atlassian.bitbucket.scm.BaseWeightedModuleDescriptor
compareTo, getWeight, init
Methods inherited from class com.atlassian.plugin.descriptors.AbstractModuleDescriptor
assertModuleClassImplements, 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, satisfiesMinJavaVersion, setBroken, setPlugin, toString, validate
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.atlassian.plugin.ModuleDescriptor
getDisplayName
-
Field Details
-
XML_ELEMENT_NAME
- See Also:
-
-
Constructor Details
-
ScmModuleDescriptor
public ScmModuleDescriptor(com.atlassian.plugin.module.ModuleFactory moduleFactory)
-
-
Method Details