Refactor magnolia Context class hierarchy (MAGNOLIA-1614)

[MAGNOLIA-1799] unset context in all threads, add MgnlContext.doInSystemContext() method Created: 25/Oct/07  Updated: 23/Jan/13  Resolved: 05/Nov/07

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
Is it the same thing?

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.

Generated at Mon Feb 12 03:30:26 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.