The org.zkoss.zk.ui.event.EventThreadSuspend interface"
m (correct highlight (via JWB)) |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ZKConfigurationReferencePageHeader}} | {{ZKConfigurationReferencePageHeader}} | ||
− | |||
− | |||
− | + | '''Listener:''' | |
+ | org.zkoss.zk.ui.event.EventThreadSuspend | ||
− | If a listener implements this interface, an instance is created, and then the < | + | A listener could implement <javadoc type="interface">org.zkoss.zk.ui.event.EventThreadSuspend</javadoc>, suthc that it will be called before an event processing thread is going to be suspended. |
+ | |||
+ | <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 <code>beforeSuspend</code> method, when an event processing thread is going to suspended. It executes in the event processing thread. | ||
A developer can prevent can prevent an event processing thread from being suspended by throwing an exception. | A developer can prevent can prevent an event processing thread from being suspended by throwing an exception. | ||
Line 11: | Line 17: | ||
A typical use of this feature is to limit the number of suspended threads. | A typical use of this feature is to limit the number of suspended threads. | ||
− | + | '''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. | ||
+ | |||
+ | {{ZKConfigurationReferencePageFooter}} |
Latest revision as of 10:23, 19 January 2022
Listener:
org.zkoss.zk.ui.event.EventThreadSuspend
A listener could implement EventThreadSuspend, suthc that it will be called before an event processing thread is going to be suspended.
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 beforeSuspend
method, when an event processing thread is going to suspended. It executes in the event processing thread.
A developer can prevent can prevent an event processing thread from being suspended by throwing an exception.
A typical use of this feature is to limit the number of suspended threads.
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.