Life Cycle Listener

From Documentation
Revision as of 06:33, 2 December 2010 by Tomyeh (talk | contribs)


Life Cycle Listener


You could have some custom initialization and cleanup when an application, a session, a desktop or an execution is instantiated or about to being destroyed.

There are two steps:

  1. Implements the corresponding interface. For example, WebAppInit for application's initialization
  2. Register it in WEB-INF/zk.xml, or in Java.
Version Date Content
Scope Interfaces Description
Application

The registration in WEB-INF/zk.xml is the same, no matter what interface you implement:

<listener>
    <listener-class>my.MyImplementation</listener-class>
</listener>

The registration in Java is done by Configuration.addListener(Class).

webapp.getConfiguration().addListener(my.MyImplementation.class);

Version History

Last Update : 2010/12/02


Version Date Content
     



Last Update : 2010/12/02

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