Rate this page:
Available: | Bamboo 2.6 and later |
Component plugin modules enable you to add components to Bamboo's internal component system (powered by Spring).
Each component module adds a single object to Bamboo's component management system.
Other plugins and objects within Bamboo can then be autowired with your component. This is very useful for having a single component that is automatically passed to all of your other plugin modules (i.e. a Manager object).
Here is an example atlassian-plugin.xml
file containing a single component module:
1 2 3 4 5 6 7 8
<atlassian-plugin name="Sample Component" key="bamboo.extra.component">
...
<component name="Keyed Test Component"
key="testComponent"
alias="bogusComponent"
class="com.atlassian.bamboo.plugin.descriptor.BogusComponent" />
...
</atlassian-plugin>
Accessing your components is extremely simple.
If your object is being autowired (for example another plugin module or an XWork action), the easiest way to access a component is to add a basic Java setter method.
For example, if you use the above BogusComponent
module your object would retrieve the component as follows:
1 2 3 4
public void setBogusComponent(BogusComponent bogusComponent)
{
this.bogusComponent = bogusComponent;
}
If your object is not being autowired, you may need to retrieve the component explicitly. This is done via the ContainerManager
like so:
1
BogusComponent bc = (BogusComponent) ContainerManager.getComponent("bogusComponent");
Some issues to be aware of when developing a component:
Rate this page: