Class SpringTransactionSynchronizationListener

java.lang.Object
org.zkoss.zkplus.spring.SpringTransactionSynchronizationListener
All Implemented Interfaces:
org.zkoss.zk.ui.event.EventThreadCleanup, org.zkoss.zk.ui.event.EventThreadInit, org.zkoss.zk.ui.event.EventThreadResume

public class SpringTransactionSynchronizationListener extends Object implements org.zkoss.zk.ui.event.EventThreadInit, org.zkoss.zk.ui.event.EventThreadCleanup, org.zkoss.zk.ui.event.EventThreadResume

Listener to make sure each ZK thread got the same ThreadLocal value of the spring's org.springframework.transaction.support.TransactionSynchronizationManager; especially those thread bound resources.

This listener is used with Spring Framework (version 1.2.8+) "thread" bounded resources.


        <listener>
                <description>Spring TransactionSynchronizationManager handler</description>
                <listener-class>org.zkoss.zkplus.spring.SpringTransactionSynchronizationListener</listener-class>
        </listener>
 

Applicable to Spring Framework version 2.x or later

Author:
henrichen
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    abortResume(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt)
     
    void
    afterResume(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt)
     
    void
    beforeResume(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt)
     
    void
    cleanup(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt, List errs)
     
    void
    complete(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt)
     
    boolean
    init(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt)
     
    void
    prepare(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpringTransactionSynchronizationListener

      public SpringTransactionSynchronizationListener()
  • Method Details

    • prepare

      public void prepare(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt)
      Specified by:
      prepare in interface org.zkoss.zk.ui.event.EventThreadInit
    • 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
    • cleanup

      public void cleanup(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt, List errs)
      Specified by:
      cleanup in interface org.zkoss.zk.ui.event.EventThreadCleanup
    • complete

      public void complete(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt)
      Specified by:
      complete in interface org.zkoss.zk.ui.event.EventThreadCleanup
    • beforeResume

      public void beforeResume(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt)
      Specified by:
      beforeResume in interface org.zkoss.zk.ui.event.EventThreadResume
    • afterResume

      public void afterResume(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt)
      Specified by:
      afterResume in interface org.zkoss.zk.ui.event.EventThreadResume
    • abortResume

      public void abortResume(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.event.Event evt)
      Specified by:
      abortResume in interface org.zkoss.zk.ui.event.EventThreadResume