} finally {
Scopes.afterInterpret();
}
}
private void process0(Scope scope) throws Exception {
final Page page = getPage();
if (page == null || !page.isAlive()) {
String msg = (page == null ? "No page is available in "+_desktop: "Page "+page+" was destroyed");
if (_desktop.isAlive())
msg += " (but desktop is alive)";
else
msg += " because desktop was destroyed.\n"
+"It is usually caused by invalidating the native session directly. "
+"If it is required, please set Attributes.RENEW_NATIVE_SESSION first.";
log.warning(msg);
}
final String evtnm = _event.getName();
final Set listenerCalled = new HashSet();
//OK to use Set since the same listener cannot be added twice
boolean retry = false;
for (Iterator it = _comp.getListenerIterator(evtnm);;) {
final EventListener el = nextListener(it);
if (el == null) {
break; //done
} else if (el == RETRY) {
retry = true;
it = _comp.getListenerIterator(evtnm);
} else if ((el instanceof Express)
&& (!retry || !listenerCalled.contains(el))) {
listenerCalled.add(el);
el.onEvent(_event);
if (!_event.isPropagatable())
return; //done
}
}
final ZScript zscript = ((ComponentCtrl)_comp).getEventHandler(evtnm);
if (zscript != null && page != null) {
page.interpret(
zscript.getLanguage(), zscript.getContent(page, _comp), scope);
if (!_event.isPropagatable())
return; //done
}
retry = false;
listenerCalled.clear();
for (Iterator it = _comp.getListenerIterator(evtnm);;) {
final EventListener el = nextListener(it);
if (el == null) {
break; //done
} else if (el == RETRY) {
retry = true;
it = _comp.getListenerIterator(evtnm);
} else if (!(el instanceof Express)
&& (!retry || !listenerCalled.contains(el))) {
listenerCalled.add(el);
el.onEvent(_event);
if (!_event.isPropagatable())
return; //done
}
}
final Method mtd =
ComponentsCtrl.getEventMethod(_comp.getClass(), evtnm);
if (mtd != null) {
// if (log.finerable()) log.finer("Method for event="+evtnm+" comp="+_comp+" method="+mtd);
if (mtd.getParameterTypes().length == 0)
mtd.invoke(_comp, null);
else
mtd.invoke(_comp, new Object[] {_event});
if (!_event.isPropagatable())
return; //done
}
retry = false;
listenerCalled.clear();
if (page != null)
for (Iterator it = page.getListenerIterator(evtnm);;) {
final EventListener el = nextListener(it);
if (el == null) {
break; //done
} else if (el == RETRY) {
retry = true;
it = page.getListenerIterator(evtnm);
} else if (!retry || !listenerCalled.contains(el)) {
listenerCalled.add(el);
el.onEvent(_event);
if (!_event.isPropagatable())