public abstract class AbstractPlugin extends Object implements PluginInternal, Comparable<Plugin>
p1.equals(p2) == true will give p1.compareTo(p2) == 0 but the opposite is not guaranteed because we keep a map of plugins versus loaders in the DefaultPluginManager .
A plugin with the same key and version may well be loaded from multiple loaders (in fact with UPM it's almost guaranteed) so we CANNOT override equals.
| Modifier and Type | Field and Description |
|---|---|
protected PluginArtifact |
pluginArtifact |
| Constructor and Description |
|---|
AbstractPlugin(PluginArtifact pluginArtifact) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetClassLoader, getResource, getResourceAsStream, isDeleteable, isDynamicallyLoaded, isUninstallable, loadClassprotected final PluginArtifact pluginArtifact
public AbstractPlugin(PluginArtifact pluginArtifact)
protected org.slf4j.Logger getLog()
public String getI18nNameKey()
getI18nNameKey in interface Pluginpublic void setI18nNameKey(String i18nNameKey)
setI18nNameKey in interface Pluginpublic void addModuleDescriptor(ModuleDescriptor<?> moduleDescriptor)
addModuleDescriptor in interface Pluginprotected void removeModuleDescriptor(String key)
public Collection<ModuleDescriptor<?>> getModuleDescriptors()
getModuleDescriptors in interface Pluginpublic ModuleDescriptor<?> getModuleDescriptor(String key)
getModuleDescriptor in interface Pluginpublic <T> List<ModuleDescriptor<T>> getModuleDescriptorsByModuleClass(Class<T> aClass)
getModuleDescriptorsByModuleClass in interface Pluginpublic PluginState getPluginState()
getPluginState in interface Pluginprotected void setPluginState(PluginState state)
protected boolean compareAndSetPluginState(PluginState requiredExistingState, PluginState desiredState)
requiredExistingState - The expected statedesiredState - The desired statepublic boolean isEnabledByDefault()
isEnabledByDefault in interface Pluginpublic void setEnabledByDefault(boolean enabledByDefault)
setEnabledByDefault in interface Pluginpublic int getPluginsVersion()
getPluginsVersion in interface Pluginpublic void setPluginsVersion(int pluginsVersion)
setPluginsVersion in interface Pluginpublic PluginInformation getPluginInformation()
getPluginInformation in interface Pluginpublic void setPluginInformation(PluginInformation pluginInformation)
setPluginInformation in interface Pluginpublic void setResources(Resourced resources)
setResources in interface Pluginpublic List<ResourceDescriptor> getResourceDescriptors()
getResourceDescriptors in interface Resourcedpublic ResourceLocation getResourceLocation(String type, String name)
getResourceLocation in interface Resourcedpublic ResourceDescriptor getResourceDescriptor(String type, String name)
getResourceDescriptor in interface Resourcedprotected PluginState enableInternal() throws PluginException
PluginState.PENDING is returned, it will be passed to setPluginState(PluginState). If a subclass
returns PluginState.PENDING, no state is set, and it is assumed the subclass has taken responsibility for
transitioning state via direct calls to setPluginState(PluginState).
Subclasses should only throw PluginException.PluginState.ENABLED, PluginState.ENABLING, or PluginState.PENDINGPluginException - If the plugin could not be enabledprotected void disableInternal()
throws PluginException
PluginException.PluginException - If the plugin could not be disabled@Nonnull public PluginDependencies getDependencies()
getDependencies in interface Pluginpublic final Set<String> getActivePermissions()
getActivePermissions in interface Pluginpublic final boolean hasAllPermissions()
hasAllPermissions in interface Pluginpublic InstallationMode getInstallationMode()
getInstallationMode in interface Pluginpublic void close()
protected void installInternal()
throws PluginException
PluginException.PluginException - If the plugin could not be installedprotected void uninstallInternal()
throws PluginException
PluginException.PluginException - If the plugin could not be uninstalledpublic boolean isSystemPlugin()
isSystemPlugin in interface Pluginpublic boolean containsSystemModule()
containsSystemModule in interface Pluginpublic void setSystemPlugin(boolean system)
setSystemPlugin in interface Pluginpublic Date getDateLoaded()
getDateLoaded in interface Pluginpublic Date getDateInstalled()
getDateInstalled in interface Plugin@ExperimentalApi public Date getDateEnabling()
getDateEnabling in interface Plugin@ExperimentalApi public Date getDateEnabled()
getDateEnabled in interface Pluginpublic boolean isBundledPlugin()
isBundledPlugin in interface Pluginpublic void setBundledPlugin(boolean bundledPlugin)
PluginInternalsetBundledPlugin in interface PluginInternalbundledPlugin - true if this plugin is a "bundled" plugin.public PluginArtifact getPluginArtifact()
getPluginArtifact in interface Pluginpublic Optional<String> getScopeKey()
getScopeKey in interface ScopeAwarepublic Iterable<ModuleDescriptor<?>> getDynamicModuleDescriptors()
getDynamicModuleDescriptors in interface PluginInternalpublic boolean addDynamicModuleDescriptor(ModuleDescriptor<?> module)
PluginInternaladdDynamicModuleDescriptor in interface PluginInternalmodule - to addpublic boolean removeDynamicModuleDescriptor(ModuleDescriptor<?> module)
PluginInternalremoveDynamicModuleDescriptor in interface PluginInternalmodule - to removepublic int compareTo(@Nonnull Plugin otherPlugin)
compareTo in interface Comparable<Plugin>otherPlugin - The plugin to be compared.VersionStringComparator,
Comparable.compareTo(T)Copyright © 2020 Atlassian. All rights reserved.