The org.zkoss.zk.ui.event.EventThreadCleanup interface

From Documentation
Revision as of 10:23, 19 January 2022 by Hawk (talk | contribs) (correct highlight (via JWB))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


DocumentationZK Configuration Referencezk.xmlThe listener ElementThe org.zkoss.zk.ui.event.EventThreadCleanup interface
The org.zkoss.zk.ui.event.EventThreadCleanup interface


Listener:

org.zkoss.zk.ui.event.EventThreadCleanup

A listener could implement EventThreadCleanup to cleanup an event processing thread, after it has processed an event.


Notice that it is useless unless the event processing threads are enabled (it is disabled by default).

If a listener implements this interface, an instance is created, and then the cleanup method is called in the event processing thread after the thread processes the event. Then, the complete method is called in the main thread (aka., the servlet thread), after the main thread is resumed.

Note: The complete method won't be called if the corresponding cleanup method threw an exception.

A typical use of this feature is to clean up unclosed transaction.

Once registered, an instance is instantiated and the cleanup method is called after leaving the event processing thread.

Instantiation: An independent instance of the given class is instantiated each time before the method is invoked. It means it is thread safe, and all information stored in non-static members will be lost after called.



Last Update : 2022/01/19

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.