com.atlassian.plugin.impl
Interface DynamicPlugin

All Superinterfaces:
java.lang.Comparable, Plugin, Resourced
All Known Implementing Classes:
DefaultDynamicPlugin

public interface DynamicPlugin
extends Plugin


Field Summary
 
Fields inherited from interface com.atlassian.plugin.Plugin
NAME_COMPARATOR
 
Method Summary
 void close()
          Free any resources held by this plugin.
 java.lang.ClassLoader getClassLoader()
          Get the classloader for the plugin.
 java.net.URL getResource(java.lang.String name)
          Retrieve the URL of the resource from the plugin.
 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()
          This plugin is dynamically loaded, so returns true.
 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 setBundled(boolean bundled)
           
 void setDeletable(boolean deletable)
           
 
Methods inherited from interface com.atlassian.plugin.Plugin
addModuleDescriptor, containsSystemModule, getDateLoaded, getI18nNameKey, getKey, getModuleDescriptor, getModuleDescriptors, getModuleDescriptorsByModuleClass, getName, getPluginInformation, getPluginsVersion, isEnabled, isEnabledByDefault, isSystemPlugin, setEnabled, setEnabledByDefault, setI18nNameKey, setKey, setName, setPluginInformation, setPluginsVersion, setResources, setSystemPlugin
 
Methods inherited from interface com.atlassian.plugin.Resourced
getResourceDescriptor, getResourceDescriptors, getResourceDescriptors, getResourceLocation
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

loadClass

java.lang.Class loadClass(java.lang.String clazz,
                          java.lang.Class callingClass)
                          throws java.lang.ClassNotFoundException
Description copied from interface: Plugin
Get the plugin to load a specific class.

Specified by:
loadClass in interface Plugin
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

isUninstallable

boolean isUninstallable()
Description copied from interface: Plugin
Whether or not this plugin can be 'uninstalled'.

Specified by:
isUninstallable in interface Plugin

getResource

java.net.URL getResource(java.lang.String name)
Description copied from interface: Plugin
Retrieve the URL of the resource from the plugin.

Specified by:
getResource in interface Plugin
Parameters:
name - the name of the resource to be loaded
Returns:
The URL to the resource, or null if the resource is not found

getResourceAsStream

java.io.InputStream getResourceAsStream(java.lang.String name)
Description copied from interface: Plugin
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.

Specified by:
getResourceAsStream in interface Plugin
Parameters:
name - The name of the resource to be loaded.
Returns:
An InputStream for the resource, or null if the resource is not found.

getClassLoader

java.lang.ClassLoader getClassLoader()
Description copied from interface: Plugin
Get the classloader for the plugin.

Specified by:
getClassLoader in interface Plugin
Returns:
The classloader used to load classes for this plugin

isDynamicallyLoaded

boolean isDynamicallyLoaded()
This plugin is dynamically loaded, so returns true.

Specified by:
isDynamicallyLoaded in interface Plugin
Returns:
true

isDeleteable

boolean isDeleteable()
Description copied from interface: Plugin
Should the plugin file be deleted on unistall?

Specified by:
isDeleteable in interface Plugin

setDeletable

void setDeletable(boolean deletable)

isBundledPlugin

boolean isBundledPlugin()
Description copied from interface: Plugin
Whether the plugin is a "bundled" plugin that can't be removed.

Specified by:
isBundledPlugin in interface Plugin

setBundled

void setBundled(boolean bundled)

close

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

Specified by:
close in interface Plugin


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.