Package org.zkoss.zk.ui.event
Interface EventThreadSuspend
-
public interface EventThreadSuspend
Used to listen when the event processing thread is going to suspend.How this interface is used.
- First, you specify a class that implements this interface in WEB-INF/zk.xml as a listener.
- Then, an instance of the specified class is constructed and
beforeSuspend(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.lang.Object)
is invoked, before the thread is going to suspend. IfbeforeSuspend(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.lang.Object)
throws a exception, the thread won't be suspended.
- Author:
- tomyeh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
afterSuspend(Component comp, Event evt)
Called in the servlet thread after the event processing thread has been suspended.void
beforeSuspend(Component comp, Event evt, java.lang.Object obj)
Called before the event processing thread is suspended.
-
-
-
Method Detail
-
beforeSuspend
void beforeSuspend(Component comp, Event evt, java.lang.Object obj) throws java.lang.Exception
Called before the event processing thread is suspended. It is called in the context of the event processing thread.If developers want to disable the suspend/resume feature or to limit number of suspended thread, they could throw an exception to prevent the event thread from suspending.
- Parameters:
obj
- which object thatExecutions.wait(java.lang.Object)
is called with.- Throws:
java.lang.Exception
- preventing the thread from suspending.
-
afterSuspend
void afterSuspend(Component comp, Event evt) throws java.lang.Exception
Called in the servlet thread after the event processing thread has been suspended.Unlike
beforeSuspend(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.lang.Object)
, any exception thrown by this method are simply logged and ignored.- Throws:
java.lang.Exception
-
-