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
Version:
$Revision: 0.10 $
Author:
Ashley G Ramdass
  • Field Details

  • 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 (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 interface org.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 interface org.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 interface org.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 interface org.zkoss.zk.ui.event.EventThreadInit
      Parameters:
      comp -
      evt -
      See Also:
      • EventThreadInit.init(Component, Event)
    • isContextValid

      public static boolean isContextValid()
      Returns:
      true if session context is valid
    • cleanup

      public void cleanup(org.zkoss.zk.ui.Desktop desktop) throws Exception
      Specified by:
      cleanup in interface org.zkoss.zk.ui.util.DesktopCleanup
      Throws:
      Exception
    • init

      public void init(org.zkoss.zk.ui.Desktop desktop, Object request) throws Exception
      Specified by:
      init in interface org.zkoss.zk.ui.util.DesktopInit
      Throws:
      Exception
    • addDesktopId

      public static void addDesktopId(int AD_Session_ID, String dtid)
      Add dtid to session context
      Parameters:
      AD_Session_ID -
      dtid - desktop id
    • getSessionDesktopListKey

      public static String getSessionDesktopListKey(int AD_Session_ID)
      Parameters:
      AD_Session_ID -
      Returns:
      desktop list key