@Singleton public class MagnoliaUiGuiceComponentProviderFactory extends Object
GuiceComponentConfigurationModule
with several necessary workarounds and adds UiBaseModule
to the pile.
Implementation note: this class takes measures to create only one instance of the UI Guice component provider. There should
be only one such component provider by design, which be pushed into Components
context when UI requests are handled.
Having multiple built copies of UI component providers may lead to conflicts in their provisioning logic and some other quirky
bugs. The weakest part is the presence of two UI servlets (VaadinServlet
and legacy AdmincentralServlet
until the latter is finally eliminated) which may end up with two different component provider instances. Besides, creating
several instances of pretty much identical heavy component providers adds several seconds of build time overhead.Constructor and Description |
---|
MagnoliaUiGuiceComponentProviderFactory(info.magnolia.event.EventBus systemEventBus,
info.magnolia.module.ModuleRegistry moduleRegistry,
Supplier<List<String>> appNameListSupplier) |
Modifier and Type | Method and Description |
---|---|
info.magnolia.objectfactory.guice.GuiceComponentProvider |
create(info.magnolia.objectfactory.configuration.ComponentConfigurer... additionalModules)
Populates all the UI-related components and type-mappings from all the modules,
processes them and creates a
GuiceComponentProvider out of them. |
public info.magnolia.objectfactory.guice.GuiceComponentProvider create(info.magnolia.objectfactory.configuration.ComponentConfigurer... additionalModules)
GuiceComponentProvider
out of them.additionalModules
- mostly for test purposes, allow to supply the type bindings
programmatically instead of XML (see AbstractGuiceComponentConfigurer
)Copyright © 2021 Magnolia International Ltd.. All rights reserved.