Example usage for com.liferay.portal.kernel.cluster ClusterInvokeThreadLocal setEnabled

List of usage examples for com.liferay.portal.kernel.cluster ClusterInvokeThreadLocal setEnabled

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.cluster ClusterInvokeThreadLocal setEnabled.

Prototype

public static void setEnabled(boolean enabled) 

Source Link

Usage

From source file:com.liferay.monitoring.web.internal.portlet.action.EditSessionMVCActionCommand.java

License:Open Source License

private static void _invalidateSession(String sessionId) {
    HttpSession userSession = PortalSessionContext.get(sessionId);

    if (userSession != null) {
        boolean eanbled = ClusterInvokeThreadLocal.isEnabled();

        ClusterInvokeThreadLocal.setEnabled(true);

        try {/*from  w  w w . j  av a 2  s  . c o  m*/
            userSession.invalidate();
        } finally {
            ClusterInvokeThreadLocal.setEnabled(eanbled);
        }
    }
}