Refactor magnolia Context class hierarchy
(MAGNOLIA-1614)
|
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 3.1 M3 |
| Fix Version/s: | 3.5 RC1 |
| Type: | Sub-task | Priority: | Major |
| Reporter: | Philipp Bärfuss | Assignee: | Philipp Bärfuss |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Date of First Response: |
| Description |
|
In some threads we do MgnlContext.setInstance(MgnlContext.getSystemContext()). But then we don't unset the context. If the threads are then used for request the ContextFilter fails to set a web context. This is the case for the servlet context listeners and observation event listeners A MgnlContext.doInSystemContext(runnable) would be nice. |
| Comments |
| Comment by ashapochka [ 30/Oct/07 ] |
|
> A MgnlContext.doInSystemContext(runnable) would be nice. There is already doInSystemContext(SystemContextOperation op) in MgnlContext |
| Comment by Magnolia International [ 30/Oct/07 ] |
|
doInSystemContext(SystemContextOperation op) executes the given op synchronously. |
| Comment by ashapochka [ 05/Nov/07 ] |
|
Concerning the doInSystemContext method it was decided to use the existing method (with the same name) in MgnlContext. Now ContextFilter explicitly checks for an instance of SystemContext set in MgnlContext and if it is the context gets reset to the newly created web context. |