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

From Documentation
m
Line 1: Line 1:
 
  {{ZKConfigurationReferencePageHeader}}
 
  {{ZKConfigurationReferencePageHeader}}
'''Property:'''
+
 
 +
'''Listener:'''
 
  org.zkoss.zk.ui.event.EventThreadCleanup interface
 
  org.zkoss.zk.ui.event.EventThreadCleanup interface
  
<javadoc type="interface">org.zkoss.zk.ui.event.EventThreadCleanup</javadoc> is implemented by a listener class that will be used to cleanup an event processing thread, after it has processed an event.
+
A listener could implement <javadoc type="interface">org.zkoss.zk.ui.event.EventThreadCleanup</javadoc> to cleanup an event processing thread, after it has processed an event.
 +
 
 +
<blockquote>
 +
----
 +
Notice that it is useless unless [[ZK Developer's Reference/UI Patterns/Event Threads|the event processing threads]] are enabled (it is disabled by default).
 +
</blockquote>
  
 
If a listener implements this interface, an instance is created, and then the <tt>cleanup</tt> method is called in the event processing thread after the thread processes the event. Then, the <tt>complete</tt> method is called in the main thread (aka., the servlet thread), after the main thread is resumed.
 
If a listener implements this interface, an instance is created, and then the <tt>cleanup</tt> method is called in the event processing thread after the thread processes the event. Then, the <tt>complete</tt> method is called in the main thread (aka., the servlet thread), after the main thread is resumed.

Revision as of 04:44, 20 April 2011


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 interface

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 constructed and the cleanup method is called after leaving the event processing thread.



Last Update : 2011/04/20

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