Confluence Docs 3.0 : Spring Component Plugins - Old Style This page last changed on Dec 02, 2008 by smaddox.
| This is an outdated module type The Spring Component plugin module described below belongs to the first version of the Atlassian Plugin Framework. A new Component plugin module is available to OSGi-based plugins using version 2.x of the Atlassian Plugin Framework, supported in Confluence 2.10 and later.
On this page: Old-Style Plugin Module Type Purpose of this Module Type Ordering of Components ## Old-Style Plugin Module Type We recommend that you use the new plugin module type, rather than the old-style Spring Component described below. Confluence still supports the earlier module type, but the new OSGi-based plugin framework fixes a number of bugs and limitations experienced by the old-style plugin modules. ## Purpose of this Module Type A Spring module allows you to use standard Spring XML configuration tags. A Spring module appears in `atlassian-plugin.xml` like this:
    <spring name="Space Cleaner Job" key="spaceCleanerJob" class="org.springframework.scheduling.quartz.JobDetailBean">
            ... any standard spring configuration goes here...
    </spring>
The above is equivalent to the following configuration in `applicationContext.xml`:
    <bean id="spaceCleanerJob" class="org.springframework.scheduling.quartz.JobDetailBean">
            ...
    </bean>
## Ordering of Components If you declare a Spring component that refers to another Spring component, you must ensure the referred component is declared first. For example:
    <spring name="Bean A" key="beanA" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
        ...
    </spring>

    <spring name="Bean B" key="beanB" alias="soapServiceDelegator" class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="target">
            <ref local="beanA"/>
        </property>
        ...
    </spring>
Notice that `beanB` refers to `beanA` and that `beanA` is declared before beanB. If you don't do it in this order, Confluence will complain that `beanA` does not exist. ##### RELATED TOPICS Component Plugins Writing Confluence Plugins Installing and Configuring Plugins Manually

Document generated by Confluence on Nov 05, 2009 23:34