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

From Documentation
Revision as of 08:04, 6 December 2010 by Char (talk | contribs)


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


Property:

The org.zkoss.zk.ui.event.EventThreadInit Interface


EventThreadInit is implemented by a listener class that will be used to initialize an event processing thread, before an event is dispatched to it for processing.

If a listener implements this interface, an instance is created, and then the prepare method is called in the main thread (aka., the servlet thread), before processing an event. Then, the init method is called in the event processing thread.

If a developer wants to prevent an event from being processed, he can throw an exception in the prepare method or the init method.

A typical use of this feature is to implement auto-authentication. For example, JBoss required you to call SecurityAssociation.setPrincipal to grant permissions of a user to the event processing thread, as described in the Initialization Before Processing Each Event section, the Event Listening and Processing chapter.



Last Update : 2010/12/06

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