Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

In order to remain fully backwards compatible, Magnolia 4.5 will add both a component definition and a type mapping for AggregationState.

Supported

...

types of dependency injection

Magnolia uses the standardized annotations for dependency injections from JSR-330 which enable all three forms types of dependency injection:

  • Constructor injection
  • Setter Field injectionField
  • Setter injection

This is an example of all three:

Code Block
public class RenderingEngine {

    @Inject
// Dependencies are injected privatein TemplateRegistrythe templateRegistry;
constructor
    @Inject
    public SomeComponent(ModuleManager moduleManager) { ... }

    // Fields are set with injected dependencies after construction
    @Inject
    private TemplateRegistry templateRegistry;

    // Setters are called with injected dependencies after construction
    @Inject
    public void setRendererRegistry(RendererRegistry rendererRegistry) { ... }
}

...

When Magnolia is shutdown it performs the same steps in reverse. First calling ModuleLifecycle.stop() on modules, then it closes Main, then System and finally Platform.

Magnolia ComponentProvider hierarchy

Image AddedComponents with methods annotated with @PreDestroy are called when the step in which they live is closed.