Event Interceptors"

From Documentation
m ((via JWB))
m (replace tt with code (via JWB))
Line 3: Line 3:
 
Though <javadoc type="interface">org.zkoss.zk.ui.util.EventInterceptor</javadoc> is designed to allow developer to intercept how an event is processed, you could use it as callback to know how long it takes to process an event. The event processing time can be calculated by subtracting the time between <javadoc method="beforeProcessEvent(org.zkoss.zk.ui.event.Event)" type="interface">org.zkoss.zk.ui.util.EventInterceptor</javadoc> and <javadoc method="afterProcessEvent(org.zkoss.zk.ui.event.Event)" type="interface">org.zkoss.zk.ui.util.EventInterceptor</javadoc>
 
Though <javadoc type="interface">org.zkoss.zk.ui.util.EventInterceptor</javadoc> is designed to allow developer to intercept how an event is processed, you could use it as callback to know how long it takes to process an event. The event processing time can be calculated by subtracting the time between <javadoc method="beforeProcessEvent(org.zkoss.zk.ui.event.Event)" type="interface">org.zkoss.zk.ui.util.EventInterceptor</javadoc> and <javadoc method="afterProcessEvent(org.zkoss.zk.ui.event.Event)" type="interface">org.zkoss.zk.ui.util.EventInterceptor</javadoc>
  
Once implemented, you could register it by specifying the following in <tt>WEB-INF/zk.xml</tt> (assume the class is called foo.MyEventMeter):
+
Once implemented, you could register it by specifying the following in <code>WEB-INF/zk.xml</code> (assume the class is called foo.MyEventMeter):
  
 
<source lang="xml">
 
<source lang="xml">

Revision as of 14:14, 12 January 2022

Though EventInterceptor is designed to allow developer to intercept how an event is processed, you could use it as callback to know how long it takes to process an event. The event processing time can be calculated by subtracting the time between EventInterceptor.beforeProcessEvent(Event) and EventInterceptor.afterProcessEvent(Event)

Once implemented, you could register it by specifying the following in WEB-INF/zk.xml (assume the class is called foo.MyEventMeter):

<zk>
    <listener>
        <listener-class>foo.MyEventMeter</listener-class>
    </listener>
</zk>

Version History

Last Update : 2022/01/12


Version Date Content
     



Last Update : 2022/01/12

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