public class

XmlDynamicPlugin

extends AbstractPlugin
implements PluginArtifactBackedPlugin
java.lang.Object
   ↳ com.atlassian.plugin.impl.AbstractPlugin
     ↳ com.atlassian.plugin.impl.XmlDynamicPlugin

Class Overview

A dynamic XML plugin that consists of the Atlassian plugin descriptor

Summary

[Expand]
Inherited Fields
From interface com.atlassian.plugin.Plugin
Public Constructors
XmlDynamicPlugin(PluginArtifact pluginArtifact)
Public Methods
void close()
Free any resources held by this plugin.
ClassLoader getClassLoader()
Get the classloader for the plugin.
PluginArtifact getPluginArtifact()
URL getResource(String name)
Retrieve the URL of the resource from the plugin.
InputStream getResourceAsStream(String name)
Load a given resource from the plugin.
boolean isDeleteable()
Should the plugin file be deleted on unistall?
boolean isDynamicallyLoaded()
Whether or not this plugin is loaded dynamically at runtime.
boolean isUninstallable()
Whether or not this plugin can be 'uninstalled'.
<M> Class<M> loadClass(String clazz, Class<?> callingClass)
Get the plugin to load a specific class.
[Expand]
Inherited Methods
From class com.atlassian.plugin.impl.AbstractPlugin
From class java.lang.Object
From interface com.atlassian.plugin.Plugin
From interface com.atlassian.plugin.PluginArtifactBackedPlugin
From interface com.atlassian.plugin.Resourced
From interface java.lang.Comparable

Public Constructors

public XmlDynamicPlugin (PluginArtifact pluginArtifact)

Public Methods

public void close ()

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

public ClassLoader getClassLoader ()

Get the classloader for the plugin.

Returns
  • The classloader used to load classes for this plugin

public PluginArtifact getPluginArtifact ()

public URL getResource (String name)

Retrieve the URL of the resource from the 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

public InputStream getResourceAsStream (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.

public boolean isDeleteable ()

Should the plugin file be deleted on unistall?

Returns
  • true if this plugin file should be deleted on unistall.

public boolean isDynamicallyLoaded ()

Whether or not this plugin is loaded dynamically at runtime.

Returns
  • true if this plugin is loaded dynamically at runtime.

public boolean isUninstallable ()

Whether or not this plugin can be 'uninstalled'.

Returns
  • true if this plugin can be 'uninstalled'.

public Class<M> loadClass (String clazz, Class<?> callingClass)

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.