The components lifetime is fully managed by the DI container(injector).
The components should be able to react to some of it's life-cycle events like post constructing and pre destroying.
Task
Add support for component's life-cycle hooks. Those would be methods decorated with the appropriate decorator for one of the life-cycle events like:
@PostConstruct - after the component is initialized and it's dependencies are set
@PreDestroy - before the component is destroyed
Note: Before implementing @PreDestroy support for destroying the AppContext manually and through some of the process events for exit needs to be added. Example:
let ctx = new ApplicationContext();
// Manually
ctx.destroy();
// On exit
ctx.registerExitHook();
Background
The components lifetime is fully managed by the DI container(injector). The components should be able to react to some of it's life-cycle events like post constructing and pre destroying.
Task
Add support for component's life-cycle hooks. Those would be methods decorated with the appropriate decorator for one of the life-cycle events like:
Note: Before implementing @PreDestroy support for destroying the AppContext manually and through some of the process events for exit needs to be added. Example: