com.atlassian.plugin
Interface Plugin

All Superinterfaces:
java.lang.Comparable, Resourced
All Known Implementing Classes:
DynamicPlugin, StaticPlugin, UnloadablePlugin

public interface Plugin
extends Resourced, java.lang.Comparable


Field Summary
static java.util.Comparator NAME_COMPARATOR
           
 
Method Summary
 void addModuleDescriptor(ModuleDescriptor moduleDescriptor)
           
 void close()
          Free any resources held by this plugin.
 boolean containsSystemModule()
           
 java.util.Date getDateLoaded()
          The date this plugin was loaded into the system.
 java.lang.String getI18nNameKey()
           
 java.lang.String getKey()
           
 ModuleDescriptor getModuleDescriptor(java.lang.String key)
           
 java.util.Collection getModuleDescriptors()
           
 java.util.List getModuleDescriptorsByModuleClass(java.lang.Class aClass)
           
 java.lang.String getName()
           
 PluginInformation getPluginInformation()
           
 java.io.InputStream getResourceAsStream(java.lang.String name)
          Load a given resource from the plugin.
 boolean isBundledPlugin()
          Whether the plugin is a "bundled" plugin that can't be removed.
 boolean isDeleteable()
          Should the plugin file be deleted on unistall?
 boolean isDynamicallyLoaded()
          Whether or not this plugin is loaded dynamically at runtime
 boolean isEnabled()
           
 boolean isEnabledByDefault()
           
 boolean isSystemPlugin()
          Whether the plugin is a "system" plugin that shouldn't be made visible to the user
 boolean isUninstallable()
          Whether or not this plugin can be 'uninstalled'.
 java.lang.Class loadClass(java.lang.String clazz, java.lang.Class callingClass)
          Get the plugin to load a specific class.
 void setEnabled(boolean enabled)
           
 void setEnabledByDefault(boolean enabledByDefault)
           
 void setI18nNameKey(java.lang.String i18nNameKey)
           
 void setKey(java.lang.String aPackage)
           
 void setName(java.lang.String name)
           
 void setPluginInformation(PluginInformation pluginInformation)
           
 void setResources(Resourced resources)
           
 void setSystemPlugin(boolean system)
           
 
Methods inherited from interface com.atlassian.plugin.Resourced
getResourceDescriptor, getResourceDescriptors, getResourceDescriptors, getResourceLocation
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

NAME_COMPARATOR

static final java.util.Comparator NAME_COMPARATOR
Method Detail

getName

java.lang.String getName()

setName

void setName(java.lang.String name)

getI18nNameKey

java.lang.String getI18nNameKey()

setI18nNameKey

void setI18nNameKey(java.lang.String i18nNameKey)

getKey

java.lang.String getKey()

setKey

void setKey(java.lang.String aPackage)

addModuleDescriptor

void addModuleDescriptor(ModuleDescriptor moduleDescriptor)

getModuleDescriptors

java.util.Collection getModuleDescriptors()

getModuleDescriptor

ModuleDescriptor getModuleDescriptor(java.lang.String key)

getModuleDescriptorsByModuleClass

java.util.List getModuleDescriptorsByModuleClass(java.lang.Class aClass)

isEnabledByDefault

boolean isEnabledByDefault()

setEnabledByDefault

void setEnabledByDefault(boolean enabledByDefault)

getPluginInformation

PluginInformation getPluginInformation()

setPluginInformation

void setPluginInformation(PluginInformation pluginInformation)

setResources

void setResources(Resourced resources)

isEnabled

boolean isEnabled()

setEnabled

void setEnabled(boolean enabled)

isSystemPlugin

boolean isSystemPlugin()
Whether the plugin is a "system" plugin that shouldn't be made visible to the user


containsSystemModule

boolean containsSystemModule()

setSystemPlugin

void setSystemPlugin(boolean system)

isBundledPlugin

boolean isBundledPlugin()
Whether the plugin is a "bundled" plugin that can't be removed.


getDateLoaded

java.util.Date getDateLoaded()
The date this plugin was loaded into the system.


isUninstallable

boolean isUninstallable()
Whether or not this plugin can be 'uninstalled'.


isDeleteable

boolean isDeleteable()
Should the plugin file be deleted on unistall?


isDynamicallyLoaded

boolean isDynamicallyLoaded()
Whether or not this plugin is loaded dynamically at runtime


loadClass

java.lang.Class loadClass(java.lang.String clazz,
                          java.lang.Class callingClass)
                          throws java.lang.ClassNotFoundException
Get the plugin to load a specific class.

Parameters:
clazz - The name of the class to be loaded
callingClass - The class calling the loading (used to help find a classloader)
Returns:
The loaded class.
Throws:
java.lang.ClassNotFoundException

getResourceAsStream

java.io.InputStream getResourceAsStream(java.lang.String name)
Load a given resource from the plugin. Plugins that are loaded dynamically will need to implement this in a way that loads the resource from the same context as the plugin. Static plugins can just pull them from their own classloader.

Parameters:
name - The name of the resource to be loaded.
Returns:
An InputStream for the resource, or null if the resource is not found.

close

void close()
Free any resources held by this plugin. To be called during uninstallation of the Plugin.



Copyright © 2008 Atlassian Software Systems Pty Ltd. All Rights Reserved.