| org.zkoss.zk.ui.event.EventThreadResume
All known Subclasses: org.zkoss.zkplus.hibernate.HibernateSessionContextListener, org.zkoss.zkplus.util.ThreadLocalListener, org.zkoss.zkplus.spring.SpringTransactionSynchronizationListener, org.zkoss.zkplus.acegi.AcegiSecurityContextListener,
EventThreadResume | public interface EventThreadResume (Code) | | Used to listen after the event processing thread is resumed.
How this interface is used.
- First, you specify a class that implements this interface
in WEB-INF/zk.xml as a listener.
- Then, when a suspended event thread is being resumed,
an instance of the specified class is constructed and
EventThreadResume.beforeResume is called first in the main thread (i.e., the servlet
thread), right before resuming.
And then,
EventThreadResume.afterResume is invoked in the event processing thread,
after the thread is resumed.
In addition to resuming normally, a suspended event thread might be aborted
(usually caused by detroying the desktop owning the event thread).
In this case,
EventThreadResume.abortResume is called instead of
EventThreadResume.beforeResume and
EventThreadResume.afterResume .
author: tomyeh |
abortResume | public void abortResume(Component comp, Event evt) throws Exception(Code) | | Called when the suspended event thread is aborted.
It is called in the main thread (i.e., the servlet thread).
If a suspended event thread is resumed normally,
EventThreadResume.beforeResume and
EventThreadResume.afterResume are called.
On the other hand, if it is aborted (usually caused by destroying
the desktop that owns this thread),
EventThreadResume.abortResume is called instead.
Note: if the suspended thread is aborted, none of
EventThreadResume.beforeResume ,
EventThreadResume.afterResume ,
EventThreadCleanup.cleanup , and
EventThreadCleanup.complete will be called.
Thus, you have to do necessary cleanups in this method.
|
beforeResume | public void beforeResume(Component comp, Event evt) throws Exception(Code) | | Called just before the suspended event thread is resumed.
Unlike
EventThreadResume.afterResume , it executes in the main thread that
resumes the suspended event processing thread.
If this method throws an exception, it will abort the execution
and shows an error message to the end user.
Note:
EventThreadCleanup.cleanup won't be called if an
exception is thrown in this method, since it executes in
the main thread.
|
|
|