...
Table of Contents |
---|
Dynamic extensions loading allows to add selected extension to OpenHub application independently by each other.
...
0) Prerequisite - extension configuration loader must be initialized
Code Block | ||
---|---|---|
| ||
/** * OpenHub extensions loader where extensions are <bean class="org.openhubframework.openhub.core.common.extension.PropertiesExtensionConfigurationLoader" depends-on="camelContext"> <constructor-arg ref="confProperties"/> </bean>defined in properties. * Relevant properties are with '{@value #PROPERTY_PREFIX}' prefix. */ @Service @DependsOn("camelContext") public class PropertiesExtensionConfigurationLoader extends AbstractExtensionConfigurationLoader { |
1) add Maven dependency to specific extension
...
Code Block |
---|
<groupId>org.openhubframework.openhub.extensions<ext</groupId> <artifactId>file-upload</artifactId> |
...
extensions.cfg (defined directly in OpenHub framework web-admin module) or extensions0.cfg (has higher priority) defines references to Spring root configuration files for each extension. Each property has to starts with context.ext prefix.
...
There is the following Spring context hierarchy:
- root context Camel - Camel (Spring Web Service) context + Spring MVC (admin) context
- extension1 context
- extension2 contextSpring MVC (admin) context