-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for @Component life-cycle hooks #14
Comments
saskodh
changed the title
Add support for class token and alias tokens on components
Add support for @Component life-cycle hooks
Jul 14, 2016
damjangelovski
added a commit
that referenced
this issue
Jul 15, 2016
- added @PostConstruct and @PreDestroy - added destroy() and registerExitHook() in ApplicationContext
saskodh
added a commit
that referenced
this issue
Jul 17, 2016
- added support for async @PostConstruct and @PreDestroy methods - ApplicationContext is initialized with the async start method instead of on construction time - made the ApplicationContext state aware
Reopened: exit hook does not trigger when the process is killed (Ctrl + C). |
damjangelovski
added a commit
that referenced
this issue
Jul 18, 2016
- added ProcessHandler with observer pattern - added exiting on SIGINT hook
saskodh
added a commit
that referenced
this issue
Jul 18, 2016
- added minor changes and improvements
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
The text was updated successfully, but these errors were encountered: