|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EventThreadCleanup
Used to clean the event processing thread.
How this interface is used.
cleanup(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.util.List)
is invoked when the event processing thread has processed an event,
and then complete(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
of the same instance is called in the servlet
thread.Thus, the typical use is to cleaup un-closed transactions
when cleanup(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.util.List
is called.
Method Summary | |
---|---|
void |
cleanup(Component comp,
Event evt,
java.util.List<java.lang.Throwable> errs)
Cleans up the event processing thread. |
void |
complete(Component comp,
Event evt)
Called in the serlvet thread to clean up. |
Method Detail |
---|
void cleanup(Component comp, Event evt, java.util.List<java.lang.Throwable> errs) throws java.lang.Exception
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: cleanup(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.util.List
is called first in the event processing thread,
and then complete(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
is called in the servlet thread.
Note: complete(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
of an EventThreadCleanup
instance is called
only if cleanup(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.util.List
called against the same instnce
didn't throw any exception.
If the use of the event thread is disabled
(Configuration.isEventThreadEnabled()
returns false), this method is also invoked in the Servlet thread.
errs
- a list of exceptions (java.lang.Throwable) if any exception
occured 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.
java.lang.Exception
void complete(Component comp, Event evt) throws java.lang.Exception
cleanup(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.util.List)
is called.
Note: cleanup(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.util.List
is called first in the event processing thread,
and then complete(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
is called in the servlet thread.
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |