All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alogient.cameleon.context.CameleonRequestContextHolder Maven / Gradle / Ivy

package com.alogient.cameleon.context;

import com.alogient.cameleon.sdk.content.util.nav.ModeType;
import com.alogient.cameleon.sdk.content.vo.CultureVo;
import com.alogient.cameleon.sdk.content.vo.menu.MenuVo;

public class CameleonRequestContextHolder extends ThreadLocal {
    /**
     * Thread instance of the context
     */
    private static CameleonRequestContextHolder context = new CameleonRequestContextHolder();

    public static CameleonRequestContext getContext() {
        return context.get();
    }

    public static void initContext() {
        context.set(new CameleonRequestContext());
    }

    public static void clearContext() {
        context.set(new CameleonRequestContext());
    }

    /**
     * @return the modeType
     */
    public static ModeType getModeType() {
        return getContext().getModeType();
    }

    /**
     * @param modeType the modeType to set
     */
    public static void setModeType(ModeType modeType) {
        getContext().setModeType(modeType);
    }

    /**
     * @return the cultureVo
     */
    public static CultureVo getCultureVo() {
        return getContext().getCultureVo();
    }

    /**
     * @param cultureVo the cultureVo to set
     */
    public static void setCultureVo(CultureVo cultureVo) {
        getContext().setCultureVo(cultureVo);
    }

    /**
     * @return the currentMenu
     */
    public static MenuVo getCurrentMenu() {
        return getContext().getCurrentMenu();
    }

    /**
     * @param currentMenu the currentMenu to set
     */
    public static void setCurrentMenu(MenuVo currentMenu) {
        getContext().setCurrentMenu(currentMenu);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy