public interface EventThreadResume
How this interface is used.
beforeResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
is called first in the main thread (i.e., the servlet
thread), right before resuming.
And then, afterResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
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 destroying the desktop owning the event thread).
In this case, abortResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
is called instead of beforeResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
and afterResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
.
Modifier and Type | Method and Description |
---|---|
void |
abortResume(Component comp,
Event evt)
Called when the suspended event thread is aborted.
|
void |
afterResume(Component comp,
Event evt)
Called after the suspended event thread is resumed.
|
void |
beforeResume(Component comp,
Event evt)
Called just before the suspended event thread is resumed.
|
void beforeResume(Component comp, Event evt) throws java.lang.Exception
afterResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
, 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(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.util.List<java.lang.Throwable>)
won't be called if an
exception is thrown in this method, since it executes in
the main thread.
java.lang.Exception
void afterResume(Component comp, Event evt) throws java.lang.Exception
beforeResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
, it executes in the
event processing thread that is resumed.
If this method throws an exception, it will abort the execution
and shows an error message to the end user (unless it is cleaned
up by EventThreadCleanup.cleanup(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.util.List<java.lang.Throwable>)
).
java.lang.Exception
void abortResume(Component comp, Event evt) throws java.lang.Exception
If a suspended event thread is resumed normally, beforeResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
and afterResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
are called.
On the other hand, if it is aborted (usually caused by destroying
the desktop that owns this thread), abortResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
is called instead.
Note: if the suspended thread is aborted, none of beforeResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
,
afterResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
, EventThreadCleanup.cleanup(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.util.List<java.lang.Throwable>)
, and
EventThreadCleanup.complete(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
will be called.
Thus, you have to do necessary cleanups in this method.
java.lang.Exception
Copyright © 2005-2021 Potix Corporation. All Rights Reserved.