Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Wait for all required dependencies to be available. When all required dependencies are available:
    • Instantiate the component.
    • Inject all required dependencies (on class fields using reflection, or by invoking callback methods).
    • Inject all optional dependencies defined on class fields, possibly with a NullObject if the dependency is not available.
    • Call the component init method (annotated with @Init). In the Init method, you are yet allowed to add some additional dependencies (but using the API). Alternatively, you can also configure some dependencies dynamically (explained later, in #Dynamic Dependency Configuration).
  2. Wait for extra dependencies eventually configured from the init() method.
  3. If the component is not using the @LifecycleController annotation (detailed in the #Controlling the Lifecycle section), then:
    • Invoke the component start method (annotated with @Start).
    • Publish eventual OSGi services (if the component provides some services).
    • Start tracking optional dependencies applied on method callbacks (useful for the whiteboard pattern). Notice that NullObject pattern is not applied to optional callback dependencies. In other words, if the dependency is not there, your callback won't be invoked at all. If you need the NullObject pattern, then apply optional dependencies on class fields, not on callback methods.
  4. Else do nothing because  the component will trigger itself the startup using the lifecycle controller.

...