close

Filter

loading table of contents...

Blueprint Developer Manual / Version 2107

Table Of Contents
4.1.6.1.10 Add-Ons

Plugins can also extend other plugins. To this end plugins can define extension points for which they collect implementing beans from add-on plugins using the AddOnManager.

A plugin can have multiple dependencies but can only be an add-on for one other plugin. Add-ons can also inject beans from the extended plugin in the same way as if the add-on had a dependency on the extended plugin. The AddOnManager can be injected by importing the configuration class com.coremedia.cms.common.plugins.plugin_framework.addons.AddOnConfiguration.

Example

PluginB is an add-on for PluginA and provides an extension for PluginA's extension point.

PluginA
plugin.id=pluginA
plugin.version=1.2.3
plugin.configuration-class=com.acme.plugin_a.PluginAConfiguration

Example 4.13. PluginA plugin.properties


public class SomeExtensionPointForA {}

Example 4.14. SomeExtensionPointForA


@Import(AddOnConfiguration.class)
@Configuration(proxyBeanMethods = false)
class PluginAConfiguration {
  @Bean
  UsageOfExtensionPoints usageOfExtensionPoints(AddOnManager addOnManager) {
    return new UsageOfExtensionPoints(addOnManager.getExtensions(SomeExtensionPointForA.class));
  }
}

Example 4.15. PluginAConfiguration


PluginB
plugin.id=pluginB
plugin.version=0.1.0
plugin.configuration-class=com.acme.plugin_b.PluginBConfiguration
plugin.add-on-for=pluginA

Example 4.16. PluginB plugin.properties


...
  @Bean
  SomeExtensionPointForAImpl someExtensionPointForAImpl() {
    return new SomeExtensionPointForAImpl();
  }
...

Example 4.17. PluginBConfiguration


public class SomeExtensionPointForAImpl extends SomeExtensionPointForA {}

Example 4.18. SomeExtensionPointForAImpl


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.