Package org.adempiere.webui.session
Class SessionContextListener
java.lang.Object
org.adempiere.webui.session.SessionContextListener
- All Implemented Interfaces:
org.zkoss.zk.ui.event.EventThreadInit
,org.zkoss.zk.ui.util.DesktopCleanup
,org.zkoss.zk.ui.util.DesktopInit
,org.zkoss.zk.ui.util.ExecutionCleanup
,org.zkoss.zk.ui.util.ExecutionInit
public class SessionContextListener
extends Object
implements org.zkoss.zk.ui.util.ExecutionInit, org.zkoss.zk.ui.util.ExecutionCleanup, org.zkoss.zk.ui.event.EventThreadInit, org.zkoss.zk.ui.util.DesktopCleanup, org.zkoss.zk.ui.util.DesktopInit
Zk listener to manage environment context for execution and session
- Author:
- Ashley G Ramdass
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addDesktopId
(int AD_Session_ID, String dtid) Add dtid to session contextvoid
cleanup
(org.zkoss.zk.ui.Desktop desktop) void
static String
getSessionDesktopListKey
(int AD_Session_ID) Get context attribute key for session desktop listboolean
init
(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt) void
void
init
(org.zkoss.zk.ui.Execution exec, org.zkoss.zk.ui.Execution parent) static boolean
Is current context validvoid
prepare
(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt) get from servlet thread's ThreadLocalstatic void
setupExecutionContextFromSession
(org.zkoss.zk.ui.Execution exec) Get environment context from session cache or create a new one (if no cache context or cache context is invalid)
-
Field Details
-
SERVLET_SESSION_ID
- See Also:
-
SESSION_CTX
- See Also:
-
-
Constructor Details
-
SessionContextListener
public SessionContextListener()
-
-
Method Details
-
setupExecutionContextFromSession
public static void setupExecutionContextFromSession(org.zkoss.zk.ui.Execution exec) Get environment context from session cache or create a new one (if no cache context or cache context is invalid)- Parameters:
exec
-
-
init
public void init(org.zkoss.zk.ui.Execution exec, org.zkoss.zk.ui.Execution parent) - Specified by:
init
in interfaceorg.zkoss.zk.ui.util.ExecutionInit
- Parameters:
exec
-parent
-- See Also:
-
ExecutionInit.init(Execution, Execution)
-
cleanup
public void cleanup(org.zkoss.zk.ui.Execution exec, org.zkoss.zk.ui.Execution parent, List<Throwable> errs) - Specified by:
cleanup
in interfaceorg.zkoss.zk.ui.util.ExecutionCleanup
- Parameters:
exec
-parent
-errs
-- See Also:
-
ExecutionCleanup.cleanup(Execution, Execution, List)
-
prepare
public void prepare(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt) get from servlet thread's ThreadLocal- Specified by:
prepare
in interfaceorg.zkoss.zk.ui.event.EventThreadInit
- Parameters:
comp
-evt
-- See Also:
-
EventThreadInit.prepare(Component, Event)
-
init
public boolean init(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt) - Specified by:
init
in interfaceorg.zkoss.zk.ui.event.EventThreadInit
- Parameters:
comp
-evt
-- See Also:
-
EventThreadInit.init(Component, Event)
-
isContextValid
public static boolean isContextValid()Is current context valid- Returns:
- true if current context is valid
-
cleanup
- Specified by:
cleanup
in interfaceorg.zkoss.zk.ui.util.DesktopCleanup
- Throws:
Exception
-
init
- Specified by:
init
in interfaceorg.zkoss.zk.ui.util.DesktopInit
- Throws:
Exception
-
addDesktopId
Add dtid to session context- Parameters:
AD_Session_ID
-dtid
- desktop id
-
getSessionDesktopListKey
Get context attribute key for session desktop list- Parameters:
AD_Session_ID
-- Returns:
- desktop list key
-