Search in sources :

Example 1 with GlobalManagerRepository

use of com.dexels.navajo.server.global.GlobalManagerRepository in project navajo by Dexels.

the class TmlContinuationRunner method run.

@Override
public void run() {
    try {
        final GlobalManagerRepository globalManagerInstance = GlobalManagerRepositoryFactory.getGlobalManagerInstance();
        if (globalManagerInstance == null) {
            logger.warn("No global manager found");
        }
        clearThreadLocal(true);
        String instance = getRequest().getInstance();
        if (instance != null && globalManagerInstance != null) {
            GlobalManager gm = globalManagerInstance.getGlobalManager(instance);
            if (gm != null) {
                gm.initGlobals(getRequest().getInputDocument());
            } else {
                logger.warn("No global manager found for instance: " + instance);
            }
        } else {
            logger.debug("Not using instance based GlobalManager: No instance found in request");
        }
        execute();
    } catch (Exception e) {
        logger.error("Continuation problem: ", e);
        getRequest().fail(e);
    }
}
Also used : GlobalManager(com.dexels.navajo.server.global.GlobalManager) GlobalManagerRepository(com.dexels.navajo.server.global.GlobalManagerRepository) FatalException(com.dexels.navajo.script.api.FatalException) ServletException(javax.servlet.ServletException) IOException(java.io.IOException)

Example 2 with GlobalManagerRepository

use of com.dexels.navajo.server.global.GlobalManagerRepository in project navajo by Dexels.

the class Dispatcher method appendGlobals.

private void appendGlobals(Navajo inMessage, String instance) {
    final GlobalManagerRepository globalManagerInstance = GlobalManagerRepositoryFactory.getGlobalManagerInstance();
    if (globalManagerInstance == null) {
        logger.debug("No global manager found");
    }
    GlobalManager gm = null;
    if (globalManagerInstance != null) {
        if (instance == null) {
            gm = globalManagerInstance.getGlobalManager("default");
        } else {
            gm = globalManagerInstance.getGlobalManager(instance);
        }
    }
    if (gm != null) {
        gm.initGlobals(inMessage);
    }
}
Also used : GlobalManager(com.dexels.navajo.server.global.GlobalManager) GlobalManagerRepository(com.dexels.navajo.server.global.GlobalManagerRepository)

Aggregations

GlobalManager (com.dexels.navajo.server.global.GlobalManager)2 GlobalManagerRepository (com.dexels.navajo.server.global.GlobalManagerRepository)2 FatalException (com.dexels.navajo.script.api.FatalException)1 IOException (java.io.IOException)1 ServletException (javax.servlet.ServletException)1