8000 Add support for @PostConstruct or similar · Issue #11 · sting-ioc/sting · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Add support for @PostConstruct or similar #11
Open
@realityforge

Description

@realityforge

The way that the @Injector is constructed and the constraints that are applied to the components (i.e. No invoking Supplier types during construction ala #9) will typically mean that it is impossible for a component to access another component before it is constructed.

The one scenario where this is not true is if the construction of a component creates an asynchronous action that invokes a Suppler dependency before the injector has completed initialization. This is not possible in a web browser but is possible in a JRE environment.

The only real safe way to fix this is to move the asynchronous action until after the injector has created the eager components. To do this we could allow the components to specify this post create action with an annotation like @PostConstruct which would be used to initiate any asynchronous tasks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0