| org.zkoss.zk.ui.event.EventThreadCleanup
All known Subclasses: org.zkoss.zkplus.util.ThreadLocalListener, org.zkoss.zkplus.spring.SpringTransactionSynchronizationListener, org.zkoss.zkplus.acegi.AcegiSecurityContextListener,
EventThreadCleanup | public interface EventThreadCleanup (Code) | | Used to clean the event processing thread.
How this interface is used.
- First, you specify a class that implements this interface
in WEB-INF/zk.xml as a listener.
- Then, an instance of the specified class is constructed and
EventThreadCleanup.cleanup is invoked when the event processing thread has processed an event,
and then
EventThreadCleanup.complete of the same instance is called in the servlet
thread.
Thus, the typical use is to cleaup un-closed transactions
when
EventThreadCleanup.cleanup is called.
author: tomyeh |
cleanup | public void cleanup(Component comp, Event evt, List errs) throws Exception(Code) | | Cleans up the event processing thread.
It is called, after a event processing thread has processed an event.
If this method threw an exception and errs is empty, the exception will
be propagated back to the servlet thread and then reported to the user.
Note:
EventThreadCleanup.cleanup is called first in the event processing thread,
and then
EventThreadCleanup.complete is called in the servlet thread.
Note:
EventThreadCleanup.complete of an
EventThreadCleanup instance is called
only if
EventThreadCleanup.cleanup called against the same instnce
didn't throw any exception.
If the use of the event thread is disabled
(
org.zkoss.zk.ui.util.Configuration.isEventThreadEnabled returns false), this method is also invoked in the Servlet thread.
Parameters: errs - a list of exceptions (java.lang.Throwable) if any exceptionoccured before this method is called, or null if no exeption at all.Note: you can manipulate the list directly to add or clean up exceptions.For example, if exceptions are fixed correctly, you can call errs.clear()such that no error message will be displayed at the client. |
|
|