1.7. Component plugin priority

Warning

You are looking at documentation for an older release. Not what you want? See the current release documentation.

Since Kernel 2.0.6, it is possible to set up order of loading for ComponentPlugin. Use the 'priority' tag to define plugin's load priority. By default, all plugins have the priority '0'. If you want one plugin to be loaded later than the others, simply set its priority to higher than zero.

See the simple example of fragment of a configuration.xml.


...
<component>
  <type>org.exoplatform.services.Component1</type>
</component>

<external-component-plugins>
  <target-component>org.exoplatform.services.Component1</target-component>

  <component-plugin>
    <name>Plugin1</name>
    <set-method>addPlugin</set-method>
    <type>org.exoplatform.services.plugins.Plugin1</type>
    <description>description</description>
    <priority>1</priority>
  </component-plugin>

  <component-plugin>
    <name>Plugin2</name>
    <set-method>addPlugin</set-method>
    <type>org.exoplatform.services.plugins.Plugin2</type>
    <description>description</description>
    <priority>2</priority>
  </component-plugin>

</external-component-plugins>

<external-component-plugins>
  <target-component>org.exoplatform.services.Component1</target-component>
  <component-plugin>
    <name>Plugin3</name>
    <set-method>addPlugin</set-method>
    <type>org.exoplatform.services.plugins.Plugin3</type>
    <description>description</description>
  </component-plugin>
</external-component-plugins>
...

In this example, 'Plugin3' will be loaded first because it has the default priority '0'. Next one is 'Plugin1' and the last is 'Plugin2'.

Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus