JBoss Community Archive (Read Only)

RHQ 4.9

Plugins - Plugin Extension

Normally, the plugins that you write are independent from other plugins - in fact, during runtime, they are isolated from other plugin jars via separate classloaders. However, there are instances where you need to have one plugin depend on another, for either their class definitions or resource type definitions. For example, if your product's management interface uses JMX, you could have your product's plugin depend on the JMX plugin in order to be able to re-use the EMS functionality provided by the JMX plugin. An other example is the case where a Tomcat server is embedded in a JBossAS server - the JBossAS plugin can depend on the Tomcat plugin so the JBossAS discovery component classes can extend the Tomcat discovery component classes.

To have one plugin extend another, you provide one or more depends elements to the <plugin> element within the plugin descriptor. A depends element defines a plugin that the defining plugin depends on. A dependent plugin will be deployed after all of the plugins it depends on have already been deployed.

There are two different ways you can extend other plugins and their resource types: the Embedded Extension Model and Injection Extension Model. They provide slightly different functionality and have different semantics - why you would use one over the other is described in more detail in the AMPS-Plugin Extensions page. Please refer to that page for more information on how you can extend other plugins and their resource types.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 07:57:32 UTC, last content change 2013-09-18 19:42:07 UTC.