[MAGNOLIA-6074] Config file watch service should shut down gracefully. Created: 16/Feb/15 Updated: 05/Mar/15 Resolved: 20/Feb/15 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | configuration |
| Affects Version/s: | None |
| Fix Version/s: | 5.4 |
| Type: | Task | Priority: | Neutral |
| Reporter: | Michael Mühlebach | Assignee: | Michael Mühlebach |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Template: |
|
||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||
| Task DoR: |
Empty
|
||||||||||||||||
| Comments |
| Comment by Michael Mühlebach [ 18/Feb/15 ] |
|
The first attempt was by adding complete JSR250 support with @PreDestroy. This could be done by adding the following line to GuiceComponentProvider: GuiceComponentProvider.java public void destroy() {
injector.getInstance(CloseableInjector.class).close();
}
But this did not work because of the following points working together:
There are other custom implementations like https://github.com/Netflix/governator/wiki/Lazy-Singleton which work around this. |
| Comment by Michael Mühlebach [ 18/Feb/15 ] |
|
The chosen implementation is now to use the module lifecycle to start and stop the directory watcher service. As long the configuration is a module itself this should work. After a possible core split we should look at this again. |