cogShare contextual information between components
Developed by

XWiki Development Team

0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Enterprise, XWiki Standard


This module control the ExecutionContext and related common tools.

It was first introduced as a replaced for the XWikiContext which used to be passed as parameter in most XWiki classes methods. The ExecutionContext context is stored in a ThreadLocal and as such as be reached from anywhere should it be needed, the main entry point to access it is the component Execution.

Save and restore contextual information

Since 10.10RC1.

Saving and restoring specific contextual information is useful for example when execution asynchronous code which behavior still depends on various information located in the initial context.

This is done trough org.xwiki.context.concurrent.ContextStoreManager.


   private ContextStoreManager contextStore;

   private void addTask() throws ComponentLookupException
        Map<String, Serializable> storedContext ="wiki", "user", "locale"));



   private ContextStoreManager contextStore;

   private void startTask(Map<String, Serializable> storedContext) throws ComponentLookupException

Created by Thomas Mortagne on 2018/11/19 15:33

Get Connected